Messages in this thread | | | Date | Fri, 3 Apr 2020 13:45:00 -0400 | From | Daniel Jordan <> | Subject | Re: [PATCH v2] workqueue: Remove the warning in wq_worker_sleeping() |
| |
Hi Sebastian,
On Sat, Mar 28, 2020 at 12:29:59AM +0100, Sebastian Andrzej Siewior wrote: > v1…v2: - Drop the warning instead of using cmpxchg_local(). > Tglx pointed out that wq_worker_sleeping() is already invoked > with disabled preemption so the race described can not happen.
I guess you mean this race:
> However, if the interrupt occurs in wq_worker_sleeping() between reading and > setting `sleeping' i.e. > > | if (WARN_ON_ONCE(worker->sleeping)) > | return; > *interrupt* > | worker->sleeping = 1; > > then pool->nr_running will be decremented twice in wq_worker_sleeping() > but it will be incremented only once in wq_worker_running().
Why would preemption prevent it? Interrupts are still enabled.
What am I missing? :-)
| |