lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJhHMCDcKB7sOwW3fp2gu20ot4V913kbZYQfN7T1we_choWLLw@mail.gmail.com>
Date:	Tue, 8 Jul 2014 16:43:37 -0400
From:	Pranith Kumar <bobby.prani@...il.com>
To:	Paul McKenney <paulmck@...ux.vnet.ibm.com>
Cc:	LKML <linux-kernel@...r.kernel.org>, mingo@...nel.org,
	laijs@...fujitsu.com, Dipankar Sarma <dipankar@...ibm.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
	Josh Triplett <josh@...htriplett.org>, niv@...ibm.com,
	tglx@...utronix.de, Peter Zijlstra <peterz@...radead.org>,
	rostedt@...dmis.org, dhowells@...hat.com,
	Eric Dumazet <edumazet@...gle.com>
Subject: Re: [PATCH tip/core/rcu 06/17] rcu: Eliminate read-modify-write
 ACCESS_ONCE() calls

On Tue, Jul 8, 2014 at 4:35 PM, Paul E. McKenney
<paulmck@...ux.vnet.ibm.com> wrote:
>
> Good catch, I clearly didn't include enough patterns in my search.
>
> But please see below.  And please rebase onto branch rcu/dev in
> git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git,
> as this patch set does not apply.

OK, I will resend the patch. One question below:

>
>                                                         Thanx, Paul
>
>> Signed-off-by: Pranith Kumar <bobby.prani@...il.com>
>> ---
>> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
>> index dac6d20..f500395 100644
>> --- a/kernel/rcu/tree.c
>> +++ b/kernel/rcu/tree.c
>> @@ -1700,7 +1700,7 @@ static int rcu_gp_fqs(struct rcu_state *rsp, int
>> fqs_state_in)
>>         if (ACCESS_ONCE(rsp->gp_flags) & RCU_GP_FLAG_FQS) {
>>                 raw_spin_lock_irq(&rnp->lock);
>>                 smp_mb__after_unlock_lock();
>> -               ACCESS_ONCE(rsp->gp_flags) &= ~RCU_GP_FLAG_FQS;
>> +               ACCESS_ONCE(rsp->gp_flags) = rsp->gp_flags & ~RCU_GP_FLAG_FQS;
>
> Here we need ACCESS_ONCE() around both instances of rsp->gp_flags.

I see that all accesses of gp_flags are wrapped with ACCESS_ONCE(). Is
there any reason why we can't declare it as 'volatile' and not use
ACCESS_ONCE everywhere?

-- 
Pranith
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ