Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Apr 2015 19:34:47 +0000 (UTC)
From:      John Marino <marino@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r385055 - in head/www/squid: . files
Message-ID:  <201504301934.t3UJYlEJ007989@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marino
Date: Thu Apr 30 19:34:46 2015
New Revision: 385055
URL: https://svnweb.freebsd.org/changeset/ports/385055

Log:
  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)

Added:
  head/www/squid/files/patch-src_DiskIO_Mmapped_MmappedFile.cc   (contents, props changed)
  head/www/squid/files/patch-src_ipc_mem_Segment.cc   (contents, props changed)
Modified:
  head/www/squid/Makefile

Modified: head/www/squid/Makefile
==============================================================================
--- head/www/squid/Makefile	Thu Apr 30 17:09:04 2015	(r385054)
+++ head/www/squid/Makefile	Thu Apr 30 19:34:46 2015	(r385055)
@@ -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}/ \

Added: head/www/squid/files/patch-src_DiskIO_Mmapped_MmappedFile.cc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/www/squid/files/patch-src_DiskIO_Mmapped_MmappedFile.cc	Thu Apr 30 19:34:46 2015	(r385055)
@@ -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;

Added: head/www/squid/files/patch-src_ipc_mem_Segment.cc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/www/squid/files/patch-src_ipc_mem_Segment.cc	Thu Apr 30 19:34:46 2015	(r385055)
@@ -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",



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201504301934.t3UJYlEJ007989>