public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Shrink the held_lock struct by using bitfields.
@ 2007-01-02 23:35 Dave Jones
  2007-01-02 23:38 ` Dave Jones
  0 siblings, 1 reply; 7+ messages in thread
From: Dave Jones @ 2007-01-02 23:35 UTC (permalink / raw)
  To: mingo; +Cc: Linux Kernel

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:1;
+	unsigned char check:1;
+	unsigned char hardirqs_off:1;
 };
 
 /*

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

^ permalink raw reply related	[flat|nested] 7+ messages in thread
[parent not found: <7z1oG-6Jr-5@gated-at.bofh.it>]

end of thread, other threads:[~2007-01-14 19:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-02 23:35 Shrink the held_lock struct by using bitfields Dave Jones
2007-01-02 23:38 ` Dave Jones
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox