[PATCH] ipc/sem.c: shrink size of struct sem_undo

From: Konstantin Khlebnikov
Date: Wed Jul 07 2010 - 13:08:19 EST


Combine ->list_id and ->rcu fields,
this is safe because this list is not rcu protected.
This change reduce sizeof(struct sem_undo) from 72 to 54 bytes,
so for small sem-arrays now sem_undo will fit into slab-64.

Signed-off-by: Konstantin Khlebnikov <khlebnikov@xxxxxxxxxx>
---
include/linux/sem.h | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/include/linux/sem.h b/include/linux/sem.h
index f2961af..f6e0433 100644
--- a/include/linux/sem.h
+++ b/include/linux/sem.h
@@ -122,9 +122,11 @@ struct sem_queue {
struct sem_undo {
struct list_head list_proc; /* per-process list: all undos from one process. */
/* rcu protected */
- struct rcu_head rcu; /* rcu struct for sem_undo() */
+ union {
+ struct list_head list_id; /* per semaphore array list: all undos for one array */
+ struct rcu_head rcu; /* rcu struct for sem_undo() */
+ };
struct sem_undo_list *ulp; /* sem_undo_list for the process */
- struct list_head list_id; /* per semaphore array list: all undos for one array */
int semid; /* semaphore set identifier */
short * semadj; /* array of adjustments, one per semaphore */
};

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/