2008-12-31 22:23:18

by Ravikiran G Thirumalai

[permalink] [raw]
Subject: [patch] x86: Fix incorrect __read_mostly on _boot_cpu_pda

The pda rework (commit 3461b0af025251bbc6b3d56c821c6ac2de6f7209)
to remove static boot cpu pdas introduced a bug. _boot_cpu_pda is the
actual pda used by the boot cpu and is definitely not "__read_mostly" and
ended up polluting the read mostly section with writes. This bug caused
regression of about 8-10% on certain syscall intensive workloads.

Signed-off-by: Ravikiran Thirumalai <[email protected]>

Index: linux-2.6/arch/x86/kernel/head64.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/head64.c 2008-12-30 15:28:08.000000000 -0800
+++ linux-2.6/arch/x86/kernel/head64.c 2008-12-31 10:36:21.000000000 -0800
@@ -27,7 +27,7 @@
#include <asm/trampoline.h>

/* boot cpu pda */
-static struct x8664_pda _boot_cpu_pda __read_mostly;
+static struct x8664_pda _boot_cpu_pda;

#ifdef CONFIG_SMP
/*


2008-12-31 22:18:30

by Mike Travis

[permalink] [raw]
Subject: Re: [patch] x86: Fix incorrect __read_mostly on _boot_cpu_pda

Ravikiran G Thirumalai wrote:
> The pda rework (commit 3461b0af025251bbc6b3d56c821c6ac2de6f7209)
> to remove static boot cpu pdas introduced a bug. _boot_cpu_pda is the
> actual pda used by the boot cpu and is definitely not "__read_mostly" and
> ended up polluting the read mostly section with writes. This bug caused
> regression of about 8-10% on certain syscall intensive workloads.
>
> Signed-off-by: Ravikiran Thirumalai <[email protected]>
>
> Index: linux-2.6/arch/x86/kernel/head64.c
> ===================================================================
> --- linux-2.6.orig/arch/x86/kernel/head64.c 2008-12-30 15:28:08.000000000 -0800
> +++ linux-2.6/arch/x86/kernel/head64.c 2008-12-31 10:36:21.000000000 -0800
> @@ -27,7 +27,7 @@
> #include <asm/trampoline.h>
>
> /* boot cpu pda */
> -static struct x8664_pda _boot_cpu_pda __read_mostly;
> +static struct x8664_pda _boot_cpu_pda;
>
> #ifdef CONFIG_SMP
> /*

Thanks for catching that!

Mike

2009-01-02 16:10:15

by Ingo Molnar

[permalink] [raw]
Subject: Re: [patch] x86: Fix incorrect __read_mostly on _boot_cpu_pda


* Ravikiran G Thirumalai <[email protected]> wrote:

> The pda rework (commit 3461b0af025251bbc6b3d56c821c6ac2de6f7209)
> to remove static boot cpu pdas introduced a bug. _boot_cpu_pda is the
> actual pda used by the boot cpu and is definitely not "__read_mostly" and
> ended up polluting the read mostly section with writes. This bug caused
> regression of about 8-10% on certain syscall intensive workloads.
>
> Signed-off-by: Ravikiran Thirumalai <[email protected]>

applied to tip/x86/urgent, with a Cc: stable tag. Thanks,

Ingo

2009-01-02 18:55:44

by Ravikiran G Thirumalai

[permalink] [raw]
Subject: Re: [patch] x86: Fix incorrect __read_mostly on _boot_cpu_pda

On Fri, Jan 02, 2009 at 05:09:51PM +0100, Ingo Molnar wrote:
>
>* Ravikiran G Thirumalai <[email protected]> wrote:
>
>> The pda rework (commit 3461b0af025251bbc6b3d56c821c6ac2de6f7209)
>> to remove static boot cpu pdas introduced a bug. _boot_cpu_pda is the
>> actual pda used by the boot cpu and is definitely not "__read_mostly" and
>> ended up polluting the read mostly section with writes. This bug caused
>> regression of about 8-10% on certain syscall intensive workloads.
>>
>> Signed-off-by: Ravikiran Thirumalai <[email protected]>
>
>applied to tip/x86/urgent, with a Cc: stable tag. Thanks,
>

Thanks!

Stable maintainers, please consider this for 2.6.27 stable as well
(in addition to 28). (Attaching the tip/x86/urgent commit as reference to
the patch)

Thanks,
Kiran


Attachments:
(No filename) (788.00 B)
fix_incorrect_readmostly (1.09 kB)
Download all attachments

2009-01-02 19:21:25

by Ingo Molnar

[permalink] [raw]
Subject: Re: [patch] x86: Fix incorrect __read_mostly on _boot_cpu_pda


* Ravikiran G Thirumalai <[email protected]> wrote:

> On Fri, Jan 02, 2009 at 05:09:51PM +0100, Ingo Molnar wrote:
> >
> >* Ravikiran G Thirumalai <[email protected]> wrote:
> >
> >> The pda rework (commit 3461b0af025251bbc6b3d56c821c6ac2de6f7209)
> >> to remove static boot cpu pdas introduced a bug. _boot_cpu_pda is the
> >> actual pda used by the boot cpu and is definitely not "__read_mostly" and
> >> ended up polluting the read mostly section with writes. This bug caused
> >> regression of about 8-10% on certain syscall intensive workloads.
> >>
> >> Signed-off-by: Ravikiran Thirumalai <[email protected]>
> >
> >applied to tip/x86/urgent, with a Cc: stable tag. Thanks,
> >
>
> Thanks!
>
> Stable maintainers, please consider this for 2.6.27 stable as well (in
> addition to 28). (Attaching the tip/x86/urgent commit as reference to
> the patch)

i have added a -stable tag to the commit - please only put it into -stable
once it hits Linus's tree. (in the next couple of days)

>
Ingo