From: Willy Tarreau Date: Sat, 21 Mar 2009 10:53:09 +0000 (+0100) Subject: [BUG] sched: don't leave 3 lasts tasks unprocessed when niced tasks are present X-Git-Tag: v1.3.16~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=218859ad6cacf0fbd812293eefc51b7877f115b3;p=thirdparty%2Fhaproxy.git [BUG] sched: don't leave 3 lasts tasks unprocessed when niced tasks are present When there are niced tasks, we would only process #tasks/4 per turn, without taking care of running #tasks when #tasks was below 4, leaving those tasks waiting for a few other tasks to push them. The fix simply consists in checking (#tasks+3)/4. --- diff --git a/src/task.c b/src/task.c index b4e2b97ca5..b46420a4a3 100644 --- a/src/task.c +++ b/src/task.c @@ -182,7 +182,7 @@ void process_runnable_tasks(int *next) max_processed = 200; if (likely(niced_tasks)) - max_processed /= 4; + max_processed = (max_processed + 3) / 4; expire = *next; eb = eb32_lookup_ge(&rqueue, rqueue_ticks - TIMER_LOOK_BACK);