Re: maxcpus confusion

From: Randy Dunlap
Date: Mon Dec 04 2017 - 17:40:50 EST


On 12/04/2017 01:02 PM, Heiko Carstens wrote:
> On Fri, Dec 01, 2017 at 12:58:47PM -0800, Randy Dunlap wrote:
>> Hi,
>>
>> I used "maxcpus=1" on a recent x86 boot (4.15-rc1) and got 4 CPUs (all of
>> them AFAICT). When I use "nr_cpus=1", I do get a hard limit of one CPU.
>>
>>
>> A few boot log excerpts:
>>
>> [ 0.000000] smpboot: Allowing 8 CPUs, 4 hotplug CPUs
>> ...
>> [ 0.030007] smp: Bringing up secondary CPUs ...
>> [ 0.030109] smp: Brought up 1 node, 1 CPU
>> [ 0.030181] smpboot: Max logical packages: 4
>> [ 0.030255] smpboot: Total of 1 processors activated (4789.06 BogoMIPS)
>>
>>
>> Is systemd (or something else) later onlining the other CPUs?
>>
>> /sys/devices/system/cpu/online is 0-3
>> /sys/devices/system/cpu/offline is 4-7
>
> Check /lib/udev/rules.d/ for a rule that auto-onlines CPUs.
> This behavior is distribution specific.

You got it in one try. Thanks. It would have taken me awhile to find that.

I owe you a beer if you get to Portland, Oregon. :)

--
~Randy