mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
ipc,msg: document volatile r_msg
The need for volatile is not obvious, document it. Signed-off-by: Davidlohr Bueso <davidlohr@hp.com> Signed-off-by: Manfred Spraul <manfred@colorfullife.com> Cc: Aswin Chandramouleeswaran <aswin@hp.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
3440a6bd1d
commit
4bb6657dd3
1 changed files with 7 additions and 3 deletions
10
ipc/msg.c
10
ipc/msg.c
|
@ -42,9 +42,7 @@
|
||||||
#include <linux/uaccess.h>
|
#include <linux/uaccess.h>
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
/*
|
/* one msg_receiver structure for each sleeping receiver */
|
||||||
* one msg_receiver structure for each sleeping receiver:
|
|
||||||
*/
|
|
||||||
struct msg_receiver {
|
struct msg_receiver {
|
||||||
struct list_head r_list;
|
struct list_head r_list;
|
||||||
struct task_struct *r_tsk;
|
struct task_struct *r_tsk;
|
||||||
|
@ -53,6 +51,12 @@ struct msg_receiver {
|
||||||
long r_msgtype;
|
long r_msgtype;
|
||||||
long r_maxsize;
|
long r_maxsize;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Mark r_msg volatile so that the compiler
|
||||||
|
* does not try to get smart and optimize
|
||||||
|
* it. We rely on this for the lockless
|
||||||
|
* receive algorithm.
|
||||||
|
*/
|
||||||
struct msg_msg *volatile r_msg;
|
struct msg_msg *volatile r_msg;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue