diff options
author | marino <marino@FreeBSD.org> | 2015-05-01 03:34:46 +0800 |
---|---|---|
committer | marino <marino@FreeBSD.org> | 2015-05-01 03:34:46 +0800 |
commit | 23ff0615b0bff00f800b247c916f1237e1409f8d (patch) | |
tree | 9f6d4de1c256db62374ff310080a5576103a1277 | |
parent | 1a85479538dd97f2f5112c08eb0acbd1526a2869 (diff) | |
download | freebsd-ports-gnome-23ff0615b0bff00f800b247c916f1237e1409f8d.tar.gz freebsd-ports-gnome-23ff0615b0bff00f800b247c916f1237e1409f8d.tar.zst freebsd-ports-gnome-23ff0615b0bff00f800b247c916f1237e1409f8d.zip |
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)
-rw-r--r-- | www/squid/Makefile | 1 | ||||
-rw-r--r-- | www/squid/files/patch-src_DiskIO_Mmapped_MmappedFile.cc | 11 | ||||
-rw-r--r-- | www/squid/files/patch-src_ipc_mem_Segment.cc | 11 |
3 files changed, 23 insertions, 0 deletions
diff --git a/www/squid/Makefile b/www/squid/Makefile index 21a38b2e21dd..65ed42cdbe27 100644 --- a/www/squid/Makefile +++ b/www/squid/Makefile @@ -2,6 +2,7 @@ PORTNAME= squid PORTVERSION= 3.5.3 +PORTREVISION= 1 CATEGORIES= www ipv6 MASTER_SITES= http://www.squid-cache.org/Versions/v3/${PORTVERSION:R}/ \ http://www2.us.squid-cache.org/Versions/v3/${PORTVERSION:R}/ \ 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; diff --git a/www/squid/files/patch-src_ipc_mem_Segment.cc b/www/squid/files/patch-src_ipc_mem_Segment.cc new file mode 100644 index 000000000000..adef66211481 --- /dev/null +++ b/www/squid/files/patch-src_ipc_mem_Segment.cc @@ -0,0 +1,11 @@ +--- src/ipc/mem/Segment.cc.orig 2015-04-15 10:38:29.724278000 +0300 ++++ src/ipc/mem/Segment.cc 2015-04-15 10:39:37.130756000 +0300 +@@ -150,7 +150,7 @@ + assert(theSize == static_cast<off_t>(static_cast<size_t>(theSize))); + + void *const p = +- mmap(NULL, theSize, PROT_READ | PROT_WRITE, MAP_SHARED, theFD, 0); ++ mmap(NULL, theSize, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_NOSYNC, theFD, 0); + if (p == MAP_FAILED) { + debugs(54, 5, HERE << "mmap " << theName << ": " << xstrerror()); + fatalf("Ipc::Mem::Segment::attach failed to mmap(%s): %s\n", |