linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Konstantin Khlebnikov <khlebnikov@openvz.org>
To: <linux-kernel@vger.kernel.org>
Subject: [PATCH] ipc/sem.c: shrink size of struct sem_undo
Date: Wed, 7 Jul 2010 20:58:15 +0400	[thread overview]
Message-ID: <20100707165815.28007.57836.stgit@zurg> (raw)

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 */
 };


                 reply	other threads:[~2010-07-07 17:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100707165815.28007.57836.stgit@zurg \
    --to=khlebnikov@openvz.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).