From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Tejun Heo <tj@kernel.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] workqueue: skip nr_running sanity check in worker_enter_idle() if trustee is active
Date: Wed, 16 May 2012 17:15:11 -0700 [thread overview]
Message-ID: <20120517001511.GA14301@linux.vnet.ibm.com> (raw)
In-Reply-To: <20120514224123.GO2441@linux.vnet.ibm.com>
On Mon, May 14, 2012 at 03:41:23PM -0700, Paul E. McKenney wrote:
> On Mon, May 14, 2012 at 03:12:50PM -0700, Tejun Heo wrote:
> > >From 544ecf310f0e7f51fa057ac2a295fc1b3b35a9d3 Mon Sep 17 00:00:00 2001
> > From: Tejun Heo <tj@kernel.org>
> > Date: Mon, 14 May 2012 15:04:50 -0700
> >
> > worker_enter_idle() has WARN_ON_ONCE() which triggers if nr_running
> > isn't zero when every worker is idle. This can trigger spuriously
> > while a cpu is going down due to the way trustee sets %WORKER_ROGUE
> > and zaps nr_running.
> >
> > It first sets %WORKER_ROGUE on all workers without updating
> > nr_running, releases gcwq->lock, schedules, regrabs gcwq->lock and
> > then zaps nr_running. If the last running worker enters idle
> > inbetween, it would see stale nr_running which hasn't been zapped yet
> > and trigger the WARN_ON_ONCE().
> >
> > Fix it by performing the sanity check iff the trustee is idle.
> >
> > Signed-off-by: Tejun Heo <tj@kernel.org>
> > Reported-by: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> > Cc: stable@vger.kernel.org
> > ---
> > Sorry about the delay. After scratching my head quite a bit, I found
> > where during cpu-offlining such discrepancy may happen. I'm fairly
> > sure this is it but I might be wrong, so please include this patch in
> > your test setup and let me know how it goes.
>
> Thank you -- I have applied it, and will let you know how it goes.
Tested-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Thanx, Paul
prev parent reply other threads:[~2012-05-17 0:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-06 15:38 Warning in worker_enter_idle() Paul E. McKenney
2012-05-07 19:40 ` Tejun Heo
2012-05-07 20:55 ` Paul E. McKenney
2012-05-07 21:34 ` Tejun Heo
2012-05-14 22:12 ` [PATCH] workqueue: skip nr_running sanity check in worker_enter_idle() if trustee is active Tejun Heo
2012-05-14 22:41 ` Paul E. McKenney
2012-05-17 0:15 ` Paul E. McKenney [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120517001511.GA14301@linux.vnet.ibm.com \
--to=paulmck@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox