linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ipc/sem.c: shrink size of struct sem_undo
@ 2010-07-07 16:58 Konstantin Khlebnikov
  0 siblings, 0 replies; only message in thread
From: Konstantin Khlebnikov @ 2010-07-07 16:58 UTC (permalink / raw)
  To: linux-kernel

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@openvz.org>
---
 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 */
 };


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-07-07 17:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-07 16:58 [PATCH] ipc/sem.c: shrink size of struct sem_undo Konstantin Khlebnikov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).