public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* kernel processes - are they really needed?
@ 2007-10-24 13:37 Ram
  2007-10-24 15:30 ` linux-os (Dick Johnson)
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Ram @ 2007-10-24 13:37 UTC (permalink / raw)
  To: linux-kernel

Hi,
    When i do ps -l. i see the following processes which are obviously
started by kernel.

   Could any one tell me what each of these processes do and can
anyone of them can be removed.?

PID  Uid     VmSize Stat Command
    1 root        584 S   init
    2 root            SWN [ksoftirqd/0]
    3 root            SW  [watchdog/0]
    4 root            SW< [events/0]
    5 root            SW< [khelper]
    6 root            SW< [kthread]
   23 root            SW< [kblockd/0]
   38 root            SW  [pdflush]
   39 root            SW  [pdflush]
   40 root            SW< [kswapd0]
   41 root            SW< [aio/0]
   85 root            SW  [mtdblockd]
  116 root            SWN [jffs2_gcd_mtd9]
Regards,
ram

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

* Re: kernel processes - are they really needed?
  2007-10-24 13:37 kernel processes - are they really needed? Ram
@ 2007-10-24 15:30 ` linux-os (Dick Johnson)
  2007-10-24 19:43 ` Andi Kleen
  2007-10-31 16:01 ` Jan Kara
  2 siblings, 0 replies; 8+ messages in thread
From: linux-os (Dick Johnson) @ 2007-10-24 15:30 UTC (permalink / raw)
  To: Ram; +Cc: linux-kernel


On Wed, 24 Oct 2007, Ram wrote:

> Hi,
>    When i do ps -l. i see the following processes which are obviously
> started by kernel.
>
>   Could any one tell me what each of these processes do and can
> anyone of them can be removed.?
>
> PID  Uid     VmSize Stat Command
>    1 root        584 S   init
>    2 root            SWN [ksoftirqd/0]
>    3 root            SW  [watchdog/0]
>    4 root            SW< [events/0]
>    5 root            SW< [khelper]
>    6 root            SW< [kthread]
>   23 root            SW< [kblockd/0]
>   38 root            SW  [pdflush]
>   39 root            SW  [pdflush]
>   40 root            SW< [kswapd0]
>   41 root            SW< [aio/0]
>   85 root            SW  [mtdblockd]
>  116 root            SWN [jffs2_gcd_mtd9]
> Regards,
> ram
> -

Init is the 'mother' of all processes. It sleeps using
no resources until some other process terminates. At
that time,...............learn about Unix somewhere else.

Other tasks are essential as well.


Cheers,
Dick Johnson
Penguin : Linux version 2.6.16.24 on an i686 machine (5592.59 BogoMips).
My book : http://www.AbominableFirebug.com/
_


****************************************************************
The information transmitted in this message is confidential and may be privileged.  Any review, retransmission, dissemination, or other use of this information by persons or entities other than the intended recipient is prohibited.  If you are not the intended recipient, please notify Analogic Corporation immediately - by replying to this message or by sending an email to DeliveryErrors@analogic.com - and destroy all copies of this information, including any attachments, without reading or disclosing them.

Thank you.

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

* Re: kernel processes - are they really needed?
  2007-10-24 13:37 kernel processes - are they really needed? Ram
  2007-10-24 15:30 ` linux-os (Dick Johnson)
@ 2007-10-24 19:43 ` Andi Kleen
  2007-10-31 16:35   ` Dmitry Torokhov
  2007-10-31 16:01 ` Jan Kara
  2 siblings, 1 reply; 8+ messages in thread
From: Andi Kleen @ 2007-10-24 19:43 UTC (permalink / raw)
  To: Ram; +Cc: linux-kernel

Ram <vshrirama@gmail.com> writes:

> Hi,
>     When i do ps -l. i see the following processes which are obviously
> started by kernel.
>
>    Could any one tell me what each of these processes do 

> and can anyone of them can be removed.?

Some of them can probably. Or rather many depending on the configuration.

Sometimes there are good reasons for an own thread, but often there are also 
bad reasons.

If the threads don't sleep or have special requirements long they
should generally just use keventd instead.

Unfortunately a lot of people seem to think they're cheap because 
it's relatively easy to create them using work queues now, so we end
up with more and more all the time.

Especially on systems with many cores or threads which end up with a
lot of dubious per CPU threads. Some scaling up is needed, but one per CPU 
seems to be generally too many.

My favourite for a ridiculous thread was and is "kpsmoused" 

-Andi

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

* Re: kernel processes - are they really needed?
  2007-10-24 13:37 kernel processes - are they really needed? Ram
  2007-10-24 15:30 ` linux-os (Dick Johnson)
  2007-10-24 19:43 ` Andi Kleen
@ 2007-10-31 16:01 ` Jan Kara
  2007-10-31 17:10   ` Matthias Kaehlcke
  2 siblings, 1 reply; 8+ messages in thread
From: Jan Kara @ 2007-10-31 16:01 UTC (permalink / raw)
  To: Ram; +Cc: linux-kernel

  Hi,

>     When i do ps -l. i see the following processes which are obviously
> started by kernel.
> 
>    Could any one tell me what each of these processes do and can
> anyone of them can be removed.?
  I'll write what I know :)

> PID  Uid     VmSize Stat Command
>     1 root        584 S   init
>     2 root            SWN [ksoftirqd/0]
>     3 root            SW  [watchdog/0]
>     4 root            SW< [events/0]
>     5 root            SW< [khelper]
>     6 root            SW< [kthread]
>    23 root            SW< [kblockd/0]
  This one has something to do with block layer - like unplugging
request queue after a certain timeout etc.

>    38 root            SW  [pdflush]
>    39 root            SW  [pdflush]
  Doing writeback of dirty data.

>    40 root            SW< [kswapd0]
  Swapping pages in and out.

>    41 root            SW< [aio/0]
  Kernel thread handling asynchronous IO.

>    85 root            SW  [mtdblockd]
>   116 root            SWN [jffs2_gcd_mtd9]
  jffs2 specific - ask a maintainer :) (and mtdblockd has something to
do with MTD devices so he may know that one as well).

								Honza
-- 
Jan Kara <jack@suse.cz>
SuSE CR Labs

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

* Re: kernel processes - are they really needed?
  2007-10-24 19:43 ` Andi Kleen
@ 2007-10-31 16:35   ` Dmitry Torokhov
  2007-10-31 17:33     ` Andi Kleen
  0 siblings, 1 reply; 8+ messages in thread
From: Dmitry Torokhov @ 2007-10-31 16:35 UTC (permalink / raw)
  To: Andi Kleen; +Cc: Ram, linux-kernel

On 10/24/07, Andi Kleen <andi@firstfloor.org> wrote:
>
> My favourite for a ridiculous thread was and is "kpsmoused"
>

Mouse querying can take significant amount of time. Do you really want
all your other events to be delayed just because kernel tries to get
mouse back in order?

Although I probably want to kill it if mouse resync is disabled...

-- 
Dmitry

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

* Re: kernel processes - are they really needed?
  2007-10-31 16:01 ` Jan Kara
@ 2007-10-31 17:10   ` Matthias Kaehlcke
  0 siblings, 0 replies; 8+ messages in thread
From: Matthias Kaehlcke @ 2007-10-31 17:10 UTC (permalink / raw)
  To: Jan Kara; +Cc: Ram, linux-kernel

El Wed, Oct 31, 2007 at 05:01:42PM +0100 Jan Kara ha dit:
 
> >     When i do ps -l. i see the following processes which are obviously
> > started by kernel.
> > 
> >    Could any one tell me what each of these processes do and can
> > anyone of them can be removed.?
>   I'll write what I know :)

i'll also put my 0.5 cents :)

> > PID  Uid     VmSize Stat Command
> >     1 root        584 S   init
> >     2 root            SWN [ksoftirqd/0]

executes (on CPU 0) the deferred parts of interrupt routines (bottom
halves), i.e. softirqs and tasklets. bad candidate for removal imo

> >     3 root            SW  [watchdog/0]
> >     4 root            SW< [events/0]

this one is in charge of executing deferred functions placed in the
default work queue. also a bad candidate for removal

> >     5 root            SW< [khelper]
> >     6 root            SW< [kthread]
> >    23 root            SW< [kblockd/0]
>   This one has something to do with block layer - like unplugging
> request queue after a certain timeout etc.
> 
> >    38 root            SW  [pdflush]
> >    39 root            SW  [pdflush]
>   Doing writeback of dirty data.
> 
> >    40 root            SW< [kswapd0]
>   Swapping pages in and out.
> 
> >    41 root            SW< [aio/0]
>   Kernel thread handling asynchronous IO.
> 
> >    85 root            SW  [mtdblockd]
> >   116 root            SWN [jffs2_gcd_mtd9]
>   jffs2 specific - ask a maintainer :) (and mtdblockd has something to
> do with MTD devices so he may know that one as well).

-- 
Matthias Kaehlcke
Linux Application Developer
Barcelona

                If you don't know where you are going,
               you will probably end up somewhere else
                         (Laurence J. Peter)
                                                                 .''`.
    using free software / Debian GNU/Linux | http://debian.org  : :'  :
                                                                `. `'`
gpg --keyserver pgp.mit.edu --recv-keys 47D8E5D4                  `-

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

* Re: kernel processes - are they really needed?
  2007-10-31 16:35   ` Dmitry Torokhov
@ 2007-10-31 17:33     ` Andi Kleen
  2007-11-02  1:51       ` Dmitry Torokhov
  0 siblings, 1 reply; 8+ messages in thread
From: Andi Kleen @ 2007-10-31 17:33 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: Andi Kleen, Ram, linux-kernel

"Dmitry Torokhov" <dmitry.torokhov@gmail.com> writes:

> On 10/24/07, Andi Kleen <andi@firstfloor.org> wrote:
>>
>> My favourite for a ridiculous thread was and is "kpsmoused"
>>
>
> Mouse querying can take significant amount of time. Do you really want
> all your other events to be delayed just because kernel tries to get
> mouse back in order?

How long? 

>
> Although I probably want to kill it if mouse resync is disabled...

How often does that happen? Can't you just start a thread for this
as needed? Or if it's a simple algorithm you can just use a state machine
using timers?

-Andi

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

* Re: kernel processes - are they really needed?
  2007-10-31 17:33     ` Andi Kleen
@ 2007-11-02  1:51       ` Dmitry Torokhov
  0 siblings, 0 replies; 8+ messages in thread
From: Dmitry Torokhov @ 2007-11-02  1:51 UTC (permalink / raw)
  To: Andi Kleen; +Cc: Ram, linux-kernel

On Wednesday 31 October 2007 13:33, Andi Kleen wrote:
> "Dmitry Torokhov" <dmitry.torokhov@gmail.com> writes:
> 
> > On 10/24/07, Andi Kleen <andi@firstfloor.org> wrote:
> >>
> >> My favourite for a ridiculous thread was and is "kpsmoused"
> >>
> >
> > Mouse querying can take significant amount of time. Do you really want
> > all your other events to be delayed just because kernel tries to get
> > mouse back in order?
> 
> How long?

If a mouse is stubborn and does not want to get enabled it may sleep
up to 1 sec.

> 
> 
> >
> > Although I probably want to kill it if mouse resync is disabled...
> 
> How often does that happen? Can't you just start a thread for this
> as needed? Or if it's a simple algorithm you can just use a state machine
> using timers?
>

The IRQ handler is already too complex, I'd rather not mess with a state
machine. I will see how to kill the thread if resync is disabled.

-- 
Dmitry

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

end of thread, other threads:[~2007-11-02  1:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-24 13:37 kernel processes - are they really needed? Ram
2007-10-24 15:30 ` linux-os (Dick Johnson)
2007-10-24 19:43 ` Andi Kleen
2007-10-31 16:35   ` Dmitry Torokhov
2007-10-31 17:33     ` Andi Kleen
2007-11-02  1:51       ` Dmitry Torokhov
2007-10-31 16:01 ` Jan Kara
2007-10-31 17:10   ` Matthias Kaehlcke

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox