From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: David Miller <davem@davemloft.net>
Cc: xiaosuo@gmail.com, therbert@google.com, netdev@vger.kernel.org
Subject: Re: [PATCH] net: disable preemption before call smp_processor_id()
Date: Sat, 7 Aug 2010 21:57:51 -0700 [thread overview]
Message-ID: <20100808045751.GF19600@linux.vnet.ibm.com> (raw)
In-Reply-To: <20100807.203700.186284252.davem@davemloft.net>
On Sat, Aug 07, 2010 at 08:37:00PM -0700, David Miller wrote:
> From: Changli Gao <xiaosuo@gmail.com>
> Date: Sat, 7 Aug 2010 17:26:02 +0800
>
> > Although netif_rx() isn't expected to be called in process context with
> > preemption enabled, it'd better handle this case. And this is why get_cpu()
> > is used in the non-RPS #ifdef branch. If tree RCU is selected,
> > rcu_read_lock() won't disable preemption, so preempt_disable() should be
> > called explictly.
> >
> > Signed-off-by: Changli Gao <xiaosuo@gmail.com>
>
> Applied, thanks Changli.
>
> Paul, perhaps the comment above rcu_read_lock()'s definition should
> be updated in rcupdate.h? It says blocking is not allowed inside
> of a read side critical section, but obviously with tree-rcu that
> is not the case.
>
> Either we should add a mention of tree-rcu's semantics or just remote
> this part of the comment altogether.
Good point, that last sentence is quite obsolete. It also survived a
recent cleanup. :-/
If I cover preemptible RCU's semantics, a first cut comes out like this:
* In non-preemptible RCU implementations (TREE_RCU and TINY_RCU), it
* is illegal to block while in an RCU read-side critical section. In
* preemptible RCU implementations (TREE_PREEMPT_RCU and TINY_PREEMPT_RCU)
* in CONFIG_PREEMPT kernel builds, RCU read-side critical sections may
* be preempted, but explicit blocking is illegal. Finally, in preemptible
* RCU implementations in real-time (CONFIG_PREEMPT_RT) kernel builds,
* RCU read-side critical sections may be preempted and they may also
* block, but only when acquiring spinlocks that are subject to priority
* inheritance.
Does that seem reasonable?
Thanx, Paul
next prev parent reply other threads:[~2010-08-08 4:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-07 9:26 [PATCH] net: disable preemption before call smp_processor_id() Changli Gao
2010-08-08 3:37 ` David Miller
2010-08-08 4:57 ` Paul E. McKenney [this message]
2010-08-08 5:25 ` David Miller
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=20100808045751.GF19600@linux.vnet.ibm.com \
--to=paulmck@linux.vnet.ibm.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=therbert@google.com \
--cc=xiaosuo@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.