1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-18 08:02:48 +00:00

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)
This commit is contained in:
John Marino 2015-04-30 19:34:46 +00:00
parent d2d9dee332
commit 083f772cc8
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=385055
3 changed files with 23 additions and 0 deletions

View File

@ -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}/ \

View File

@ -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;

View File

@ -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",