Commit 00b30cf0 authored by cpw@sgi.com's avatar cpw@sgi.com Committed by Ingo Molnar

x86, UV: Fix smp_processor_id() use in a preemptable region

Fix a call by tunables_write() to smp_processor_id() within a
preemptable region.

Call get_cpu()/put_cpu() around the region where the returned
cpu number is actually used, which makes it non-preemptable.

A DEBUG_PREEMPT warning is prevented.

UV does not support cpu hotplug yet, but this is a step toward
that ability as well.
Signed-off-by: default avatarCliff Wickman <cpw@sgi.com>
Link: http://lkml.kernel.org/r/20110621122242.086384966@sgi.comSigned-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 68856859
...@@ -1334,9 +1334,10 @@ static ssize_t tunables_write(struct file *file, const char __user *user, ...@@ -1334,9 +1334,10 @@ static ssize_t tunables_write(struct file *file, const char __user *user,
instr[count] = '\0'; instr[count] = '\0';
bcp = &per_cpu(bau_control, smp_processor_id()); cpu = get_cpu();
bcp = &per_cpu(bau_control, cpu);
ret = parse_tunables_write(bcp, instr, count); ret = parse_tunables_write(bcp, instr, count);
put_cpu();
if (ret) if (ret)
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment