Sleeping in workqueues
Tobias FItschen
tobias.fitschen at campus.tu-berlin.de
Sun Feb 12 08:45:06 EST 2017
Hello people,
I have a question regarding workqueues. I know it's possible to sleep in
workqueue routines. Does that mean I can use:
1. "set_current_state(TASK_INTERRUPTIBLE);" get the the task with
"current" and pass it to a other task and then call "schedule();" in a
workqueue routine and at a different place (perhaps another workqueue
routine) use wake_up_process(task)" ?
2. initialize completions in a workqueue routine and call complete() in
a different workqueue routine?
I tried it in a simple example setup and both worked. I just want to
make sure that was not just by accident. As I understand it a work item
is executed on a worker, which is a unique process, but I also know that
there are exceptions, e.g. I can not copy to or from user space in a
workqueue routine. Also I don't know if a worker "sticks" with the
current work item until it is completed or can execute multiple work
items at the "same" time.
3. In case completions and schedule()/wakeup() work, I would also like
to know, which has the better performance.
Thanks a lot already!
Tobias
More information about the Kernelnewbies
mailing list