(the email address of Matthew Wilcox looks wrong, changed to matthew@wil.cx)
On 06/29, Oleg Nesterov wrote:
Ugh, tasklet_disable() should be changed as well.
Suppose we have the tasklets T1 and T2, both are scheduled on the
same CPU. T1 takes some spinlock LOCK.
Currently it is possible to do
spin_lock(LOCK);
disable_tasklet(T2);
With this patch, the above code hangs.
The most simple fix is to use wait_on_work(t->work) instead of
flush_workqueue(). Currently it is static, but we can export it.
This change will speedup tasklet_disable), btw.
A better fix imho is to use cancel_work_sync() again, but this
needs some complications to preserve TASKLET_STATE_PENDING.
This in turn means that cancel_work_sync() should return "int", but
not "void". This change makes sense regardless, I'll try to make a
patch on Sunday.
Oleg.
-