• Oleg Nesterov's avatar
    make queue_delayed_work() friendly to flush_fork() · ed7c0fee
    Oleg Nesterov authored
    Currently typeof(delayed_work->work.data) is
    
    	"struct workqueue_struct" when the timer is pending
    
    	"struct cpu_workqueue_struct" whe the work is queued
    
    This makes impossible to use flush_fork(delayed_work->work) in addition
    to cancel_delayed_work/cancel_rearming_delayed_work, not good.
    
    Change queue_delayed_work/delayed_work_timer_fn to use cwq, not wq. This
    complicates (and uglifies) these functions a little bit, but alows us to
    use flush_fork(dwork) and imho makes the whole code more consistent.
    
    Also, document the fact that cancel_rearming_delayed_work() doesn't garantee
    the completion of work->func() upon return.
    Signed-off-by: default avatarOleg Nesterov <oleg@tv-sign.ru>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    ed7c0fee
workqueue.c 20.7 KB