<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">&lt;<a href="mailto:xerofoify@gmail.com" target="_blank">xerofoify@gmail.com</a>&gt;</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>
&gt; Hi all,<br>
&gt;<br>
&gt; i am working with __sched __schedule()<br>
&gt;<br>
&gt; and i want to add some thing i want to check whether the prev will become<br>
&gt; idle or not how can i do this.<br>
&gt;<br>
&gt; thanks in advance<br>
&gt;<br>
</div></div>&gt;    -<br>
&gt;    -<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=&amp;idle_sched_class;<br>
/*Check if the pointer pointing to the idle class is equal to prev&#39;s sched_class*/<br>
if(prev-&gt;sched_class == idle)<br>
After this condition you can just:<br>
printk(KERN_INFO &quot;Prev is equal to idle_sched_class,now running the idle sched_class\n&quot;);<br>
If you have another question about this please let me known.<br>
Cheers,<br>
Nick<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Kernelnewbies mailing list<br>
&gt; <a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
&gt; <a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
&gt;<br>
</blockquote></div><br></div>