dovecot-2.0: ioloop: Use -1 for infinite poll/epoll timeout rath...
dovecot at dovecot.org
dovecot at dovecot.org
Wed Jan 26 21:48:16 EET 2011
details: http://hg.dovecot.org/dovecot-2.0/rev/16ce45dbcb53
changeset: 12578:16ce45dbcb53
user: Timo Sirainen <tss at iki.fi>
date: Wed Jan 26 21:47:52 2011 +0200
description:
ioloop: Use -1 for infinite poll/epoll timeout rather than INT_MAX.
Should improve performance a tiny bit and also works around a CPU eater bug
in Linux 2.6.37.
diffstat:
src/lib/ioloop.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diffs (18 lines):
diff -r fc02e620204d -r 16ce45dbcb53 src/lib/ioloop.c
--- a/src/lib/ioloop.c Tue Jan 25 00:32:50 2011 +0200
+++ b/src/lib/ioloop.c Wed Jan 26 21:47:52 2011 +0200
@@ -252,11 +252,12 @@
item = priorityq_peek(ioloop->timeouts);
timeout = (struct timeout *)item;
if (timeout == NULL) {
- /* no timeouts. give it INT_MAX msecs. */
+ /* no timeouts. use INT_MAX msecs for timeval and
+ return -1 for poll/epoll infinity. */
tv_r->tv_sec = INT_MAX / 1000;
tv_r->tv_usec = 0;
ioloop->next_max_time = (1ULL << (TIME_T_MAX_BITS-1)) - 1;
- return INT_MAX;
+ return -1;
}
tv_now.tv_sec = 0;
More information about the dovecot-cvs
mailing list