aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorManfred Spraul <manfred@colorfullife.com>2017-05-26 11:32:25 +1000
committerStephen Rothwell <sfr@canb.auug.org.au>2017-05-29 09:23:44 +1000
commit90b17f7ac4d56b4087379f31115335269c063fc8 (patch)
treeb32305524cb9fe7ab0e6f520cc882b441d2750f6 /include
parentba22f119d4dcb70c3e1aa1328cb27ac59663baca (diff)
ipc: merge ipc_rcu and kern_ipc_perm
ipc has two management structures that exist for every id: - struct kern_ipc_perm, it contains e.g. the permissions. - struct ipc_rcu, it contains the rcu head for rcu handling and the refcount. The patch merges both structures. As a bonus, we may save one cacheline, because both structures are cacheline aligned. In addition, it reduces the number of casts, instead most codepaths can use container_of. To simplify code, the ipc_rcu_alloc initializes the allocation to 0. Link: http://lkml.kernel.org/r/20170525185107.12869-3-manfred@colorfullife.com Signed-off-by: Manfred Spraul <manfred@colorfullife.com> Cc: Davidlohr Bueso <dave@stgolabs.net> Cc: Kees Cook <keescook@chromium.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/ipc.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/ipc.h b/include/linux/ipc.h
index 71fd92d81b26..5591f055e13f 100644
--- a/include/linux/ipc.h
+++ b/include/linux/ipc.h
@@ -20,6 +20,9 @@ struct kern_ipc_perm {
umode_t mode;
unsigned long seq;
void *security;
+
+ struct rcu_head rcu;
+ atomic_t refcount;
} ____cacheline_aligned_in_smp;
#endif /* _LINUX_IPC_H */