From 557f24ff7194f1e8a1fb8471200d42cdf3b7ed7c Mon Sep 17 00:00:00 2001 From: phk Date: Mon, 8 Oct 2007 19:15:41 +0000 Subject: [PATCH] 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. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2095 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/cache_acceptor_poll.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/varnish-cache/bin/varnishd/cache_acceptor_poll.c b/varnish-cache/bin/varnishd/cache_acceptor_poll.c index 8a2587c8..7cb29803 100644 --- a/varnish-cache/bin/varnishd/cache_acceptor_poll.c +++ b/varnish-cache/bin/varnishd/cache_acceptor_poll.c @@ -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 @@ vca_main(void *arg) 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; -- 2.39.5