Enable/disable cpu

Doug Wilson doug.lkml at gmail.com
Mon Oct 19 06:00:11 EDT 2015


All,

  I have been looking at sysfs cpu side code. Had a quick question.

On my x86 box:
#ls /sys/devices/system/cpu/
I see 4 cpus plus a few more fields such as online/present/possible etc.

This come from drivers/base/cpu.c.

My question here is, in each of those cpu0-3 folders, there's file by name
online which one can use to disable/enable cpu using cpumask. Could
someone point me to that code, I could not really pin point to where exactly
this attribute is defined. Am just exploring cpu hotplug feature.

Thanks.



More information about the Kernelnewbies mailing list