开发者

Disable Linux Scheduler to meter power consumption of specific machine code instructions

开发者 https://www.devze.com 2023-03-29 00:36 出处:网络
how can i run a programm in linux thats runs about 10000 times a shift instruction without it being interrupted by the scheduler? I want to do so in or开发者_如何学Pythonder to examine power consumpti

how can i run a programm in linux thats runs about 10000 times a shift instruction without it being interrupted by the scheduler? I want to do so in or开发者_如何学Pythonder to examine power consumption of the native shift instruction.


The scheduler is not going to interrupt your task unless something else needs to run. Hardware interrupts (e.g. timers) will happen though, and they interrupt it for a while, but not very long normally.

However, I'm really not sure how measuring the power of a particular instruction is relevant; modern CPUs don't really work like that - they don't ever run just one instruction at once, and no "real" program uses just a single type of instruction.

I don't think the impact of hardware interrupts is going to be very much, especially if you're running a "tickless" kernel (which is usually enabled by default on newer systems).

0

精彩评论

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