<div dir="ltr">this what i was talking you about :)</div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, May 9, 2015 at 9:29 PM, nick <span dir="ltr"><<a href="mailto:xerofoify@gmail.com" target="_blank">xerofoify@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><br>
<br>
On 2015-05-09 12:44 PM, Mustafa Hussain wrote:<br>
> Hi all,<br>
><br>
> i am working with __sched __schedule()<br>
><br>
> and i want to add some thing i want to check whether the prev will become<br>
> idle or not how can i do this.<br>
><br>
> thanks in advance<br>
><br>
</div></div>> -<br>
> -<br>
Mustafa,<br>
After looking around in pick_next_task there is a scheduler class called<br>
idle_sched_class for idling when tasks need to be run. Something like<br>
/*declare sched_class pointer to idle_sched_class address*/<br>
const struct sched_class *idle=&idle_sched_class;<br>
/*Check if the pointer pointing to the idle class is equal to prev's sched_class*/<br>
if(prev->sched_class == idle)<br>
After this condition you can just:<br>
printk(KERN_INFO "Prev is equal to idle_sched_class,now running the idle sched_class\n");<br>
If you have another question about this please let me known.<br>
Cheers,<br>
Nick<br>
><br>
><br>
><br>
> _______________________________________________<br>
> Kernelnewbies mailing list<br>
> <a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
> <a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
><br>
</blockquote></div><br></div>