summaryrefslogtreecommitdiff
path: root/arch/x86/platform/uv
diff options
context:
space:
mode:
authorcpw@sgi.com <cpw@sgi.com>2011-06-21 12:21:26 (GMT)
committerIngo Molnar <mingo@elte.hu>2011-06-21 12:50:31 (GMT)
commit00b30cf04a775b5292ab704f782394e36e25617d (patch)
treef32ed307eb07b5aca3130e99f4479ed6f4e736b5 /arch/x86/platform/uv
parent6885685923ee786f26e7b170e3b961ac0fa14037 (diff)
downloadlinux-00b30cf04a775b5292ab704f782394e36e25617d.tar.xz
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: Cliff Wickman <cpw@sgi.com> Link: http://lkml.kernel.org/r/20110621122242.086384966@sgi.com Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/platform/uv')
-rw-r--r--arch/x86/platform/uv/tlb_uv.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/x86/platform/uv/tlb_uv.c b/arch/x86/platform/uv/tlb_uv.c
index 68e467f..34be650 100644
--- a/arch/x86/platform/uv/tlb_uv.c
+++ b/arch/x86/platform/uv/tlb_uv.c
@@ -1334,9 +1334,10 @@ static ssize_t tunables_write(struct file *file, const char __user *user,
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);
+ put_cpu();
if (ret)
return ret;