All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Jones <davej@redhat.com>
To: mingo@redhat.com, Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: Shrink the held_lock struct by using bitfields.
Date: Tue, 2 Jan 2007 18:38:24 -0500	[thread overview]
Message-ID: <20070102233824.GF18033@redhat.com> (raw)
In-Reply-To: <20070102233558.GA4577@redhat.com>

On Tue, Jan 02, 2007 at 06:35:58PM -0500, Dave Jones wrote:

Sent the wrong diff.  Here's the fixed version...



Shrink the held_lock struct by using bitfields.
This shrinks task_struct on lockdep enabled kernels by 480 bytes.

Signed-off-by: Dave Jones <davej@redhat.com>

diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h
index ea097dd..ba81cce 100644
--- a/include/linux/lockdep.h
+++ b/include/linux/lockdep.h
@@ -175,11 +175,11 @@ struct held_lock {
 	 * The following field is used to detect when we cross into an
 	 * interrupt context:
 	 */
-	int				irq_context;
-	int				trylock;
-	int				read;
-	int				check;
-	int				hardirqs_off;
+	unsigned char irq_context:1;
+	unsigned char trylock:1;
+	unsigned char read:2;
+	unsigned char check:1;
+	unsigned char hardirqs_off:1;
 };
 
 /*

-- 
http://www.codemonkey.org.uk

  reply	other threads:[~2007-01-02 23:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-02 23:35 Shrink the held_lock struct by using bitfields Dave Jones
2007-01-02 23:38 ` Dave Jones [this message]
2007-01-14 18:45   ` Ingo Molnar
2007-01-14 19:42     ` [patch] lockdep: shrink held_lock structure Ingo Molnar
2007-01-14 19:52       ` Ingo Molnar
     [not found] <7z1oG-6Jr-5@gated-at.bofh.it>
2007-01-03  0:47 ` Shrink the held_lock struct by using bitfields Bodo Eggert
2007-01-03  1:06   ` Dave Jones

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=20070102233824.GF18033@redhat.com \
    --to=davej@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.