开发者

core at which function is running

开发者 https://www.devze.com 2023-01-03 05:04 出处:网络
consider a kernel tasklet scheduled and executing the tasklet function. Is there a way to know which core the tasklet is running ?

consider a kernel tasklet scheduled and executing the tasklet function.

Is there a way to know which core the tasklet is running ? I mean is there a function / variable to know at which core the tasklet is running at. Architecture i开发者_StackOverflow社区s arm.

Thanks!


A tasklet will always run on the same processor core that scheduled it. Inside the kernel, you can call smp_processor_id() to find out what processor you're currently running on.

Check /proc/cpuinfo for a mapping of processor number to physical id and core id. Hyperthreading will create 2 logical processors for each core.


See man 7 cpuset.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号