r2095 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Mon Oct 8 21:15:42 CEST 2007


Author: phk
Date: 2007-10-08 21:15:41 +0200 (Mon, 08 Oct 2007)
New Revision: 2095

Modified:
   trunk/varnish-cache/bin/varnishd/cache_acceptor_poll.c
Log:
Try to optimize the poll acceptor by moving active entries to the
front of the linked list where they will be found faster later on.


Modified: trunk/varnish-cache/bin/varnishd/cache_acceptor_poll.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_acceptor_poll.c	2007-10-08 16:40:28 UTC (rev 2094)
+++ trunk/varnish-cache/bin/varnishd/cache_acceptor_poll.c	2007-10-08 19:15:41 UTC (rev 2095)
@@ -28,9 +28,6 @@
  *
  * $Id$
  *
- * XXX: We need to pass sessions back into the event engine when they are
- * reused.  Not sure what the most efficient way is for that.  For now
- * write the session pointer to a pipe which the event engine monitors.
  */
 
 #if defined(HAVE_POLL)
@@ -132,9 +129,11 @@
 			if (pollfd[fd].revents) {
 				v--;
 				i = HTC_Rx(sp->htc);
-				if (i == 0)
-					continue;
 				VTAILQ_REMOVE(&sesshead, sp, list);
+				if (i == 0) {
+					VTAILQ_INSERT_HEAD(&sesshead, sp, list);
+					continue;
+				}
 				vca_unpoll(fd);
 				vca_handover(sp, i);
 				continue;




More information about the varnish-commit mailing list