<p dir="ltr">All i am trying to do is to detect idle task and remove it from the running queue or deactivate it. <br>
Thank you for your patience :) </p>
<div class="gmail_quote">On 4 Jun 2015 14:51, "Nicholas Krause" <<a href="mailto:xerofoify@gmail.com">xerofoify@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
On June 4, 2015 3:35:25 AM EDT, Mustafa Hussain <<a href="mailto:mustafa.hussain93@gmail.com">mustafa.hussain93@gmail.com</a>> wrote:<br>
>System crashes, system can not start<br>
><br>
I was not thinking and this schedules the idle thread. What are you trying to accomplish through.<br>
Nick<br>
><br>
>On June 3, 2015 9:41:52 PM EDT, Mustafa Hussain<br>
><<a href="mailto:mustafa.hussain93@gmail.com">mustafa.hussain93@gmail.com</a>><br>
>wrote:<br>
>>i want to dequeue the idle task how can i do this ?<br>
>Why there is no point. Clearly your asking questions in order to learn<br>
>the<br>
>scheduler.<br>
>If your interested in learning it I can help but, you need to think<br>
>about<br>
>what you<br>
> trying to accomplish first.<br>
>Nick<br>
><br>
>>On Thu, Jun 4, 2015 at 3:40 AM, Mustafa Hussain<br>
>><<a href="mailto:mustafa.hussain93@gmail.com">mustafa.hussain93@gmail.com</a><br>
>>> wrote:<br>
>><br>
>>> Hi nick,<br>
>>> i applied your suggested edit and i got "bad: scheduling from the<br>
>>idle<br>
>>> thread!"<br>
>>> how can i solve this ?<br>
>>><br>
>>> On Wed, Jun 3, 2015 at 12:29 AM, nick <<a href="mailto:xerofoify@gmail.com">xerofoify@gmail.com</a>> wrote:<br>
>>><br>
>>>><br>
>>>><br>
>>>> On 2015-06-02 06:25 PM, <a href="mailto:Valdis.Kletnieks@vt.edu">Valdis.Kletnieks@vt.edu</a> wrote:<br>
>>>> > On Tue, 02 Jun 2015 23:38:48 +0200, Mustafa Hussain said:<br>
>>>> ><br>
>>>> >>> /*Check if the pointer pointing to the idle class is equal to<br>
>>prev's<br>
>>>> >>> 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<br>
>>the<br>
>>>> idle<br>
>>>> >>> sched_class\n");<br>
>>>> ><br>
>>>> > Hopefully, you didn't take Nick's advice without thinking about<br>
>>it....<br>
>>>> ><br>
>>>> > As I type this, powertop tells me:<br>
>>>> ><br>
>>>> > Summary: 821.8 wakeups/second, 0.0 GPU ops/seconds, 0.0 VFS<br>
>>ops/sec<br>
>>>> and 18.8% CPU use<br>
>>>> ><br>
>>>> > That printk is going to spam your dmesg pretty hard.<br>
>>>> ><br>
>>>> > A better question is:<br>
>>>> ><br>
>>>> > If prev is about to go idle, *what do you want to do*? (Hint:<br>
>>newer<br>
>>>> > kernels already do a bunch of stuff when a cpu/core goes idle,<br>
>you<br>
>>>> > probably want to make sure you're not working against something<br>
>>here...)<br>
>>>> ><br>
>>>> I didn't account for rate limiting the debug messages, forgot about<br>
>>that<br>
>>>> . :)<br>
>>>> I do agree his question is not the best but he wanted a answer so I<br>
>>>> decided<br>
>>>> to just give him a answer that works for his learning.<br>
>>>> Nick<br>
>>>><br>
>>><br>
>>><br>
><br>
>--<br>
>Sent from my Android device with K-9 Mail. Please excuse my brevity.<br>
<br>
--<br>
Sent from my Android device with K-9 Mail. Please excuse my brevity.<br>
</blockquote></div>