Re: Shrink the held_lock struct by using bitfields.
On Tue, 2007-01-02 at 18:38 -0500, Dave Jones wrote: > + unsigned char irq_context:1; > + unsigned char trylock:1; > + unsigned char read:2; > + unsigned char check:1; > + unsigned char hardirqs_off:1; cool! I totally missed those. I'd even do this for 2.6.20, but it's probably too late for that. Acked-by: Ingo Molnar <[EMAIL PROTECTED]> Ingo - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: Shrink the held_lock struct by using bitfields.
On Tue, 2007-01-02 at 18:38 -0500, Dave Jones wrote: + unsigned char irq_context:1; + unsigned char trylock:1; + unsigned char read:2; + unsigned char check:1; + unsigned char hardirqs_off:1; cool! I totally missed those. I'd even do this for 2.6.20, but it's probably too late for that. Acked-by: Ingo Molnar [EMAIL PROTECTED] Ingo - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: Shrink the held_lock struct by using bitfields.
On Wed, Jan 03, 2007 at 01:47:36AM +0100, Bodo Eggert wrote: > Dave Jones <[EMAIL PROTECTED]> wrote: > > > Shrink the held_lock struct by using bitfields. > > This shrinks task_struct on lockdep enabled kernels by 480 bytes. > > > * The following field is used to detect when we cross into an > > * interrupt context: > > */ > > - int irq_context; > [...] > > + unsigned char irq_context:1; > [...] > > Can these fields be set by concurrent processes, e.g.: > CPU0CPU1 > load flags > load flags > flip bit > store > flip bit > store It's a per-process structure. Dave -- http://www.codemonkey.org.uk - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: Shrink the held_lock struct by using bitfields.
Dave Jones <[EMAIL PROTECTED]> wrote: > Shrink the held_lock struct by using bitfields. > This shrinks task_struct on lockdep enabled kernels by 480 bytes. > * The following field is used to detect when we cross into an > * interrupt context: > */ > - int irq_context; [...] > + unsigned char irq_context:1; [...] Can these fields be set by concurrent processes, e.g.: CPU0CPU1 load flags load flags flip bit store flip bit store ? -- Ich danke GMX dafür, die Verwendung meiner Adressen mittels per SPF verbreiteten Lügen zu sabotieren. http://david.woodhou.se/why-not-spf.html - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: Shrink the held_lock struct by using bitfields.
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 <[EMAIL PROTECTED]> 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 [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Shrink the held_lock struct by using bitfields.
Shrink the held_lock struct by using bitfields. This shrinks task_struct on lockdep enabled kernels by 480 bytes. Signed-off-by: Dave Jones <[EMAIL PROTECTED]> 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 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Shrink the held_lock struct by using bitfields.
Shrink the held_lock struct by using bitfields. This shrinks task_struct on lockdep enabled kernels by 480 bytes. Signed-off-by: Dave Jones [EMAIL PROTECTED] 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 - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: Shrink the held_lock struct by using bitfields.
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 [EMAIL PROTECTED] 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 [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: Shrink the held_lock struct by using bitfields.
Dave Jones [EMAIL PROTECTED] wrote: Shrink the held_lock struct by using bitfields. This shrinks task_struct on lockdep enabled kernels by 480 bytes. * The following field is used to detect when we cross into an * interrupt context: */ - int irq_context; [...] + unsigned char irq_context:1; [...] Can these fields be set by concurrent processes, e.g.: CPU0CPU1 load flags load flags flip bit store flip bit store ? -- Ich danke GMX dafür, die Verwendung meiner Adressen mittels per SPF verbreiteten Lügen zu sabotieren. http://david.woodhou.se/why-not-spf.html - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: Shrink the held_lock struct by using bitfields.
On Wed, Jan 03, 2007 at 01:47:36AM +0100, Bodo Eggert wrote: Dave Jones [EMAIL PROTECTED] wrote: Shrink the held_lock struct by using bitfields. This shrinks task_struct on lockdep enabled kernels by 480 bytes. * The following field is used to detect when we cross into an * interrupt context: */ - int irq_context; [...] + unsigned char irq_context:1; [...] Can these fields be set by concurrent processes, e.g.: CPU0CPU1 load flags load flags flip bit store flip bit store It's a per-process structure. Dave -- http://www.codemonkey.org.uk - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/