[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0702101853140.8424@woody.linux-foundation.org>
Date: Sat, 10 Feb 2007 18:55:50 -0800 (PST)
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Dave Jones <davej@...hat.com>
cc: William Cohen <wcohen@...hat.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Ingo Molnar <mingo@...e.hu>
Subject: Re: Size of 2.6.20 task_struct on x86_64 machines
On Sat, 10 Feb 2007, Dave Jones wrote:
>
> Shrink the held_lock struct by using bitfields.
> This shrinks task_struct on lockdep enabled kernels by 480 bytes.
Are we sure that there are no users that depend on accessing the different
fields under different locks?
Having them as separate "int" fields means that they don't have any
interaction, and normal cache coherency will "just work". Once they are
fields in the same word in memory, updating one field automatically will
do a read-write cycle on the other fields, and if _they_ are updated by
interrupts or other CPU's at the same time, a write can get lost..
So I'd like this to be ack'ed by Ingo.
Ingo?
Linus
---
> Signed-off-by: Dave Jones <davej@...hat.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
>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists