Query regarding work queue

Michael Blizek michi1 at michaelblizek.twilightparadox.com
Sat Feb 19 02:07:26 EST 2011


Hi!

On 01:27 Sat 19 Feb     , Leelakrishna A wrote:
>  Hi,
> In LDD 3rd edition it is given that,
> In a multiprocessor system work queues will run on the same processor from
> which they are submitted.
> Also each work queue has one or more dedicated kernel threads which runs the
> functions submitted to the queue.
> If we use *create_workqueue*, we get a work queue that has a dedicated
> thread for each processor on the system.
> 
> If a work queue is restricted to run on one processor then why the need for
> the creation of more than one thread each for one processor.

Basically there were 2 types of workqueues:
- single thread executes all
- thread for each processor

Notice the *were*. The creation of workqueues is a bit historic. You cannot
create workqueues anymore. The creation process is a noop now and everything
is executed by a single system work queue. It is supposed to start multiple
threads per CPU on congestion. I have no idea on how to prevent starvation, if
you have lots of low priority tasks. At least nothing short of creating
threads and reimplementing part of the old workqueues on your own (*very*
ugly). If anybody has a bigger idea, please tell me.

	-Michi
-- 
programing a layer 3+4 network protocol for mesh networks
see http://michaelblizek.twilightparadox.com




More information about the Kernelnewbies mailing list