You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by jp...@apache.org on 2010/05/27 20:09:54 UTC

svn commit: r948938 - /trafficserver/traffic/trunk/iocore/eventsystem/SocketManager.cc

Author: jplevyak
Date: Thu May 27 18:09:54 2010
New Revision: 948938

URL: http://svn.apache.org/viewvc?rev=948938&view=rev
Log:
TS-376: cleanup and comment one more alignment and #ifdef out hack for linux 2.2
I could remove the hack entirely but perhaps we'll give it a few days of testing.

Modified:
    trafficserver/traffic/trunk/iocore/eventsystem/SocketManager.cc

Modified: trafficserver/traffic/trunk/iocore/eventsystem/SocketManager.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/eventsystem/SocketManager.cc?rev=948938&r1=948937&r2=948938&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/eventsystem/SocketManager.cc (original)
+++ trafficserver/traffic/trunk/iocore/eventsystem/SocketManager.cc Thu May 27 18:09:54 2010
@@ -81,10 +81,10 @@ int
 safe_msync(caddr_t addr, size_t len, caddr_t end, int flags)
 {
   (void) end;
-  // TODO: This is some sort of alignment
-  caddr_t a = (caddr_t) (((unsigned long) addr) & ~(socketManager.pagesize - 1));
-  size_t l = (len + (addr - a) + socketManager.pagesize - 1)
-    & ~(socketManager.pagesize - 1);
+  // align start back to page boundary
+  caddr_t a = (caddr_t) (((uintptr_t) addr) & ~(socketManager.pagesize - 1));
+  // align length to page boundry covering region
+  size_t l = (len + (addr - a) + (socketManager.pagesize - 1)) & ~(socketManager.pagesize - 1);
   if ((a + l) > end)
     l = end - a;                // strict limit
 #if defined(linux)
@@ -93,9 +93,12 @@ safe_msync(caddr_t addr, size_t len, cad
    non-dirty buffers. This is true as of kernel 2.2.12. We sacrifice
    restartability under OS in order to avoid a nasty performance hit
    from a kernel global lock. */
+#if 0
+  // this was long long ago
   if (flags & MS_SYNC)
     flags = (flags & ~MS_SYNC) | MS_ASYNC;
 #endif
+#endif
   int res = msync(a, l, flags);
   return res;
 }