aboutsummaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorKonrad Rzeszutek Wilk <[email protected]>2016-01-25 16:33:20 -0500
committerIngo Molnar <[email protected]>2016-02-09 14:50:16 +0100
commitfed0764fafd8e2e629a033c0f7df4106b0dcb7f0 (patch)
tree11877084d79ccadb090b726cb280bb76e72ca4aa /include/linux
parent06bea3dbfe6a4c333c4333362c46bdf4d9e43504 (diff)
locking/atomics: Update comment about READ_ONCE() and structures
The comment is out of data. Also point out the performance drawback of the barrier();__builtin_memcpy(); barrier() followed by another copy from stack (__u) to lvalue; Signed-off-by: Konrad Rzeszutek Wilk <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Christian Borntraeger <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Paul E. McKenney <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Sasha Levin <[email protected]> Cc: Thomas Gleixner <[email protected]> Link: http://lkml.kernel.org/r/[email protected] [ Made it a bit more readable. ] Signed-off-by: Ingo Molnar <[email protected]>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/compiler.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 00b042c49ccd..4291592b6433 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -263,8 +263,9 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s
* In contrast to ACCESS_ONCE these two macros will also work on aggregate
* data types like structs or unions. If the size of the accessed data
* type exceeds the word size of the machine (e.g., 32 bits or 64 bits)
- * READ_ONCE() and WRITE_ONCE() will fall back to memcpy and print a
- * compile-time warning.
+ * READ_ONCE() and WRITE_ONCE() will fall back to memcpy(). There's at
+ * least two memcpy()s: one for the __builtin_memcpy() and then one for
+ * the macro doing the copy of variable - '__u' allocated on the stack.
*
* Their two major use cases are: (1) Mediating communication between
* process-level code and irq/NMI handlers, all running on the same CPU,