idle task check

Valdis.Kletnieks at vt.edu Valdis.Kletnieks at vt.edu
Tue Jun 2 18:25:31 EDT 2015


On Tue, 02 Jun 2015 23:38:48 +0200, Mustafa Hussain said:

> > /*Check if the pointer pointing to the idle class is equal to prev's
> > sched_class*/
> > if(prev->sched_class == idle)
> > After this condition you can just:
> > printk(KERN_INFO "Prev is equal to idle_sched_class,now running the idle
> > sched_class\n");

Hopefully, you didn't take Nick's advice without thinking about it....

As I type this, powertop tells me:

Summary: 821.8 wakeups/second,  0.0 GPU ops/seconds, 0.0 VFS ops/sec and 18.8% CPU use

That printk is going to spam your dmesg pretty hard.

A better question is:

If prev is about to go idle, *what do you want to do*?  (Hint: newer
kernels already do a bunch of stuff when a cpu/core goes idle, you
probably want to make sure you're not working against something here...)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 848 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20150602/aa258606/attachment.bin 


More information about the Kernelnewbies mailing list