All of lore.kernel.org
 help / color / mirror / Atom feed
* idle task check
@ 2015-05-09 16:44 Mustafa Hussain
       [not found] ` <554E6009.9050604@gmail.com>
  0 siblings, 1 reply; 12+ messages in thread
From: Mustafa Hussain @ 2015-05-09 16:44 UTC (permalink / raw)
  To: kernelnewbies

Hi all,

i am working with __sched __schedule()

and i want to add some thing i want to check whether the prev will become
idle or not how can i do this.

thanks in advance

   -
   -
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20150509/ef9bd7bc/attachment.html 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* idle task check
       [not found] ` <554E6009.9050604@gmail.com>
@ 2015-06-02 21:38   ` Mustafa Hussain
       [not found]     ` <556E22C4.1020009@gmail.com>
  2015-06-02 22:25     ` Valdis.Kletnieks at vt.edu
  0 siblings, 2 replies; 12+ messages in thread
From: Mustafa Hussain @ 2015-06-02 21:38 UTC (permalink / raw)
  To: kernelnewbies

this what i was talking you about :)

On Sat, May 9, 2015 at 9:29 PM, nick <xerofoify@gmail.com> wrote:

>
>
> On 2015-05-09 12:44 PM, Mustafa Hussain wrote:
> > Hi all,
> >
> > i am working with __sched __schedule()
> >
> > and i want to add some thing i want to check whether the prev will become
> > idle or not how can i do this.
> >
> > thanks in advance
> >
> >    -
> >    -
> Mustafa,
> After looking around in pick_next_task there is a scheduler class called
> idle_sched_class for idling when tasks need to be run. Something like
> /*declare sched_class pointer to idle_sched_class address*/
> const struct sched_class *idle=&idle_sched_class;
> /*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");
> If you have another question about this please let me known.
> Cheers,
> Nick
> >
> >
> >
> > _______________________________________________
> > Kernelnewbies mailing list
> > Kernelnewbies at kernelnewbies.org
> > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20150602/6247f2cd/attachment.html 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* idle task check
       [not found]     ` <556E22C4.1020009@gmail.com>
@ 2015-06-02 21:44       ` Mustafa Hussain
  0 siblings, 0 replies; 12+ messages in thread
From: Mustafa Hussain @ 2015-06-02 21:44 UTC (permalink / raw)
  To: kernelnewbies

yes

On Tue, Jun 2, 2015 at 11:40 PM, nick <xerofoify@gmail.com> wrote:

>
>
> On 2015-06-02 05:38 PM, Mustafa Hussain wrote:
> > this what i was talking you about :)
> >
> > On Sat, May 9, 2015 at 9:29 PM, nick <xerofoify@gmail.com> wrote:
> >
> >>
> >>
> >> On 2015-05-09 12:44 PM, Mustafa Hussain wrote:
> >>> Hi all,
> >>>
> >>> i am working with __sched __schedule()
> >>>
> >>> and i want to add some thing i want to check whether the prev will
> become
> >>> idle or not how can i do this.
> >>>
> >>> thanks in advance
> >>>
> >>>    -
> >>>    -
> >> Mustafa,
> >> After looking around in pick_next_task there is a scheduler class called
> >> idle_sched_class for idling when tasks need to be run. Something like
> >> /*declare sched_class pointer to idle_sched_class address*/
> >> const struct sched_class *idle=&idle_sched_class;
> >> /*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");
> >> If you have another question about this please let me known.
> >> Cheers,
> >> Nick
> >>>
> First do you known what scheduling classes/ task structures are?
> Nick
> >>>
> >>>
> >>> _______________________________________________
> >>> Kernelnewbies mailing list
> >>> Kernelnewbies at kernelnewbies.org
> >>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
> >>>
> >>
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20150602/85a07de0/attachment.html 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* idle task check
  2015-06-02 21:38   ` Mustafa Hussain
       [not found]     ` <556E22C4.1020009@gmail.com>
@ 2015-06-02 22:25     ` Valdis.Kletnieks at vt.edu
       [not found]       ` <556E2E58.5010102@gmail.com>
  1 sibling, 1 reply; 12+ messages in thread
From: Valdis.Kletnieks at vt.edu @ 2015-06-02 22:25 UTC (permalink / raw)
  To: kernelnewbies

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 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* idle task check
       [not found]             ` <776D0311-A28D-48BD-B324-DF7BF1E5C290@gmail.com>
@ 2015-06-04  7:35               ` Mustafa Hussain
       [not found]                 ` <FBA8EF8B-4F44-4E9C-982F-A7CB9BC5754E@gmail.com>
  0 siblings, 1 reply; 12+ messages in thread
From: Mustafa Hussain @ 2015-06-04  7:35 UTC (permalink / raw)
  To: kernelnewbies

System crashes,  system can not start


On June 3, 2015 9:41:52 PM EDT, Mustafa Hussain <mustafa.hussain93@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@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@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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20150604/e46e50ed/attachment-0001.html 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* idle task check
       [not found]                 ` <FBA8EF8B-4F44-4E9C-982F-A7CB9BC5754E@gmail.com>
@ 2015-06-04 11:56                   ` Mustafa Hussain
       [not found]                     ` <F1DE3F1C-AEDB-4E7D-88F5-B0C70D838960@gmail.com>
  0 siblings, 1 reply; 12+ messages in thread
From: Mustafa Hussain @ 2015-06-04 11:56 UTC (permalink / raw)
  To: kernelnewbies

All i am trying to do is to detect idle task and remove it from the running
queue or deactivate it.
Thank you for your patience :)
On 4 Jun 2015 14:51, "Nicholas Krause" <xerofoify@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@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@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@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.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20150604/187de8c1/attachment.html 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* idle task check
       [not found]                     ` <F1DE3F1C-AEDB-4E7D-88F5-B0C70D838960@gmail.com>
@ 2015-06-04 12:22                       ` Mustafa Hussain
       [not found]                         ` <3C92414E-036C-4031-B9CB-9A12FF47CF0B@gmail.com>
  0 siblings, 1 reply; 12+ messages in thread
From: Mustafa Hussain @ 2015-06-04 12:22 UTC (permalink / raw)
  To: kernelnewbies

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@gmail.com> wrote:

>
>
> 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@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@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@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@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.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20150604/f922a258/attachment-0001.html 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* idle task check
       [not found]                         ` <3C92414E-036C-4031-B9CB-9A12FF47CF0B@gmail.com>
@ 2015-06-04 12:34                           ` Mustafa Hussain
       [not found]                             ` <55704744.5000205@gmail.com>
  0 siblings, 1 reply; 12+ messages in thread
From: Mustafa Hussain @ 2015-06-04 12:34 UTC (permalink / raw)
  To: kernelnewbies

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@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@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@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@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@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@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 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* idle task check
       [not found]                             ` <55704744.5000205@gmail.com>
@ 2015-06-04 12:52                               ` Mustafa Hussain
       [not found]                                 ` <55704BDA.1060106@gmail.com>
  0 siblings, 1 reply; 12+ messages in thread
From: Mustafa Hussain @ 2015-06-04 12:52 UTC (permalink / raw)
  To: kernelnewbies

Ok, everything is clear except one thing what we will do exactly with (pid)
s?
On 4 Jun 2015 15:40, "nick" <xerofoify@gmail.com> wrote:

>
>
> On 2015-06-04 08:34 AM, Mustafa Hussain wrote:
> > 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
> >
> >
> Here is the issue through in order to find out what tasks the user is
> running we
> need to known the exact pid(s) each time. This is next to impossible to do
> without
> writing a syscall and that?s a little beyond you if your asking about the
> scheduler.
> However, there may be a debugging feature in perf or other tool that does
> this, you
> can google to see if something wrote a tool or kernel module for this.
> Nick
> > 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@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@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@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@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@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/5fc83d62/attachment-0001.html 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* idle task check
       [not found]                                 ` <55704BDA.1060106@gmail.com>
@ 2015-06-04 13:16                                   ` Mustafa Hussain
       [not found]                                     ` <55705022.6000204@gmail.com>
  2015-06-04 21:53                                     ` Valdis.Kletnieks at vt.edu
  0 siblings, 2 replies; 12+ messages in thread
From: Mustafa Hussain @ 2015-06-04 13:16 UTC (permalink / raw)
  To: kernelnewbies

I mean how can we use the pid in the scenario of finding the process that
is not used.
On 4 Jun 2015 16:00, "nick" <xerofoify@gmail.com> wrote:

>
>
> On 2015-06-04 08:52 AM, Mustafa Hussain wrote:
> > Ok, everything is clear except one thing what we will do exactly with
> (pid)
> > s?
> > On 4 Jun 2015 15:40, "nick" <xerofoify@gmail.com> wrote:
> >
> Its used in task struct to create a doubly linked list with init/systemd
> being the head or first process and the others linked in other of their
> hierarchy.
> Nick
> >>
> >>
> >> On 2015-06-04 08:34 AM, Mustafa Hussain wrote:
> >>> 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
> >>>
> >>>
> >> Here is the issue through in order to find out what tasks the user is
> >> running we
> >> need to known the exact pid(s) each time. This is next to impossible to
> do
> >> without
> >> writing a syscall and that?s a little beyond you if your asking about
> the
> >> scheduler.
> >> However, there may be a debugging feature in perf or other tool that
> does
> >> this, you
> >> can google to see if something wrote a tool or kernel module for this.
> >> Nick
> >>> 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@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@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@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@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@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/4e907de5/attachment.html 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* idle task check
       [not found]                                     ` <55705022.6000204@gmail.com>
@ 2015-06-04 13:35                                       ` Mustafa Hussain
  0 siblings, 0 replies; 12+ messages in thread
From: Mustafa Hussain @ 2015-06-04 13:35 UTC (permalink / raw)
  To: kernelnewbies

Ok everything is clear now thanks for your time, i will search a while and
try to code that syscall :)
Thanks again.
On 4 Jun 2015 16:18, "nick" <xerofoify@gmail.com> wrote:

>
>
> On 2015-06-04 09:16 AM, Mustafa Hussain wrote:
> > I mean how can we use the pid in the scenario of finding the process that
> > is not used.
> Just check if the process is in the TASK_RUNNING state if it is then
> it's in a runnable state, waiting to run on the queue. Otherwise
> it's idling waiting for something or has completed its work.
> Nick
> > On 4 Jun 2015 16:00, "nick" <xerofoify@gmail.com> wrote:
> >
> >>
> >>
> >> On 2015-06-04 08:52 AM, Mustafa Hussain wrote:
> >>> Ok, everything is clear except one thing what we will do exactly with
> >> (pid)
> >>> s?
> >>> On 4 Jun 2015 15:40, "nick" <xerofoify@gmail.com> wrote:
> >>>
> >> Its used in task struct to create a doubly linked list with init/systemd
> >> being the head or first process and the others linked in other of their
> >> hierarchy.
> >> Nick
> >>>>
> >>>>
> >>>> On 2015-06-04 08:34 AM, Mustafa Hussain wrote:
> >>>>> 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
> >>>>>
> >>>>>
> >>>> Here is the issue through in order to find out what tasks the user is
> >>>> running we
> >>>> need to known the exact pid(s) each time. This is next to impossible
> to
> >> do
> >>>> without
> >>>> writing a syscall and that?s a little beyond you if your asking about
> >> the
> >>>> scheduler.
> >>>> However, there may be a debugging feature in perf or other tool that
> >> does
> >>>> this, you
> >>>> can google to see if something wrote a tool or kernel module for this.
> >>>> Nick
> >>>>> 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@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@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@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@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@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/392d5d59/attachment-0001.html 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* idle task check
  2015-06-04 13:16                                   ` Mustafa Hussain
       [not found]                                     ` <55705022.6000204@gmail.com>
@ 2015-06-04 21:53                                     ` Valdis.Kletnieks at vt.edu
  1 sibling, 0 replies; 12+ messages in thread
From: Valdis.Kletnieks at vt.edu @ 2015-06-04 21:53 UTC (permalink / raw)
  To: kernelnewbies

On Thu, 04 Jun 2015 15:16:24 +0200, Mustafa Hussain said:

> I mean how can we use the pid in the scenario of finding the process that
> is not used.

What, *exactly*, do you mean by "not used"?  And what do you plan to do with
a process that's running but "not used"? (Hint - think about *why* it's running
if it's not in use...)

The fact that a user has not direct interacted with a process doesn't mean they
are not in fact using it.  Banshee and pulseaudio can be streaming music even
though I haven't touched the banshee gui in hours, and I can't interact
directly with pulsaudio at all because it presents no user interface.
Similarly, your X server is probably "in use", and a lot of other background
processes doing things for the user.

And if your code does something to my pidgin process because it's doing
background housekeeping even though I'm not "using" it, I'm going to be quite
upset if it results in me not getting an IM from my boss that a meeting has
been rescheduled...

Now, things like Chrome can deactivate tabs, but only because it has additional
information only available in userspace:  That the process is associated with a
tab, that a tab has certain semantics when not visible, and that the tab is or
isn't visible to the user.  And you *still* have to provide a user control
because some tabs can't be suspended because they have Javascript attached that
have to do housekeeping functions like sending keepalive packets to a webserver
to maintain a connection even if you're not looking at the tab.

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-06-04 21:53 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-09 16:44 idle task check Mustafa Hussain
     [not found] ` <554E6009.9050604@gmail.com>
2015-06-02 21:38   ` Mustafa Hussain
     [not found]     ` <556E22C4.1020009@gmail.com>
2015-06-02 21:44       ` Mustafa Hussain
2015-06-02 22:25     ` Valdis.Kletnieks at vt.edu
     [not found]       ` <556E2E58.5010102@gmail.com>
     [not found]         ` <CALeNi0XrHQkSbMBH8KafhEjQL2X55VxaSD3VddhiYf2sXhjjEA@mail.gmail.com>
     [not found]           ` <CALeNi0VfjUshRfBb40RYjoFYsXV652V+Rh=Tq048Kmv43qzOQA@mail.gmail.com>
     [not found]             ` <776D0311-A28D-48BD-B324-DF7BF1E5C290@gmail.com>
2015-06-04  7:35               ` Mustafa Hussain
     [not found]                 ` <FBA8EF8B-4F44-4E9C-982F-A7CB9BC5754E@gmail.com>
2015-06-04 11:56                   ` Mustafa Hussain
     [not found]                     ` <F1DE3F1C-AEDB-4E7D-88F5-B0C70D838960@gmail.com>
2015-06-04 12:22                       ` Mustafa Hussain
     [not found]                         ` <3C92414E-036C-4031-B9CB-9A12FF47CF0B@gmail.com>
2015-06-04 12:34                           ` Mustafa Hussain
     [not found]                             ` <55704744.5000205@gmail.com>
2015-06-04 12:52                               ` Mustafa Hussain
     [not found]                                 ` <55704BDA.1060106@gmail.com>
2015-06-04 13:16                                   ` Mustafa Hussain
     [not found]                                     ` <55705022.6000204@gmail.com>
2015-06-04 13:35                                       ` Mustafa Hussain
2015-06-04 21:53                                     ` Valdis.Kletnieks at vt.edu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.