[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180312085646.GE4064@hirez.programming.kicks-ass.net>
Date: Mon, 12 Mar 2018 09:56:46 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Boqun Feng <boqun.feng@...il.com>
Cc: 焦晓冬 <milestonejxd@...il.com>,
linux-kernel@...r.kernel.org,
Alan Stern <stern@...land.harvard.edu>, will.deacon@....com,
torvalds@...ux-foundation.org, npiggin@...il.com, mingo@...nel.org,
mpe@...erman.id.au, oleg@...hat.com, benh@...nel.crashing.org,
Paul McKenney <paulmck@...ux.vnet.ibm.com>
Subject: Re: smp_mb__after_spinlock requirement too strong?
On Mon, Mar 12, 2018 at 04:56:00PM +0800, Boqun Feng wrote:
> So I think the purpose of smp_mb__after_spinlock() is to provide RCsc
> locks, it's just the comments before that may be misleading. We want
> RCsc locks in schedule code because we want writes in different critical
> section are ordered even outside the critical sections, for case like:
>
> CPU 0 CPU 1 CPU 2
>
> {A =0 , B = 0}
> lock(rq0);
> write A=1;
> unlock(rq0);
>
> lock(rq0);
> read A=1;
> write B=2;
> unlock(rq0);
>
> read B=2;
> smp_rmb();
> read A=1;
>
> I think we need to fix the comments rather than loose the requirement.
> Peter?
Yes, ISTR people relying on schedule() being RCsc, and I just picked a
bad exmaple.
Powered by blists - more mailing lists