mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-10 00:57:02 +02:00
BUG/MEDIUM: cpuset: fix cpuset size for FreeBSD
Fix the macro used to retrieve the max number of cpus on FreeBSD. The MAXCPU is not properly defined in userspace and always set to 1 despite the machine architecture. Replace it with CPU_SETSIZE. See https://freebsd-hackers.freebsd.narkive.com/gw4BeLum/smp-in-machine-params-h#post6 Without this, the following config file is rejected on FreeBSD even if the machine is SMP : global cpu-map 1-2 0-1 This must be backported up to 2.4.
This commit is contained in:
parent
6db9a97f61
commit
697cfde340
@ -110,12 +110,9 @@ void ha_cpuset_assign(struct hap_cpuset *dst, const struct hap_cpuset *src)
|
|||||||
|
|
||||||
int ha_cpuset_size()
|
int ha_cpuset_size()
|
||||||
{
|
{
|
||||||
#if defined(CPUSET_USE_CPUSET)
|
#if defined(CPUSET_USE_CPUSET) || defined(CPUSET_USE_FREEBSD_CPUSET)
|
||||||
return CPU_SETSIZE;
|
return CPU_SETSIZE;
|
||||||
|
|
||||||
#elif defined(CPUSET_USE_FREEBSD_CPUSET)
|
|
||||||
return MAXCPU;
|
|
||||||
|
|
||||||
#elif defined(CPUSET_USE_ULONG)
|
#elif defined(CPUSET_USE_ULONG)
|
||||||
return LONGBITS;
|
return LONGBITS;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user