From e6662bf706de55303fe0757294e9386d8f95861b Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Wed, 17 Apr 2024 16:37:04 +0200 Subject: [PATCH] MEDIUM: evports: permit to report multiple events at once Since the beginning in 2.0 the nevlist parameter was set to 1 before calling port_getn(), which means that a single FD event will be reported per polling loop. This is extremely inefficient, and all the code was designed to use global.tune.maxpollevents. It looks like it's a leftover of a temporary debugging change. No apparent issues were found by setting it to a higher value, so better do that. That code is not much used nowadays with Solaris disappearing from the landscape, so even if this definitely was a bug, it's preferable not to backport that fix as it could uncover other subtle bugs that were never raised yet. --- src/ev_evports.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ev_evports.c b/src/ev_evports.c index 0acded2f81..0d6828769a 100644 --- a/src/ev_evports.c +++ b/src/ev_evports.c @@ -185,7 +185,7 @@ static void _do_poll(struct poller *p, int exp, int wake) do { int timeout = (global.tune.options & GTUNE_BUSY_POLLING) ? 0 : wait_time; int interrupted = 0; - nevlist = 1; /* desired number of events to be retrieved */ + nevlist = global.tune.maxpollevents; /* desired number of events to be retrieved */ timeout_ts.tv_sec = (timeout / 1000); timeout_ts.tv_nsec = (timeout % 1000) * 1000000; -- 2.39.5