From: Tejun Heo <tj@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
RT <linux-rt-users@vger.kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Clark Williams <clark@redhat.com>,
"Paul E. McKenney" <paulmck@us.ibm.com>
Subject: Re: question about disabling interrupts for workqueue pool?
Date: Tue, 25 Jun 2013 16:26:57 -0700 [thread overview]
Message-ID: <20130625232657.GC30407@mtj.dyndns.org> (raw)
In-Reply-To: <1372202344.18733.242.camel@gandalf.local.home>
Hello, Steven.
On Tue, Jun 25, 2013 at 07:19:04PM -0400, Steven Rostedt wrote:
> Why is that silly? It actually makes plenty of sense. Now if
> preempt_disable/enable was nested in spin_lock_irq_save/restore() now
> that would be pretty silly.
If you know you're gonna be disabling irq pretty soon, you don't need
to do that, so...
> Just looking at the first part of that function:
>
> local_irq_disable();
> pool = get_work_pool(work);
> if (!pool) {
> local_irq_enable();
> return false;
> }
>
> On the case of poll == NULL, we disabled interrupts for no reason.
It's much more likely that get_work_pool() there returns !NULL. I
didn't think it'd matter enough to put likely(). Sure, it's nice to
not disable interrupts but really, in upstream, I don't think the
above matters in the upstream kernel. The extra coverage is at the
worst idr_find() into single level idr.
> It may take a bit of understanding the code before I send a patch. But
> I'll start looking into it.
Wrapping from local_irq_disable() to spin_unlock_irq() with RCU sched
read lock/unlock should do, I think.
Thanks!
--
tejun
prev parent reply other threads:[~2013-06-25 23:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-25 22:52 question about disabling interrupts for workqueue pool? Steven Rostedt
2013-06-25 23:01 ` Tejun Heo
2013-06-25 23:19 ` Steven Rostedt
2013-06-25 23:26 ` Tejun Heo [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=20130625232657.GC30407@mtj.dyndns.org \
--to=tj@kernel.org \
--cc=bigeasy@linutronix.de \
--cc=clark@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-users@vger.kernel.org \
--cc=paulmck@us.ibm.com \
--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;
as well as URLs for NNTP newsgroup(s).