2002-04-12 17:07:11

by Vahid Fereydunkolahi

[permalink] [raw]
Subject: kernel threads.

Folks,
I have a problem using kernel_thread. The problem is
when I use kernel threads I see a lot of context
switch.
I monitor the system activity using vmstat.

Regards,
--vahid


__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/


2002-04-12 17:45:02

by Masoud Sharbiani

[permalink] [raw]
Subject: Re: kernel threads.

Hi,
Context switch happens when one of your running processes (or kernel
threads) is running and then makes a request (like reading from a device
and it has to wait for result). therefore scheduler selects another
runnable process/kthread to run.
If you think you have a lot of context switches, you might want to
redesign your thread so it blocks less (for example, make several
requests for reading several blocks, all at the same time, and wait for
first to complete where there is higher probability for the rest of
blocks to be ready when you check for their readiness).
regards,
Masoud
Vahid Fereydunkolahi wrote:

>Folks,
> I have a problem using kernel_thread. The problem is
> when I use kernel threads I see a lot of context
>switch.
> I monitor the system activity using vmstat.
>
>Regards,
>--vahid
>
>
>__________________________________________________
>Do You Yahoo!?
>Yahoo! Tax Center - online filing with TurboTax
>http://taxes.yahoo.com/
>-
>To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>the body of a message to [email protected]
>More majordomo info at http://vger.kernel.org/majordomo-info.html
>Please read the FAQ at http://www.tux.org/lkml/
>