aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/platform
diff options
context:
space:
mode:
authorcpw@sgi.com <cpw@sgi.com>2011-06-21 08:21:29 -0400
committerIngo Molnar <mingo@elte.hu>2011-06-21 08:50:32 -0400
commit485f07d349a3e5059413b886a3bc1996c4b3d14d (patch)
treeeae1805babf68f71f2b75ca3a2cb675721993def /arch/x86/platform
parent9c9153db22870c3f37add83bea30500fcc268a73 (diff)
x86, UV: Correct reset_with_ipi()
Fix reset_with_ipi() to look up a cpu for a blade based on the distribution map being indexed by the potentially sparsely numbered pnode. This patch is critical to tlb shootdown on a partitioned UV system, or one with nonconsecutive blade numbers. The distribution map bits represent pnodes relative to the partition base pnode. Previous to this patch it had been assuming bits based on 0-based, consecutive blade ids. Signed-off-by: Cliff Wickman <cpw@sgi.com> Link: http://lkml.kernel.org/r/20110621122242.497700003@sgi.com Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/platform')
-rw-r--r--arch/x86/platform/uv/tlb_uv.c33
1 files changed, 21 insertions, 12 deletions
diff --git a/arch/x86/platform/uv/tlb_uv.c b/arch/x86/platform/uv/tlb_uv.c
index 7623b08eab1..4b28e09e265 100644
--- a/arch/x86/platform/uv/tlb_uv.c
+++ b/arch/x86/platform/uv/tlb_uv.c
@@ -296,14 +296,18 @@ static void bau_process_message(struct msg_desc *mdp,
296} 296}
297 297
298/* 298/*
299 * Determine the first cpu on a uvhub. 299 * Determine the first cpu on a pnode.
300 */ 300 */
301static int uvhub_to_first_cpu(int uvhub) 301static int pnode_to_first_cpu(int pnode, struct bau_control *smaster)
302{ 302{
303 int cpu; 303 int cpu;
304 for_each_present_cpu(cpu) 304 struct hub_and_pnode *hpp;
305 if (uvhub == uv_cpu_to_blade_id(cpu)) 305
306 for_each_present_cpu(cpu) {
307 hpp = &smaster->thp[cpu];
308 if (pnode == hpp->pnode)
306 return cpu; 309 return cpu;
310 }
307 return -1; 311 return -1;
308} 312}
309 313
@@ -366,23 +370,28 @@ static void do_reset(void *ptr)
366 * Use IPI to get all target uvhubs to release resources held by 370 * Use IPI to get all target uvhubs to release resources held by
367 * a given sending cpu number. 371 * a given sending cpu number.
368 */ 372 */
369static void reset_with_ipi(struct bau_targ_hubmask *distribution, int sender) 373static void reset_with_ipi(struct bau_targ_hubmask *distribution,
374 struct bau_control *bcp)
370{ 375{
371 int uvhub; 376 int pnode;
377 int apnode;
372 int maskbits; 378 int maskbits;
373 cpumask_t mask; 379 cpumask_t mask;
380 int sender = bcp->cpu;
381 struct bau_control *smaster = bcp->socket_master;
374 struct reset_args reset_args; 382 struct reset_args reset_args;
375 383
376 reset_args.sender = sender; 384 reset_args.sender = sender;
377 cpus_clear(mask); 385 cpus_clear(mask);
378 /* find a single cpu for each uvhub in this distribution mask */ 386 /* find a single cpu for each uvhub in this distribution mask */
379 maskbits = sizeof(struct bau_targ_hubmask) * BITSPERBYTE; 387 maskbits = sizeof(struct bau_targ_hubmask) * BITSPERBYTE;
380 for (uvhub = 0; uvhub < maskbits; uvhub++) { 388 /* each bit is a pnode relative to the partition base pnode */
389 for (pnode = 0; pnode < maskbits; pnode++) {
381 int cpu; 390 int cpu;
382 if (!bau_uvhub_isset(uvhub, distribution)) 391 if (!bau_uvhub_isset(pnode, distribution))
383 continue; 392 continue;
384 /* find a cpu for this uvhub */ 393 apnode = pnode + bcp->partition_base_pnode;
385 cpu = uvhub_to_first_cpu(uvhub); 394 cpu = pnode_to_first_cpu(apnode, smaster);
386 cpu_set(cpu, mask); 395 cpu_set(cpu, mask);
387 } 396 }
388 397
@@ -604,7 +613,7 @@ static void destination_plugged(struct bau_desc *bau_desc,
604 quiesce_local_uvhub(hmaster); 613 quiesce_local_uvhub(hmaster);
605 614
606 spin_lock(&hmaster->queue_lock); 615 spin_lock(&hmaster->queue_lock);
607 reset_with_ipi(&bau_desc->distribution, bcp->cpu); 616 reset_with_ipi(&bau_desc->distribution, bcp);
608 spin_unlock(&hmaster->queue_lock); 617 spin_unlock(&hmaster->queue_lock);
609 618
610 end_uvhub_quiesce(hmaster); 619 end_uvhub_quiesce(hmaster);
@@ -626,7 +635,7 @@ static void destination_timeout(struct bau_desc *bau_desc,
626 quiesce_local_uvhub(hmaster); 635 quiesce_local_uvhub(hmaster);
627 636
628 spin_lock(&hmaster->queue_lock); 637 spin_lock(&hmaster->queue_lock);
629 reset_with_ipi(&bau_desc->distribution, bcp->cpu); 638 reset_with_ipi(&bau_desc->distribution, bcp);
630 spin_unlock(&hmaster->queue_lock); 639 spin_unlock(&hmaster->queue_lock);
631 640
632 end_uvhub_quiesce(hmaster); 641 end_uvhub_quiesce(hmaster);