linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/8] srcu: srcu_read_lock() can be called from offline cpu
Date: Tue, 4 Dec 2012 11:15:09 -0800	[thread overview]
Message-ID: <20121204191509.GA1680@linux.vnet.ibm.com> (raw)
In-Reply-To: <1354178770-6028-5-git-send-email-laijs@cn.fujitsu.com>

On Thu, Nov 29, 2012 at 04:46:05PM +0800, Lai Jiangshan wrote:
> SRCU is based on its own statemachine and it doesn't
> relies on normal RCU now, its read critical section can be used in
> offline cpu, so we remove the check and the comments.
> 
> It partially reverts c0d6d01b(the part for SRCU).
> 
> It also makes the codes match the comments in whatisRCU.txt:
> 
> g.	Do you need read-side critical sections that are respected
> 	even though they are in the middle of the idle loop, during
> 	user-mode execution, or on an offlined CPU?  If so, SRCU is the
> 	only choice that will work for you.

One thing just occurred to me...  Won't lockdep refuse to operated on
offline CPUs?  If so, one way to handle this would be to flag srcu_struct
structures that were to be used on idle and offline CPUs, and avoid
using lockdep on them.  This would allow most uses of SRCU to continue
using lockdep, while avoiding lockdep false positives in other cases.

Or am I confused?

							Thanx, Paul

> Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
> ---
>  include/linux/srcu.h |    5 -----
>  1 files changed, 0 insertions(+), 5 deletions(-)
> 
> diff --git a/include/linux/srcu.h b/include/linux/srcu.h
> index 6eb691b..ae3ee39 100644
> --- a/include/linux/srcu.h
> +++ b/include/linux/srcu.h
> @@ -163,9 +163,6 @@ void srcu_barrier(struct srcu_struct *sp);
>   * power mode. This way we can notice an extended quiescent state to
>   * other CPUs that started a grace period. Otherwise we would delay any
>   * grace period as long as we run in the idle task.
> - *
> - * Similarly, we avoid claiming an SRCU read lock held if the current
> - * CPU is offline.
>   */
>  static inline int srcu_read_lock_held(struct srcu_struct *sp)
>  {
> @@ -173,8 +170,6 @@ static inline int srcu_read_lock_held(struct srcu_struct *sp)
>  		return 1;
>  	if (rcu_is_cpu_idle())
>  		return 0;
> -	if (!rcu_lockdep_current_cpu_online())
> -		return 0;
>  	return lock_is_held(&sp->dep_map);
>  }
> 
> -- 
> 1.7.4.4
> 


  reply	other threads:[~2012-12-05 15:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-29  8:46 [PATCH 0/8] srcu: cleanup for 3.8 Lai Jiangshan
2012-11-29  8:46 ` [PATCH 1/8] srcu: simplify __srcu_read_unlock() via this_cpu_dec() Lai Jiangshan
2012-11-29  8:46 ` [PATCH 2/8] srcu: add might_sleep() annotation to synchronize_srcu() Lai Jiangshan
2012-11-29  8:46 ` [PATCH 3/8] srcu: simple cleanup for cleanup_srcu_struct() Lai Jiangshan
2012-11-29  8:46 ` [PATCH 4/8] srcu: srcu_read_lock() can be called from offline cpu Lai Jiangshan
2012-12-04 19:15   ` Paul E. McKenney [this message]
2012-11-29  8:46 ` [PATCH 5/8] srcu: srcu_read_lock() can be called from idle loop Lai Jiangshan
2012-11-29  8:46 ` [PATCH 6/8] srcu: update the comments of synchronize_srcu() Lai Jiangshan
2012-11-29  8:46 ` [PATCH 7/8] srcu: update the comments of synchronize_srcu_expedited() Lai Jiangshan
2012-11-29  8:46 ` [PATCH 8/8] srcu: use ACCESS_ONCE() to access sp->completed in srcu_read_lock() Lai Jiangshan
2012-11-29 22:05   ` Paul E. McKenney
2012-11-30  8:14     ` 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=20121204191509.GA1680@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.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;
as well as URLs for NNTP newsgroup(s).