提交 4c738480 编写于 作者: A Andrew Morton 提交者: Linus Torvalds

mtrr atomicity fix

Rafael gets this on an SMP box with kernel preemption enabled, during
hibernation and restore (100% of the time):

Enabling non-boot CPUs ...
BUG: using smp_processor_id() in preemptible [00000001] code: bash/4514
caller is mtrr_save_state+0x9/0x40

Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 e44a45ae
......@@ -734,10 +734,13 @@ void mtrr_ap_init(void)
*/
void mtrr_save_state(void)
{
if (smp_processor_id() == 0)
int cpu = get_cpu();
if (cpu == 0)
mtrr_save_fixed_ranges(NULL);
else
smp_call_function_single(0, mtrr_save_fixed_ranges, NULL, 1, 1);
put_cpu();
}
static int __init mtrr_init_finialize(void)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册