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 <konrad.wilk@oracle.com> Cc: Andy Lutomirski <luto@amacapital.net> Cc: Borislav Petkov <bp@alien8.de> Cc: Christian Borntraeger <borntraeger@de.ibm.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Sasha Levin <sasha.levin@oracle.com> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/1453757600-11441-1-git-send-email-konrad.wilk@oracle.com [ Made it a bit more readable. ] Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
Родитель
06bea3dbfe
Коммит
fed0764faf
|
@ -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
|
* 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
|
* 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)
|
* 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
|
* READ_ONCE() and WRITE_ONCE() will fall back to memcpy(). There's at
|
||||||
* compile-time warning.
|
* 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
|
* Their two major use cases are: (1) Mediating communication between
|
||||||
* process-level code and irq/NMI handlers, all running on the same CPU,
|
* process-level code and irq/NMI handlers, all running on the same CPU,
|
||||||
|
|
Загрузка…
Ссылка в новой задаче