]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: init: don't limit cpu-map to the first 32 processes only
authorWilly Tarreau <w@1wt.eu>
Mon, 20 Apr 2015 09:36:57 +0000 (11:36 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 20 Apr 2015 09:36:57 +0000 (11:36 +0200)
We have to allow 32 or 64 processes depending on the machine's word
size, and on 64-bit machines only the first 32 processes were properly
bound.

This fix should be backported to 1.5.

src/haproxy.c

index 752c4a2d02677042aa1826997dcd43978d25423c..1a913e37a94c28fef8fac18b84a0db3e4cab6b89 100644 (file)
@@ -1762,7 +1762,7 @@ int main(int argc, char **argv)
 
 #ifdef USE_CPU_AFFINITY
                if (proc < global.nbproc &&  /* child */
-                   proc < 32 &&             /* only the first 32 processes may be pinned */
+                   proc < LONGBITS &&       /* only the first 32/64 processes may be pinned */
                    global.cpu_map[proc])    /* only do this if the process has a CPU map */
                        sched_setaffinity(0, sizeof(unsigned long), (void *)&global.cpu_map[proc]);
 #endif