From 083f772cc866102df4b1b31fad8ddc6d73fa292b Mon Sep 17 00:00:00 2001 From: John Marino Date: Thu, 30 Apr 2015 19:34:46 +0000 Subject: www/squid: Add MAP_NOSYNC flay to mmap call This is the same technique used by PostgreSQL to prevent dirty pages from flushing prematurely (performance hit). In any case, it can't hurt and it's been used in production for 18 months. Timp87 provided the 3.5 version of squid; the port is still unmaintained. PR: 198920 Submitted by: emz (norma.perm.ru) concurred: timp87 (gmail) --- www/squid/files/patch-src_DiskIO_Mmapped_MmappedFile.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 www/squid/files/patch-src_DiskIO_Mmapped_MmappedFile.cc (limited to 'www/squid/files/patch-src_DiskIO_Mmapped_MmappedFile.cc') diff --git a/www/squid/files/patch-src_DiskIO_Mmapped_MmappedFile.cc b/www/squid/files/patch-src_DiskIO_Mmapped_MmappedFile.cc new file mode 100644 index 000000000000..0c0fb850ada5 --- /dev/null +++ b/www/squid/files/patch-src_DiskIO_Mmapped_MmappedFile.cc @@ -0,0 +1,11 @@ +--- src/DiskIO/Mmapped/MmappedFile.cc.orig 2015-04-15 10:39:56.146312000 +0300 ++++ src/DiskIO/Mmapped/MmappedFile.cc 2015-04-15 10:40:53.487834000 +0300 +@@ -235,7 +235,7 @@ + static const int pageSize = getpagesize(); + delta = offset % pageSize; + +- buf = mmap(NULL, length + delta, prot, flags, fd, offset - delta); ++ buf = mmap(NULL, length + delta, prot, flags | MAP_NOSYNC, fd, offset - delta); + + if (buf == MAP_FAILED) { + const int errNo = errno; -- cgit v1.2.3