[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20111011084135.GA6501@alberich.amd.com>
Date: Tue, 11 Oct 2011 10:41:35 +0200
From: Andreas Herrmann <andreas.herrmann3@....com>
To: "Srivatsa S. Bhat" <srivatsa.bhat@...ux.vnet.ibm.com>
CC: Ingo Molnar <mingo@...e.hu>,
"Petkov, Borislav" <Borislav.Petkov@....com>,
Borislav Petkov <bp@...64.org>,
"tigran@...azian.fsnet.co.uk" <tigran@...azian.fsnet.co.uk>,
"tglx@...utronix.de" <tglx@...utronix.de>,
"mingo@...hat.com" <mingo@...hat.com>,
"hpa@...or.com" <hpa@...or.com>, "x86@...nel.org" <x86@...nel.org>,
"amd64-microcode@...64.org" <amd64-microcode@...64.org>,
"Rafael J. Wysocki" <rjw@...k.pl>, Tejun Heo <tj@...nel.org>,
Linux PM mailing list <linux-pm@...r.kernel.org>,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH RESEND] CPU hotplug,x86 Microcode: Don't request
microcode from userspace unnecessarily
On Sun, Oct 09, 2011 at 03:42:00PM -0400, Srivatsa S. Bhat wrote:
> Requesting the microcode from userspace *every time* when onlining CPUs
> (during a CPU hotplug operation) is unnecessary.
>
> So, this patch ensures that once the kernel gets the microcode after booting,
> it is not freed nor invalidated when a CPU goes offline, so that it can be
> reused when that CPU comes back online, without requesting userspace for it
> again. As a result, the CPU hotplug operations become faster as well.
>
> Tested-by: Borislav Petkov <bp@...64.org>
> Acked-by: Borislav Petkov <bp@...64.org>
>
> Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@...ux.vnet.ibm.com>
Acked-by: Andreas Herrmann <andreas.herrmann3@....com>
Thanks,
Andreas
> arch/x86/kernel/microcode_core.c | 9 ++++++++-
> 1 files changed, 8 insertions(+), 1 deletions(-)
>
> diff --git a/arch/x86/kernel/microcode_core.c b/arch/x86/kernel/microcode_core.c
> index f924280..33c8a67 100644
> --- a/arch/x86/kernel/microcode_core.c
> +++ b/arch/x86/kernel/microcode_core.c
> @@ -483,7 +483,14 @@ mc_cpu_callback(struct notifier_block *nb, unsigned long action, void *hcpu)
> sysfs_remove_group(&sys_dev->kobj, &mc_attr_group);
> pr_debug("CPU%d removed\n", cpu);
> break;
> - case CPU_DEAD:
> +
> + /*
> + * When a CPU goes offline, don't free up or invalidate the copy of
> + * the microcode in kernel memory, so that we can reuse it when the
> + * CPU comes back online without unnecessarily requesting the userspace
> + * for it again.
> + */
> +
> case CPU_UP_CANCELED_FROZEN:
> /* The CPU refused to come up during a system resume */
> microcode_fini_cpu(cpu);
>
>
>
--
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