Friday, 15 March 2013

Diff between various CPU masks - Linux kernel -



Diff between various CPU masks - Linux kernel -

i going through boot code , came across next masks . ones set in boot_cpu_init()

cpu online mask : number of cpu's available getting scheduled on cpu active mask : number of cpu's on task can migrated (not clear difference between online , active) cpu nowadays mask : total number of cpu's limited max cpu's variable cpu possible mask : total number of possible cpu's in scheme

but still not clear me why these masks nowadays . why not have cpu_online_bits() lone . wouldn't suffice see cpu available , total cpu's available scheme ?

i had same questions , found post here. after digging it, got points them. cpu hotplug plays of import part in them.

the 'possible' mask , 'present' mask stand static cpu resources, 'online' , 'active' mean dynamic ones. static resources declared either @ compile time or @ booting stage. won't changed during kernel life time. dynamic resources vary cpu hotplug operations.

sometimes may need allocate or initialize other resources each 'possible' cpus, initialize lists each 'possible' cpus in blk_softirq_init().

it's harder tell differences between cpu 'online' , 'active' booting time, can thought during procedure offline cpu. steps set cpu downwards next graph http://image.slidesharecdn.com/cpuhotplugrcuandbig-140320112138-phpapp02/95/lce12-cpu-hotplug-rcu-and-biglittle-22-638.jpg?cb=1395333911

when cpu entered 1st step, i.e. cpu_down_prepare, scheduler marks not 'active', it's still 'online' @ moment. scheduler not migrate task @ time. after cpu totally removed, it's not 'online' anymore.

i not sure whether still need info or not, write downwards more detail traces in http://vh21.github.io/linux/2015/04/28/linux-cpu-mask.html

linux linux-kernel embedded-linux

No comments:

Post a Comment