[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140723121349.GH11241@linux.vnet.ibm.com>
Date: Wed, 23 Jul 2014 05:13:49 -0700
From: "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
To: Pranith Kumar <bobby.prani@...il.com>
Cc: Josh Triplett <josh@...htriplett.org>,
Steven Rostedt <rostedt@...dmis.org>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Lai Jiangshan <laijs@...fujitsu.com>,
"open list:READ-COPY UPDATE..." <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 06/16] rcu: Clear gp_flags only when actually starting
new gp
On Wed, Jul 23, 2014 at 01:09:43AM -0400, Pranith Kumar wrote:
> We are clearing the gp_flags before we check if a grace period is in progress.
> If a grace period is in progress, we return after incorrectly clearing the
> gp_flags. The code comments say that this is highly unlikely, but just to be
> safe this commit moves the clearing of gp_flags to after the check for grace
> period in progress.
>
> Signed-off-by: Pranith Kumar <bobby.prani@...il.com>
Sorry, but no. The WARN_ON_ONCE() indicates an error condition. It should
not be possible to have a grace period already in progress at this point
in the code. So the two locations for the clearing of ->gp_flags are
equivalent.
Thanx, Paul
> ---
> kernel/rcu/tree.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> index 044946e..b14cecd 100644
> --- a/kernel/rcu/tree.c
> +++ b/kernel/rcu/tree.c
> @@ -1605,7 +1605,6 @@ static int rcu_gp_init(struct rcu_state *rsp)
> raw_spin_unlock_irq(&rnp->lock);
> return 0;
> }
> - ACCESS_ONCE(rsp->gp_flags) = 0; /* Clear all flags: New grace period. */
>
> if (WARN_ON_ONCE(rcu_gp_in_progress(rsp))) {
> /*
> @@ -1616,6 +1615,8 @@ static int rcu_gp_init(struct rcu_state *rsp)
> return 0;
> }
>
> + ACCESS_ONCE(rsp->gp_flags) = 0; /* Clear all flags: New grace period. */
> +
> /* Advance to a new grace period and initialize state. */
> record_gp_stall_check_time(rsp);
> /* Record GP times before starting GP, hence smp_store_release(). */
> --
> 2.0.0.rc2
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists