aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2010-09-21 01:57:19 -0400
committerTejun Heo <tj@kernel.org>2010-09-21 02:12:25 -0400
commit46b30ea9bc3698bc1d1e6fd726c9601d46fa0a91 (patch)
tree6c023260df9c957d8f452aa0c1ff42473fa1b1b5 /mm
parentb30a3f6257ed2105259b404d419b4964e363928c (diff)
percpu: fix pcpu_last_unit_cpu
pcpu_first/last_unit_cpu are used to track which cpu has the first and last units assigned. This in turn is used to determine the span of a chunk for man/unmap cache flushes and whether an address belongs to the first chunk or not in per_cpu_ptr_to_phys(). When the number of possible CPUs isn't power of two, a chunk may contain unassigned units towards the end of a chunk. The logic to determine pcpu_last_unit_cpu was incorrect when there was an unused unit at the end of a chunk. It failed to ignore the unused unit and assigned the unused marker NR_CPUS to pcpu_last_unit_cpu. This was discovered through kdump failure which was caused by malfunctioning per_cpu_ptr_to_phys() on a kvm setup with 50 possible CPUs by CAI Qian. Signed-off-by: Tejun Heo <tj@kernel.org> Reported-by: CAI Qian <caiqian@redhat.com> Cc: stable@kernel.org
Diffstat (limited to 'mm')
-rw-r--r--mm/percpu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/percpu.c b/mm/percpu.c
index 58c572b18b07..c76ef3891e0d 100644
--- a/mm/percpu.c
+++ b/mm/percpu.c
@@ -1401,9 +1401,9 @@ int __init pcpu_setup_first_chunk(const struct pcpu_alloc_info *ai,
1401 1401
1402 if (pcpu_first_unit_cpu == NR_CPUS) 1402 if (pcpu_first_unit_cpu == NR_CPUS)
1403 pcpu_first_unit_cpu = cpu; 1403 pcpu_first_unit_cpu = cpu;
1404 pcpu_last_unit_cpu = cpu;
1404 } 1405 }
1405 } 1406 }
1406 pcpu_last_unit_cpu = cpu;
1407 pcpu_nr_units = unit; 1407 pcpu_nr_units = unit;
1408 1408
1409 for_each_possible_cpu(cpu) 1409 for_each_possible_cpu(cpu)