[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <56C3504A.5040301@oracle.com>
Date: Tue, 16 Feb 2016 11:37:30 -0500
From: Sasha Levin <sasha.levin@...cle.com>
To: Peter Zijlstra <peterz@...radead.org>,
Alfredo Alvarez Fernandez <alfredoalvarezfernandez@...il.com>
Cc: mingo@...hat.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/3] tools/liblockdep: add userspace version of READ_ONCE
On 02/11/2016 10:16 AM, Peter Zijlstra wrote:
> On Thu, Feb 11, 2016 at 12:33:30AM +0100, Alfredo Alvarez Fernandez wrote:
>> From: Alfredo Alvarez Fernandez <alfredoalvarezfernandez@...il.com>
>>
>> This was added to the kernel code in 1658d35ead5d ("list: Use
>> READ_ONCE() when testing for empty lists")
>> There's nothing special we need to do about it in userspace.
>>
>> Signed-off-by: Alfredo Alvarez Fernandez <alfredoalvarezfernandez@...il.com>
>> ---
>> tools/lib/lockdep/uinclude/linux/compiler.h | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/tools/lib/lockdep/uinclude/linux/compiler.h b/tools/lib/lockdep/uinclude/linux/compiler.h
>> index 6386dc3..fd3e56a 100644
>> --- a/tools/lib/lockdep/uinclude/linux/compiler.h
>> +++ b/tools/lib/lockdep/uinclude/linux/compiler.h
>> @@ -3,6 +3,7 @@
>>
>> #define __used __attribute__((__unused__))
>> #define unlikely
>> +#define READ_ONCE(x) (x)
>> #define WRITE_ONCE(x, val) x=(val)
>
> I would argue we'd still very much want the volatile cast for both READ
> and WRITE_ONCE().
>
> Why do these things have different semantics between user and kernel
> space?
You're right. I'll send a patch.
Thanks,
Sasha
Powered by blists - more mailing lists