Linux RCU subsystem development
 help / color / mirror / Atom feed
From: Pingfan Liu <kernelfans@gmail.com>
To: "Zhang, Qiang1" <qiang1.zhang@intel.com>
Cc: "rcu@vger.kernel.org" <rcu@vger.kernel.org>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	"Paul E. McKenney" <paulmck@kernel.org>,
	Frederic Weisbecker <frederic@kernel.org>,
	Josh Triplett <josh@joshtriplett.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Subject: Re: [PATCH 1/3] srcu: Eliminate the requirement of SRCU_SIZE_WAIT_CALL
Date: Mon, 28 Nov 2022 22:01:08 +0800	[thread overview]
Message-ID: <Y4S/JLoILJZMCj9N@piliu.users.ipa.redhat.com> (raw)
In-Reply-To: <PH0PR11MB5880CEEA5D2CD0F7AF21E954DA139@PH0PR11MB5880.namprd11.prod.outlook.com>

On Mon, Nov 28, 2022 at 08:40:22AM +0000, Zhang, Qiang1 wrote:
> >The state SRCU_SIZE_WAIT_CALL is only used in srcu_gp_start_if_needed().
> >And it is not needed. Because counter_wrap_check has guarantee that both
> >srcu_gp_seq_needed and srcu_gp_seq_needed_exp are not far behind
> >srcu_gp_seq and no false alarm will be raised by the statement in
> >srcu_gp_start_if_needed()
> >
> >  ULONG_CMP_LT(sdp->srcu_gp_seq_needed, s)
> >
> >As a result, once if SRCU_SIZE_WAIT_BARRIER is seen, the tree snp can be
> >used immediately, not need to wait for another srcu_gp_end() to update
> >the srcu_gp_seq_needed and srcu_gp_seq_needed_exp to avoid false alarm.
> >
> >Signed-off-by: Pingfan Liu <kernelfans@gmail.com>
> >Cc: Lai Jiangshan <jiangshanlai@gmail.com>
> >Cc: "Paul E. McKenney" <paulmck@kernel.org>
> >Cc: Frederic Weisbecker <frederic@kernel.org>
> >Cc: Josh Triplett <josh@joshtriplett.org>
> >Cc: Steven Rostedt <rostedt@goodmis.org>
> >Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
> >Cc: "Zhang, Qiang1" <qiang1.zhang@intel.com>
> >To: rcu@vger.kernel.org
> >---
> > kernel/rcu/srcutree.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> >diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c
> >index 1c304fec89c0..fe0759d89c2d 100644
> >--- a/kernel/rcu/srcutree.c
> >+++ b/kernel/rcu/srcutree.c
> >@@ -1092,7 +1092,7 @@ static unsigned long srcu_gp_start_if_needed(struct srcu_struct *ssp,
> > 	check_init_srcu_struct(ssp);
> > 	idx = srcu_read_lock(ssp);
> > 	ss_state = smp_load_acquire(&ssp->srcu_size_state);
> >-	if (ss_state < SRCU_SIZE_WAIT_CALL)
> >+	if (ss_state < SRCU_SIZE_WAIT_BARRIER)
> > 		sdp = per_cpu_ptr(ssp->sda, 0);
> 
> Hi Pingfan
> 
> should it be used get_boot_cpu_id() ?
> 

I am not sure which branch to work on.

Thanks,

	Pingfan

> Thanks
> Zqiang
> 
> > 	else
> > 		sdp = raw_cpu_ptr(ssp->sda);
> >-- 
> >2.31.1
> >

  reply	other threads:[~2022-11-28 14:01 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-28  8:28 [PATCH 0/3] srcu: shrink the num of srcu_size_state Pingfan Liu
2022-11-28  8:28 ` [PATCH 1/3] srcu: Eliminate the requirement of SRCU_SIZE_WAIT_CALL Pingfan Liu
2022-11-28  8:40   ` Zhang, Qiang1
2022-11-28 14:01     ` Pingfan Liu [this message]
2022-11-29  0:41       ` Paul E. McKenney
2022-11-30  3:34   ` [PATCHv2] " Pingfan Liu
2022-12-02 22:17     ` Paul E. McKenney
2022-12-13 12:51       ` Pingfan Liu
2022-12-13 20:02         ` Paul E. McKenney
2022-12-15  3:37           ` Pingfan Liu
2022-12-16 16:54             ` Paul E. McKenney
2022-11-28  8:28 ` [PATCH 2/3] srcu: protect against concurrent srcu_gp_end() Pingfan Liu
2022-11-28  9:20   ` Zhang, Qiang1
2022-11-28 14:36     ` Pingfan Liu
2022-11-28 14:47       ` Zhang, Qiang1
2022-11-30  3:36         ` Pingfan Liu
2022-11-28  8:28 ` [PATCH 3/3] srcu: Decrease the srcu size state numbers Pingfan Liu

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=Y4S/JLoILJZMCj9N@piliu.users.ipa.redhat.com \
    --to=kernelfans@gmail.com \
    --cc=frederic@kernel.org \
    --cc=jiangshanlai@gmail.com \
    --cc=josh@joshtriplett.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=paulmck@kernel.org \
    --cc=qiang1.zhang@intel.com \
    --cc=rcu@vger.kernel.org \
    --cc=rostedt@goodmis.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