--------------------- PatchSet 6512 Date: 2005/03/17 03:57:19 Author: swsf Branch: epoll-2_5 Tag: (none) Log: Initial epoll patch. Members: configure.in:1.42.2.59->1.42.2.59.4.1 src/Makefile.am:1.13.2.9->1.13.2.9.10.1 src/client_side.c:1.47.2.59->1.47.2.59.2.1 src/comm.c:1.18.6.5->1.18.6.5.4.1 src/comm_select.c:1.8.6.6->1.8.6.6.22.1 src/fd.c:1.7.12.1->1.7.12.1.16.1 src/main.c:1.28.6.19->1.28.6.19.2.1 src/protos.h:1.41.6.22->1.41.6.22.4.1 src/squid.h:1.13.6.7->1.13.6.7.10.1 src/stat.c:1.13.6.11->1.13.6.11.4.1 src/structs.h:1.48.2.34->1.48.2.34.2.1 Index: squid/configure.in =================================================================== RCS file: /cvsroot/squid-sf//squid/configure.in,v retrieving revision 1.42.2.59 retrieving revision 1.42.2.59.4.1 diff -u -r1.42.2.59 -r1.42.2.59.4.1 --- squid/configure.in 24 Feb 2005 03:17:00 -0000 1.42.2.59 +++ squid/configure.in 17 Mar 2005 03:57:19 -0000 1.42.2.59.4.1 @@ -3,7 +3,7 @@ dnl dnl Duane Wessels, wessels@nlanr.net, February 1996 (autoconf v2.9) dnl -dnl $Id: configure.in,v 1.42.2.59 2005/02/24 03:17:00 squidadm Exp $ +dnl $Id: configure.in,v 1.42.2.59.4.1 2005/03/17 03:57:19 swsf Exp $ dnl dnl dnl @@ -11,7 +11,7 @@ AC_CONFIG_AUX_DIR(cfgaux) AM_INIT_AUTOMAKE(squid, 2.5.STABLE9-CVS) AM_CONFIG_HEADER(include/autoconf.h) -AC_REVISION($Revision: 1.42.2.59 $)dnl +AC_REVISION($Revision: 1.42.2.59.4.1 $)dnl AC_PREFIX_DEFAULT(/usr/local/squid) AM_MAINTAINER_MODE @@ -699,6 +699,26 @@ esac ]) +dnl Enable epoll() +AC_ARG_ENABLE(epoll, +[ --enable-epoll Enable epoll() instead of poll() or select(). + epoll() is best where available, but must be + explicitly set at the moment. + --disable-epoll Disable the use of epoll().], +[ + case "$enableval" in + yes) + echo "Forcing epoll() to be enabled" + ac_cv_func_epoll='yes' + ac_cv_func_poll='no' + ;; + no) + echo "Forcing epoll() to be disabled" + ac_cv_func_epoll='no' + ;; + esac +]) + dnl Disable HTTP violations AC_ARG_ENABLE(http-violations, [ --disable-http-violations @@ -1574,6 +1594,22 @@ AC_CHECK_LIB(rt, aio_read) fi +LIB_EPOLL='' +dnl Check for libepoll +dnl We use AIO in the coss store +if test "$ac_cv_func_epoll" = "yes"; then + AC_CHECK_FUNCS(epoll_ctl,[AC_DEFINE_UNQUOTED(HAVE_EPOLL, 1)], + [AC_CHECK_LIB(epoll, epoll_ctl,[AC_DEFINE_UNQUOTED(HAVE_EPOLL, 1)] LIB_EPOLL="-lepoll", + [echo "Error - no epoll found"; + echo "Try running 'sh ./scripts/get_epoll-lib.sh'"; + echo "then run configure again"; + exit -1], + [-L ./lib] + )] + ) +fi +AC_SUBST(LIB_EPOLL) + dnl -lintl is needed on SCO version 3.2v4.2 for strftime() dnl Robert Side dnl Mon, 18 Jan 1999 17:48:00 GMT Index: squid/src/Makefile.am =================================================================== RCS file: /cvsroot/squid-sf//squid/src/Makefile.am,v retrieving revision 1.13.2.9 retrieving revision 1.13.2.9.10.1 diff -u -r1.13.2.9 -r1.13.2.9.10.1 --- squid/src/Makefile.am 26 Sep 2004 02:14:23 -0000 1.13.2.9 +++ squid/src/Makefile.am 17 Mar 2005 03:57:24 -0000 1.13.2.9.10.1 @@ -226,6 +226,7 @@ @SNMPLIB@ \ @LIB_MALLOC@ \ @SSLLIB@ \ + @LIB_EPOLL@ \ -lmiscutil \ @XTRA_LIBS@ Index: squid/src/client_side.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/client_side.c,v retrieving revision 1.47.2.59 retrieving revision 1.47.2.59.2.1 diff -u -r1.47.2.59 -r1.47.2.59.2.1 --- squid/src/client_side.c 10 Mar 2005 14:11:55 -0000 1.47.2.59 +++ squid/src/client_side.c 17 Mar 2005 03:57:39 -0000 1.47.2.59.2.1 @@ -1,6 +1,6 @@ /* - * $Id: client_side.c,v 1.47.2.59 2005/03/10 14:11:55 squidadm Exp $ + * $Id: client_side.c,v 1.47.2.59.2.1 2005/03/17 03:57:39 swsf Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -2983,7 +2983,13 @@ debug(33, 4) ("clientReadRequest: FD %d closed\n", fd); comm_close(fd); return; - } else if (!Config.onoff.half_closed_clients) { + } else +#if HAVE_EPOLL + /* epoll patch does not work with half-closed connections */ + { +#else + if (!Config.onoff.half_closed_clients) { +#endif /* admin doesn't want to support half-closed client sockets */ debug(33, 3) ("clientReadRequest: FD %d aborted (half_closed_clients disabled)\n", fd); comm_close(fd); Index: squid/src/comm.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/comm.c,v retrieving revision 1.18.6.5 retrieving revision 1.18.6.5.4.1 diff -u -r1.18.6.5 -r1.18.6.5.4.1 --- squid/src/comm.c 14 Feb 2005 03:15:33 -0000 1.18.6.5 +++ squid/src/comm.c 17 Mar 2005 03:57:43 -0000 1.18.6.5.4.1 @@ -1,6 +1,6 @@ /* - * $Id: comm.c,v 1.18.6.5 2005/02/14 03:15:33 squidadm Exp $ + * $Id: comm.c,v 1.18.6.5.4.1 2005/03/17 03:57:43 swsf Exp $ * * DEBUG: section 5 Socket Functions * AUTHOR: Harvest Derived @@ -697,8 +697,13 @@ fde *F = &fd_table[fd]; F->defer_check = func; F->defer_data = data; +#if HAVE_EPOLL + comm_backoff_fd(fd); +#endif } +/* Epoll redefines this function in comm_select.c */ +#if !HAVE_EPOLL void commSetSelect(int fd, unsigned int type, PF * handler, void *client_data, time_t timeout) { @@ -719,6 +724,7 @@ if (timeout) F->timeout = squid_curtime + timeout; } +#endif void comm_add_close_handler(int fd, PF * handler, void *data) Index: squid/src/comm_select.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/comm_select.c,v retrieving revision 1.8.6.6 retrieving revision 1.8.6.6.22.1 diff -u -r1.8.6.6 -r1.8.6.6.22.1 --- squid/src/comm_select.c 12 May 2003 02:14:21 -0000 1.8.6.6 +++ squid/src/comm_select.c 17 Mar 2005 03:57:43 -0000 1.8.6.6.22.1 @@ -1,6 +1,6 @@ /* - * $Id: comm_select.c,v 1.8.6.6 2003/05/12 02:14:21 squidadm Exp $ + * $Id: comm_select.c,v 1.8.6.6.22.1 2005/03/17 03:57:43 swsf Exp $ * * DEBUG: section 5 Socket Functions * @@ -36,6 +36,8 @@ static int MAX_POLL_TIME = 1000; /* see also comm_quick_poll_required() */ +#if !HAVE_EPOLL + #ifndef howmany #define howmany(x, y) (((x)+((y)-1))/(y)) #endif @@ -133,15 +135,6 @@ #define commCheckHTTPIncoming (++http_io_events > (incoming_http_interval>> INCOMING_FACTOR)) static int -commDeferRead(int fd) -{ - fde *F = &fd_table[fd]; - if (F->defer_check == NULL) - return 0; - return F->defer_check(fd, F->defer_data); -} - -static int fdIsIcp(int fd) { if (fd == theInIcpConnection) @@ -1024,33 +1017,6 @@ #endif static void -checkTimeouts(void) -{ - int fd; - fde *F = NULL; - PF *callback; - for (fd = 0; fd <= Biggest_FD; fd++) { - F = &fd_table[fd]; - if (!F->flags.open) - continue; - if (F->timeout == 0) - continue; - if (F->timeout > squid_curtime) - continue; - debug(5, 5) ("checkTimeouts: FD %d Expired\n", fd); - if (F->timeout_handler) { - debug(5, 5) ("checkTimeouts: FD %d: Call timeout handler\n", fd); - callback = F->timeout_handler; - F->timeout_handler = NULL; - callback(fd, F->timeout_data); - } else { - debug(5, 5) ("checkTimeouts: FD %d: Forcing comm_close()\n", fd); - comm_close(fd); - } - } -} - -static void commIncomingStats(StoreEntry * sentry) { StatCounters *f = &statCounter; @@ -1106,6 +1072,365 @@ } } +#else /* HAVE_EPOLL */ +/* epoll structs */ +static int kdpfd; +static struct epoll_event *pevents; + +/* Array to keep track of backed off filedescriptors */ +static int backoff_fds[FD_SETSIZE]; + +static void checkTimeouts(void); +static int commDeferRead(int fd); + +static const char* +epolltype_atoi(int x) +{ + switch(x) { + + case EPOLL_CTL_ADD: + return "EPOLL_CTL_ADD"; + + case EPOLL_CTL_DEL: + return "EPOLL_CTL_DEL"; + + case EPOLL_CTL_MOD: + return "EPOLL_CTL_MOD"; + + default: + return "UNKNOWN_EPOLLCTL_OP"; + } +} + +/* Bring all fds back online */ +void +comm_backon_fds() { + struct epoll_event ev; + fde *F; + int i; + int fd; + int j=0; + + for(i=0;iepoll_state)) { + continue; + } + + /* we need to re-add the fd to the epoll list */ + ev.events = F->epoll_state; + ev.data.fd = fd; + + /* Try and add the fd back into the epoll struct */ + if (epoll_ctl(kdpfd, EPOLL_CTL_ADD, fd, &ev) < 0) { + /* If an unusual error occurs, log */ + if(errno != EEXIST) { + debug(5, 1) ("comm_backon_fds: epoll_ctl(,%s,,): failed on fd=%d: %s\n",epolltype_atoi(EPOLL_CTL_ADD), fd, xstrerror()); + } + } + else + { + F->epoll_backoff=0; + } + } + else + { + /* Break on the first zero fd */ + break; + } + } +} + + +/* Back off on the next epoll for the given fd */ +void +comm_backoff_fd(int fd) { + fde *F = &fd_table[fd]; + struct epoll_event ev; + int i; + + for(i=0;iepoll_state); + assert(fd >= 0); + assert(F->flags.open); + + + /* we need to delete the fd from the epoll list */ + ev.events = 0; + ev.data.fd = fd; + + if (epoll_ctl(kdpfd, EPOLL_CTL_DEL, fd, &ev) < 0) { + /* If an unusual error occurs, log it */ + if(errno != ENOENT) { + debug(5, 1) ("comm_backoff_fd: epoll_ctl(,%s,,): failed on fd=%d: %s\n",epolltype_atoi(EPOLL_CTL_DEL), fd, xstrerror()); + } + } + else + { + backoff_fds[i]=fd; + F->epoll_backoff=1; + } +} + + +void +comm_select_init() +{ + int i; + pevents = (struct epoll_event *) xmalloc(SQUID_MAXFD * sizeof(struct epoll_event)); + if (!pevents) { + fatalf("comm_select_init: xmalloc() failed: %s\n",xstrerror()); + } + + kdpfd = epoll_create(SQUID_MAXFD); + + if (kdpfd < 0) { + fatalf("comm_select_init: epoll_create(): %s\n",xstrerror()); + } + + for (i = 0; i < FD_SETSIZE; i++) { + backoff_fds[i]=0; + } +} + +void +commUpdateReadBits(int fd, PF *handler) +{ + /* Not imlpemented */ +} + +void +commUpdateWriteBits(int fd, PF *handler) +{ + /* Not imlpemented */ +} + +void +commSetSelect(int fd, unsigned int type, PF * handler, void *client_data, time_t timeout) + { + fde *F = &fd_table[fd]; + int epoll_ctl_type = 0; + struct epoll_event ev; + + assert(fd >= 0); + assert(F->flags.open); + debug(5, 8) ("commSetSelect(fd=%d,type=%u,handler=%p,client_data=%p,timeout=%ld)\n",fd,type,handler,client_data,timeout); + + ev.events = 0; + ev.data.fd = fd; + + if (type & COMM_SELECT_READ) { + if (handler) + ev.events |= EPOLLIN; + + F->read_handler = handler; + F->read_data = client_data; + + // Otherwise, use previously stored value + } else if ((F->epoll_state & EPOLLIN) && (F->read_handler)) { + ev.events |= EPOLLIN; + } + + if (type & COMM_SELECT_WRITE) { + if (handler) + ev.events |= EPOLLOUT; + + F->write_handler = handler; + F->write_data = client_data; + + // Otherwise, use previously stored value + } else if ((F->epoll_state & EPOLLOUT) && (F->write_handler)){ + ev.events |= EPOLLOUT; + } + + if (ev.events) + ev.events |= EPOLLHUP | EPOLLERR; + if (ev.events != F->epoll_state) { + // If the struct is already in epoll MOD or DEL, else ADD + if (F->epoll_state) + epoll_ctl_type = ev.events ? EPOLL_CTL_MOD : EPOLL_CTL_DEL; + else + epoll_ctl_type = EPOLL_CTL_ADD; + + /* Update the state */ + F->epoll_state = ev.events; + + /* If the FD is backed off, we just return. The update of + F->epoll_state will make sure that comm_backon_fds sets the + correct epoll options when the fd is brought back online */ + if(F->epoll_backoff) + return; + + if (epoll_ctl(kdpfd, epoll_ctl_type, fd, &ev) < 0) { + debug(5, 1) ("commSetSelect: epoll_ctl(%s): failed on fd=%d: %s\n", + epolltype_atoi(epoll_ctl_type), fd, xstrerror()); + } + } + + if (timeout) + F->timeout = squid_curtime + timeout; +} + +int comm_epoll(int msec) +{ + struct timespec ts; + int timeout; + static time_t last_timeout = 0; + int i; + int num; + int fd; + fde *F; + PF *hdl; + struct epoll_event *cevents; + + if (msec > MAX_POLL_TIME) + msec = MAX_POLL_TIME; + + debug(50, 3)("comm_epoll: timeout %d\n", msec); + ts.tv_sec = msec/1000; + ts.tv_nsec = (msec % 1000) * 1000; + + timeout = msec/ 1000; + getCurrentTime(); + + /* Check timeouts once per second */ + if (last_timeout < squid_curtime) { + last_timeout = squid_curtime; + checkTimeouts(); + } + + /* Check for disk io callbacks */ + storeDirCallback(); + + for (;;) { + num = epoll_wait(kdpfd, pevents, SQUID_MAXFD, msec); + statCounter.select_loops++; + + if (num >= 0) + break; + + if (ignoreErrno(errno)) + break; + + getCurrentTime(); + + return COMM_ERROR; + } + + getCurrentTime(); + + statHistCount(&statCounter.select_fds_hist, num); + + if (num == 0) + return COMM_TIMEOUT; /* No error.. */ + + for (i = 0, cevents = pevents; i < num; i++, cevents++) { + fd = cevents->data.fd; + F = &fd_table[fd]; + debug(5, 8) ("comm_poll(): got fd=%d events=%x monitoring=%x F->read_handler=%p F->write_handler=%p\n" + ,fd,cevents->events,F->epoll_state,F->read_handler,F->write_handler); + if (cevents->events & (EPOLLIN|EPOLLHUP|EPOLLERR)) { + if((hdl = F->read_handler) != NULL) { + debug(5, 8) ("comm_poll(): Calling read handler on fd=%d\n",fd); + F->read_handler = NULL; + hdl(fd, F->read_data); + if((F->read_handler == NULL) && (F->flags.open)) { + commSetSelect(fd, COMM_SELECT_READ, NULL, NULL, 0); + } + statCounter.select_fds++; + } else if(cevents->events & EPOLLIN) { + debug(5, 2) ("comm_poll(): no read handler for fd=%d",fd); + if(F->flags.open) { + commSetSelect(fd, COMM_SELECT_READ, NULL, NULL, 0); + } + } + } + + if (cevents->events & (EPOLLOUT|EPOLLHUP|EPOLLERR)) { + if((hdl = F->write_handler) != NULL) { + debug(5,8) ("comm_poll(): Calling write handler on fd=%d\n",fd); + F->write_handler = NULL; + hdl(fd, F->write_data); + statCounter.select_fds++; + if((F->write_handler == NULL) && (F->flags.open)) { + commSetSelect(fd, COMM_SELECT_WRITE, NULL, NULL, 0); + } + } else if(cevents->events & EPOLLOUT) { + debug(5, 2) ("comm_poll(): no write handler for fd=%d\n",fd); + if(F->flags.open) { + commSetSelect(fd, COMM_SELECT_WRITE, NULL, NULL, 0); + } + } + } + } + + /* bring backed off connections back online */ + comm_backon_fds(); + + /* End while loop */ + return COMM_OK; +} +#endif /* HAVE_EPOLL */ + +static int +commDeferRead(int fd) +{ + fde *F = &fd_table[fd]; + if (F->defer_check == NULL) + return 0; + return F->defer_check(fd, F->defer_data); +} + +static void +checkTimeouts(void) +{ + int fd; + fde *F = NULL; + PF *callback; + for (fd = 0; fd <= Biggest_FD; fd++) { + F = &fd_table[fd]; + if (!F->flags.open) + continue; + if (F->timeout == 0) + continue; + if (F->timeout > squid_curtime) + continue; + debug(5, 5) ("checkTimeouts: FD %d Expired\n", fd); + if (F->timeout_handler) { + debug(5, 5) ("checkTimeouts: FD %d: Call timeout handler\n", fd); + callback = F->timeout_handler; + F->timeout_handler = NULL; + callback(fd, F->timeout_data); + } else { + debug(5, 5) ("checkTimeouts: FD %d: Forcing comm_close()\n", fd); + comm_close(fd); + } + } +} + + /* Called by async-io or diskd to speed up the polling */ void comm_quick_poll_required(void) Index: squid/src/fd.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/fd.c,v retrieving revision 1.7.12.1 retrieving revision 1.7.12.1.16.1 diff -u -r1.7.12.1 -r1.7.12.1.16.1 --- squid/src/fd.c 15 Dec 2003 03:13:47 -0000 1.7.12.1 +++ squid/src/fd.c 17 Mar 2005 03:57:44 -0000 1.7.12.1.16.1 @@ -1,6 +1,6 @@ /* - * $Id: fd.c,v 1.7.12.1 2003/12/15 03:13:47 squidadm Exp $ + * $Id: fd.c,v 1.7.12.1.16.1 2005/03/17 03:57:44 swsf Exp $ * * DEBUG: section 51 Filedescriptor Functions * AUTHOR: Duane Wessels @@ -84,6 +84,11 @@ assert(F->write_handler == NULL); } debug(51, 3) ("fd_close FD %d %s\n", fd, F->desc); +#if HAVE_EPOLL + /* the epoll code needs to update the descriptor before flags.ope is 0 */ + commSetSelect(fd, COMM_SELECT_READ, NULL, NULL, 0); + commSetSelect(fd, COMM_SELECT_WRITE, NULL, NULL, 0); +#endif F->flags.open = 0; fdUpdateBiggest(fd, 0); Number_FD--; Index: squid/src/main.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/main.c,v retrieving revision 1.28.6.19 retrieving revision 1.28.6.19.2.1 diff -u -r1.28.6.19 -r1.28.6.19.2.1 --- squid/src/main.c 16 Mar 2005 03:17:22 -0000 1.28.6.19 +++ squid/src/main.c 17 Mar 2005 03:57:44 -0000 1.28.6.19.2.1 @@ -1,6 +1,6 @@ /* - * $Id: main.c,v 1.28.6.19 2005/03/16 03:17:22 squidadm Exp $ + * $Id: main.c,v 1.28.6.19.2.1 2005/03/17 03:57:44 swsf Exp $ * * DEBUG: section 1 Startup and Main Loop * AUTHOR: Harvest Derived @@ -735,7 +735,9 @@ eventRun(); if ((loop_delay = eventNextTime()) < 0) loop_delay = 0; -#if HAVE_POLL +#if HAVE_EPOLL + switch (comm_epoll(loop_delay)) { +#elif HAVE_POLL switch (comm_poll(loop_delay)) { #else switch (comm_select(loop_delay)) { Index: squid/src/protos.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/protos.h,v retrieving revision 1.41.6.22 retrieving revision 1.41.6.22.4.1 diff -u -r1.41.6.22 -r1.41.6.22.4.1 --- squid/src/protos.h 21 Feb 2005 03:13:32 -0000 1.41.6.22 +++ squid/src/protos.h 17 Mar 2005 03:57:44 -0000 1.41.6.22.4.1 @@ -1,6 +1,6 @@ /* - * $Id: protos.h,v 1.41.6.22 2005/02/21 03:13:32 squidadm Exp $ + * $Id: protos.h,v 1.41.6.22.4.1 2005/03/17 03:57:44 swsf Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -181,7 +181,10 @@ * comm_select.c */ extern void comm_select_init(void); -#if HAVE_POLL +#if HAVE_EPOLL +extern int comm_epoll(int); +extern void comm_backoff_fd(int fd); +#elif HAVE_POLL extern int comm_poll(int); #else extern int comm_select(int); Index: squid/src/squid.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/squid.h,v retrieving revision 1.13.6.7 retrieving revision 1.13.6.7.10.1 diff -u -r1.13.6.7 -r1.13.6.7.10.1 --- squid/src/squid.h 10 Aug 2004 02:13:32 -0000 1.13.6.7 +++ squid/src/squid.h 17 Mar 2005 03:57:45 -0000 1.13.6.7.10.1 @@ -1,6 +1,6 @@ /* - * $Id: squid.h,v 1.13.6.7 2004/08/10 02:13:32 squidadm Exp $ + * $Id: squid.h,v 1.13.6.7.10.1 2005/03/17 03:57:45 swsf Exp $ * * AUTHOR: Duane Wessels * @@ -252,6 +252,10 @@ #endif /* HAVE_POLL_H */ #endif /* HAVE_POLL */ +#if HAVE_EPOLL +#include +#endif + #if defined(HAVE_STDARG_H) #include #define HAVE_STDARGS /* let's hope that works everywhere (mj) */ Index: squid/src/stat.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/stat.c,v retrieving revision 1.13.6.11 retrieving revision 1.13.6.11.4.1 diff -u -r1.13.6.11 -r1.13.6.11.4.1 --- squid/src/stat.c 14 Feb 2005 03:15:35 -0000 1.13.6.11 +++ squid/src/stat.c 17 Mar 2005 03:57:46 -0000 1.13.6.11.4.1 @@ -1,6 +1,6 @@ /* - * $Id: stat.c,v 1.13.6.11 2005/02/14 03:15:35 squidadm Exp $ + * $Id: stat.c,v 1.13.6.11.4.1 2005/03/17 03:57:46 swsf Exp $ * * DEBUG: section 18 Cache Manager Statistics * AUTHOR: Harvest Derived @@ -812,7 +812,7 @@ storeAppendPrintf(sentry, "aborted_requests = %f/sec\n", XAVG(aborted_requests)); -#if HAVE_POLL +#if HAVE_POLL || HAVE_EPOLL storeAppendPrintf(sentry, "syscalls.polls = %f/sec\n", XAVG(syscalls.polls)); #else storeAppendPrintf(sentry, "syscalls.selects = %f/sec\n", XAVG(syscalls.selects)); Index: squid/src/structs.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/structs.h,v retrieving revision 1.48.2.34 retrieving revision 1.48.2.34.2.1 diff -u -r1.48.2.34 -r1.48.2.34.2.1 --- squid/src/structs.h 3 Mar 2005 03:16:34 -0000 1.48.2.34 +++ squid/src/structs.h 17 Mar 2005 03:57:46 -0000 1.48.2.34.2.1 @@ -1,6 +1,6 @@ /* - * $Id: structs.h,v 1.48.2.34 2005/03/03 03:16:34 squidadm Exp $ + * $Id: structs.h,v 1.48.2.34.2.1 2005/03/17 03:57:46 swsf Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -796,6 +796,10 @@ int bytes_read; int bytes_written; int uses; /* ie # req's over persistent conn */ +#if HAVE_EPOLL + unsigned epoll_state; + unsigned epoll_backoff; +#endif struct _fde_disk { DWCB *wrt_handle; void *wrt_handle_data; @@ -1863,7 +1867,7 @@ int recvfroms; int sendtos; } sock; -#if HAVE_POLL +#if HAVE_POLL || HAVE_EPOLL int polls; #else int selects;