Messages in this thread Patch in this message | | | Date | Sun, 09 Oct 2011 02:17:53 +0530 | From | "Srivatsa S. Bhat" <> | Subject | [PATCH] CPU hotplug,x86 Microcode: Don't request microcode from userspace unnecessarily |
| |
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@amd64.org> Acked-by: Borislav Petkov <bp@amd64.org> Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com> ---
arch/x86/kernel/microcode_core.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/arch/x86/kernel/microcode_core.c b/arch/x86/kernel/microcode_core.c index f924280..3fd0189 100644 --- a/arch/x86/kernel/microcode_core.c +++ b/arch/x86/kernel/microcode_core.c @@ -483,7 +483,13 @@ 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);
| |