From 31a7c4746e9925512afab30557dd445d677cc802 Mon Sep 17 00:00:00 2001 From: Manfred Spraul Date: Wed, 26 May 2010 14:43:42 -0700 Subject: ipc/sem.c: cacheline align the ipc spinlock for semaphores Cacheline align the spinlock for sysv semaphores. Without the patch, the spinlock and sem_otime [written by every semop that modified the array] and sem_base [read in the hot path of try_atomic_semop()] can be in the same cacheline. Signed-off-by: Manfred Spraul Cc: Chris Mason Cc: Zach Brown Cc: Jens Axboe Cc: Nick Piggin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/sem.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include/linux/sem.h') diff --git a/include/linux/sem.h b/include/linux/sem.h index 8a4adbef8a0..f2961afa2f6 100644 --- a/include/linux/sem.h +++ b/include/linux/sem.h @@ -79,6 +79,7 @@ struct seminfo { #ifdef __KERNEL__ #include #include +#include struct task_struct; @@ -91,7 +92,8 @@ struct sem { /* One sem_array data structure for each set of semaphores in the system. */ struct sem_array { - struct kern_ipc_perm sem_perm; /* permissions .. see ipc.h */ + struct kern_ipc_perm ____cacheline_aligned_in_smp + sem_perm; /* permissions .. see ipc.h */ time_t sem_otime; /* last semop time */ time_t sem_ctime; /* last change time */ struct sem *sem_base; /* ptr to first semaphore in array */ -- cgit v1.2.3-70-g09d2