public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Yunhong Jiang <yunhong.jiang@linux.intel.com>
Cc: linux-kernel@vger.kernel.org, jiangshanlai@gmail.com
Subject: Re: Can srcu_read_lock() be called from interrupt context?
Date: Tue, 3 Nov 2015 01:55:39 -0800	[thread overview]
Message-ID: <20151103095539.GD29027@linux.vnet.ibm.com> (raw)
In-Reply-To: <20151103015656.GA10358@jnakajim-build>

On Mon, Nov 02, 2015 at 05:56:56PM -0800, Yunhong Jiang wrote:
> Hi, Paul
> 	I have a question to the srcu_read_lock(). Can it be invoked on 
> interrupt context? According to 
> http://lxr.free-electrons.com/source/kernel/rcu/srcu.c#L292 it can only be 
> called from process context, but according to 
> http://lxr.free-electrons.com/source/include/linux/srcu.h#L213 seems it's ok 
> from irq context only if it matches with the srcu_read_unlock. Can you 
> please give some hints?

Adding Lai Jianshan for his thoughts.

I believe that srcu.h is correct, at least assuming that interrupts do
not nest too deeply.  (If they were to nest four billion deep, then the
->seq[] counter could overflow, defeating the checks, but the CPU stack
would have overflowed long before.)

Lai, am I missing anything here?

							Thanx, Paul


  reply	other threads:[~2015-11-03  9:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-03  1:56 Can srcu_read_lock() be called from interrupt context? Yunhong Jiang
2015-11-03  9:55 ` Paul E. McKenney [this message]
2015-11-03 14:47   ` Peter Zijlstra
2015-11-03 15:15     ` Paul E. McKenney

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=20151103095539.GD29027@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=jiangshanlai@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yunhong.jiang@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox