Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1331582 > unrolled thread

[PATCH 1/3] tools/liblockdep: add userspace version of READ_ONCE

Started byAlfredo Alvarez Fernandez <alfredoalvarezfernandez@gmail.com>
First post2016-02-11 00:40 +0100
Last post2016-02-16 17:40 +0100
Articles 3 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 1/3] tools/liblockdep: add userspace version of READ_ONCE Alfredo Alvarez Fernandez <alfredoalvarezfernandez@gmail.com> - 2016-02-11 00:40 +0100
    Re: [PATCH 1/3] tools/liblockdep: add userspace version of READ_ONCE Peter Zijlstra <peterz@infradead.org> - 2016-02-11 16:20 +0100
      Re: [PATCH 1/3] tools/liblockdep: add userspace version of READ_ONCE Sasha Levin <sasha.levin@oracle.com> - 2016-02-16 17:40 +0100

#1331582 — [PATCH 1/3] tools/liblockdep: add userspace version of READ_ONCE

FromAlfredo Alvarez Fernandez <alfredoalvarezfernandez@gmail.com>
Date2016-02-11 00:40 +0100
Subject[PATCH 1/3] tools/liblockdep: add userspace version of READ_ONCE
Message-ID<r0Mwx-Bp-9@gated-at.bofh.it>
From: Alfredo Alvarez Fernandez <alfredoalvarezfernandez@gmail.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@gmail.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)
 #define RCU_INIT_POINTER(p, v) p=(v)
 
-- 
2.5.0

[toc] | [next] | [standalone]


#1332136

FromPeter Zijlstra <peterz@infradead.org>
Date2016-02-11 16:20 +0100
Message-ID<r11ce-26P-5@gated-at.bofh.it>
In reply to#1331582
On Thu, Feb 11, 2016 at 12:33:30AM +0100, Alfredo Alvarez Fernandez wrote:
> From: Alfredo Alvarez Fernandez <alfredoalvarezfernandez@gmail.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@gmail.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?

[toc] | [prev] | [next] | [standalone]


#1335624

FromSasha Levin <sasha.levin@oracle.com>
Date2016-02-16 17:40 +0100
Message-ID<r2QPp-1Uv-43@gated-at.bofh.it>
In reply to#1332136
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@gmail.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@gmail.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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web