idle task check

Mustafa Hussain mustafa.hussain93 at gmail.com
Thu Jun 4 08:34:33 EDT 2015


great, How can I check if this running task is used or not.. I mean by not
used that the task is running but not used by the user


On June 4, 2015 8:22:03 AM EDT, Mustafa Hussain <mustafa.hussain93 at gmail.com>
wrote:
>So I was just thinking about if i did this i can close apps that is
>running
>and user don't use them..
>On 4 Jun 2015 14:59, "Nicholas Krause" <xerofoify at gmail.com> wrote:
>
That's not a idle task,  that's a task in the
TASK_INTERRUPTIBLE  or TASK_RUNNING phase.
Nick
>>
>>
>> On June 4, 2015 7:56:30 AM EDT, Mustafa Hussain <
>> mustafa.hussain93 at gmail.com> wrote:
>> >All i am trying to do is to detect idle task and remove it from the
>> >running
>> >queue or deactivate it.
>> There is no reason  for that.  The idle tasks are only ever scheduled
>when
>> there is no other processes able to
>> run.  So trying to remove them is a
>> bad idea.
>> Nick
>> >Thank you for your patience :)
>> >On 4 Jun 2015 14:51, "Nicholas Krause" <xerofoify at gmail.com> wrote:
>> >
>> >>
>> >>
>> >> On June 4, 2015 3:35:25 AM EDT, Mustafa Hussain <
>> >> mustafa.hussain93 at gmail.com> wrote:
>> >> >System crashes,  system can not start
>> >> >
>> >> I was not thinking and this schedules the idle thread. What are
>you
>> >trying
>> >> to accomplish through.
>> >> Nick
>> >> >
>> >> >On June 3, 2015 9:41:52 PM EDT, Mustafa Hussain
>> >> ><mustafa.hussain93 at gmail.com>
>> >> >wrote:
>> >> >>i want to dequeue the idle task how can i do this ?
>> >> >Why there is no point.  Clearly your asking questions in order to
>> >learn
>> >> >the
>> >> >scheduler.
>> >> >If your interested in learning it I  can help but,  you need to
>> >think
>> >> >about
>> >> >what you
>> >> > trying to accomplish first.
>> >> >Nick
>> >> >
>> >> >>On Thu, Jun 4, 2015 at 3:40 AM, Mustafa Hussain
>> >> >><mustafa.hussain93 at gmail.com
>> >> >>> wrote:
>> >> >>
>> >> >>> Hi nick,
>> >> >>> i applied your suggested edit and i got "bad: scheduling from
>the
>> >> >>idle
>> >> >>> thread!"
>> >> >>> how can i solve this ?
>> >> >>>
>> >> >>> On Wed, Jun 3, 2015 at 12:29 AM, nick <xerofoify at gmail.com>
>> >wrote:
>> >> >>>
>> >> >>>>
>> >> >>>>
>> >> >>>> On 2015-06-02 06:25 PM, Valdis.Kletnieks at vt.edu wrote:
>> >> >>>> > 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...)
>> >> >>>> >
>> >> >>>> I didn't account for rate limiting the debug messages, forgot
>> >about
>> >> >>that
>> >> >>>> . :)
>> >> >>>> I do agree his question is not the best but he wanted a
>answer
>> >so I
>> >> >>>> decided
>> >> >>>> to just give him a answer that works for his learning.
>> >> >>>> Nick
>> >> >>>>
>> >> >>>
>> >> >>>
>> >> >
>> >> >--
>> >> >Sent from my Android device with K-9 Mail. Please excuse my
>brevity.
>> >>
>> >> --
>> >> Sent from my Android device with K-9 Mail. Please excuse my
>brevity.
>> >>
>>
>> --
>> Sent from my Android device with K-9 Mail. Please excuse my brevity.
>>

--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20150604/ca38c8e7/attachment.html 


More information about the Kernelnewbies mailing list