Skip to contentSkip to conversation

kernel processes - are they really needed?

DISCUSSION Ram 7 participants 8 messages Oct 24, 2007 – Nov 2, 2007

lore
Share & tools
lore

Ram

author
#0 lore raw

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

#1 lore raw
Quoted 21 lines · Ram

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]
Quoted 3 lines

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 [email protected] - and destroy all copies of this information, including any attachments, without reading or disclosing them.

Thank you.

#2 lore raw
In reply to Ram
Quoted 7 lines · Ram

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

#3 lore raw
Quoted 3 lines · Andi Kleen

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

Signature · 1 line
Dmitry
#4 lore raw
Quoted 8 lines · Dmitry Torokhov
Quoted 3 lines · Andi Kleen

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?

Quoted 2 lines

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

#5 lore raw
Quoted 4 lines · Andi Kleen
Quoted 2 lines · Dmitry Torokhov
Quoted 1 line · Andi Kleen
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

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.

Quoted 9 lines
Quoted 4 lines

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.

Signature · 1 line
Dmitry
#6 lore raw
In reply to Ram

Hi,

Quoted 5 lines

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 :)

Quoted 8 lines

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.

Quoted 2 lines
   38 root            SW  [pdflush]
   39 root            SW  [pdflush]

Doing writeback of dirty data.

Quoted 1 line

40 root SW< [kswapd0]

Swapping pages in and out.

Quoted 1 line

41 root SW< [aio/0]

Kernel thread handling asynchronous IO.

Quoted 2 lines

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

Signature · 2 lines
Jan Kara <[email protected]>
SuSE CR Labs
#7 lore raw

El Wed, Oct 31, 2007 at 05:01:42PM +0100 Jan Kara ha dit:

Quoted 6 lines
Quoted 5 lines

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 :)

Quoted 3 lines
Quoted 3 lines

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

Quoted 2 lines
Quoted 2 lines

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

Quoted 20 lines
Quoted 3 lines
    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.

Quoted 2 lines
   38 root            SW  [pdflush]
   39 root            SW  [pdflush]

Doing writeback of dirty data.

Quoted 1 line

40 root SW< [kswapd0]

Swapping pages in and out.

Quoted 1 line

41 root SW< [aio/0]

Kernel thread handling asynchronous IO.

Quoted 2 lines

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).

Signature · 11 lines
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                  `-