Re: [patch] x86: Fix incorrect __read_mostly on _boot_cpu_pda

From: Ravikiran G Thirumalai
Date: Fri Jan 02 2009 - 13:55:43 EST


On Fri, Jan 02, 2009 at 05:09:51PM +0100, Ingo Molnar wrote:
>
>* Ravikiran G Thirumalai <kiran@xxxxxxxxxxxx> 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 <kiran@xxxxxxxxxxxx>
>
>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
commit 26799a63110dcbe81291ea53178f6b4810d07424
Author: Ravikiran G Thirumalai <kiran@xxxxxxxxxxxx>
Date: Wed Dec 31 13:44:46 2008 -0800

x86: fix incorrect __read_mostly on _boot_cpu_pda

The pda rework (commit 3461b0af025251bbc6b3d56c821c6ac2de6f7209)
to remove static boot cpu pdas introduced a performance 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 <kiran@xxxxxxxxxxxx>
Acked-by: Mike Travis <travis@xxxxxxx>
Cc: <stable@xxxxxxxxxx>
Signed-off-by: Ingo Molnar <mingo@xxxxxxx>

diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c
index 388e05a..b9a4d8c 100644
--- a/arch/x86/kernel/head64.c
+++ b/arch/x86/kernel/head64.c
@@ -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
/*