From: Willy Tarreau Date: Fri, 7 Feb 2025 16:59:11 +0000 (+0100) Subject: BUG/MINOR: debug: make "debug dev sched" accept a negative TID X-Git-Tag: v3.2-dev5~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6765a32eb4f0a16ccd804668caed8a195f195a91;p=thirdparty%2Fhaproxy.git BUG/MINOR: debug: make "debug dev sched" accept a negative TID The TID passed to "debug dev sched" is used to pin the task to a given thread. A negative value normally means the task is unpinned and goes to the shared wait queue and run queue. However due to the type of the variable, negative values were mapped as highly positive values and were set to the current thread. Let's add the proper cast to fix this. No backport is needed since this is only used to experiment with the scheduler and measure its performance. --- diff --git a/src/debug.c b/src/debug.c index a6a2c3f88..6f8f5a964 100644 --- a/src/debug.c +++ b/src/debug.c @@ -1633,7 +1633,7 @@ static int debug_parse_cli_sched(char **args, char *payload, struct appctx *appc tctx[0] = (unsigned long)count; tctx[1] = (unsigned long)inter; - if (thrid >= global.nbthread) + if ((int)thrid >= global.nbthread) thrid = tid; for (i = 0; i < count; i++) {