From: Tejun Heo <tj@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Lai Jiangshan <laijs@cn.fujitsu.com>,
linux-kernel@vger.kernel.org,
Thomas Gleixner <tglx@linutronix.de>,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Subject: Re: [PATCH 1/5] workqueue: wq_pool_mutex protects the attrs-installation
Date: Fri, 11 Mar 2016 12:50:13 -0500 [thread overview]
Message-ID: <20160311175013.GJ24046@htj.duckdns.org> (raw)
In-Reply-To: <20160310214411.GA1526@home.goodmis.org>
Hello, Steven.
On Thu, Mar 10, 2016 at 04:44:11PM -0500, Steven Rostedt wrote:
> > diff --git a/kernel/workqueue.c b/kernel/workqueue.c
> > index a3915ab..fa8b949 100644
> > --- a/kernel/workqueue.c
> > +++ b/kernel/workqueue.c
> > @@ -127,6 +127,12 @@ enum {
> > *
> > * PR: wq_pool_mutex protected for writes. Sched-RCU protected for reads.
> > *
> > + * PW: wq_pool_mutex and wq->mutex protected for writes. Any one of them
> > + * protected for reads.
> > + *
> > + * PWR: wq_pool_mutex and wq->mutex protected for writes. Any one of them
> > + * or sched-RCU for reads.
>
> How exactly is sched-RCU protecting this here? The cause for the 4.1-rt issue
> is that we converted the local_irq_save() in queue_work_on() into a
> "local_lock_irqsave()" which when PREEMPT_RT is enabled will be a mutex that
> disables migration (can not migrate). This also prevents the current CPU from
> going offline.
>
> Does this code really need to be protected from being preempted, or is
> disabling migration good enough?
That's used for workqueue->numa_pwq_tbl[] and it's derefed while
determining the pwq to use for the node. The queueing path already
has local irq disabled and pwqs are sched rcu protected. If the task
gets preempted inbetween, sched rcu grace period might trigger and
queueing path might try to deref an already free pwq, so yeah, I think
it does need preemption protection there.
Thanks.
--
tejun
next prev parent reply other threads:[~2016-03-11 17:50 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-11 9:35 [PATCH 0/5] workqueue: cleanup for apply_workqueue_attrs() Lai Jiangshan
2015-05-11 9:35 ` [PATCH 1/5] workqueue: wq_pool_mutex protects the attrs-installation Lai Jiangshan
2015-05-11 12:23 ` Tejun Heo
2016-03-10 21:44 ` Steven Rostedt
2016-03-11 17:50 ` Tejun Heo [this message]
2016-07-11 20:50 ` Steven Rostedt
2016-07-12 15:09 ` Tejun Heo
2016-07-12 15:20 ` Tejun Heo
2016-07-12 15:23 ` Steven Rostedt
2015-05-11 9:35 ` [PATCH 2/5] workqueue: merge the similar code Lai Jiangshan
2015-05-11 14:31 ` Tejun Heo
2015-05-12 2:03 ` Lai Jiangshan
2015-05-12 13:16 ` Tejun Heo
2015-05-11 9:35 ` [PATCH 3/5] workqueue: ensure attrs-changing be sequentially Lai Jiangshan
2015-05-11 14:55 ` Tejun Heo
2015-05-12 5:09 ` Lai Jiangshan
2015-05-12 13:19 ` Tejun Heo
2015-05-11 9:35 ` [PATCH 4/5] workqueue: don't expose workqueue_attrs to users Lai Jiangshan
2015-05-11 14:59 ` Tejun Heo
2015-05-12 2:15 ` Lai Jiangshan
2015-05-12 13:22 ` Tejun Heo
2015-05-13 1:43 ` Lai Jiangshan
2015-05-13 13:52 ` Tejun Heo
2015-05-11 9:35 ` [PATCH 5/5] workqueue: remove no_numa from workqueue_attrs Lai Jiangshan
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=20160311175013.GJ24046@htj.duckdns.org \
--to=tj@kernel.org \
--cc=bigeasy@linutronix.de \
--cc=laijs@cn.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
/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
all inboxes | Powered by JetHome®