[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200403174500.75rwuijdri5ewl5c@ca-dmjordan1.us.oracle.com>
Date: Fri, 3 Apr 2020 13:45:00 -0400
From: Daniel Jordan <daniel.m.jordan@...cle.com>
To: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Cc: kernel test robot <lkp@...el.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...nel.org>,
"Peter Zijlstra (Intel)" <peterz@...radead.org>,
linux-kernel@...r.kernel.org, LKP <lkp@...ts.01.org>,
Tejun Heo <tj@...nel.org>,
Lai Jiangshan <jiangshanlai@...il.com>
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? :-)
Powered by blists - more mailing lists