2004-03-01 10:04:31

by Armin Schindler

[permalink] [raw]
Subject: workqueue function must be reentrant ?

Hi,

with the new workqueue the kernel 2.6 provides, I thought I can remove
my drivers kernel-thread. But looking at the workqueue code, it seems
my workqueue-function must be reentrant on SMP.

Not like the tasklet (where it is guaranteed that another
tasklet_schedule() will put the tasklet-function onto a queue which will not
be executed while another instance of my tasklet-function is still running)
the workqueue function may be put onto the queue of another cpu and get
called while the first one is still running on the first cpu.

Is that correct?
If yes, is it a bug or a feature?

Should I go back to my own kernel-thread to have a user-context-function
SMP-safe?

Thanks for any hint
Armin