git://ftp.safe.ca
/
safe
/
jmp
/
linux-2.6
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
percpu: fix unit_map[] verification in pcpu_setup_first_chunk()
[safe/jmp/linux-2.6]
/
mm
/
percpu.c
diff --git
a/mm/percpu.c
b/mm/percpu.c
index
7793392
..
e5c4cbd
100644
(file)
--- a/
mm/percpu.c
+++ b/
mm/percpu.c
@@
-347,7
+347,7
@@
static struct pcpu_chunk *pcpu_chunk_addr_search(void *addr)
* space. Note that any possible cpu id can be used here, so
* there's no need to worry about preemption or cpu hotplug.
*/
* space. Note that any possible cpu id can be used here, so
* there's no need to worry about preemption or cpu hotplug.
*/
- addr += pcpu_unit_offsets[smp_processor_id()];
+ addr += pcpu_unit_offsets[
raw_
smp_processor_id()];
return pcpu_get_page_chunk(vmalloc_to_page(addr));
}
return pcpu_get_page_chunk(vmalloc_to_page(addr));
}
@@
-1604,7
+1604,7
@@
int __init pcpu_setup_first_chunk(const struct pcpu_alloc_info *ai,
unit_off = alloc_bootmem(nr_cpu_ids * sizeof(unit_off[0]));
for (cpu = 0; cpu < nr_cpu_ids; cpu++)
unit_off = alloc_bootmem(nr_cpu_ids * sizeof(unit_off[0]));
for (cpu = 0; cpu < nr_cpu_ids; cpu++)
- unit_map[cpu] =
NR_CPUS
;
+ unit_map[cpu] =
UINT_MAX
;
pcpu_first_unit_cpu = NR_CPUS;
for (group = 0, unit = 0; group < ai->nr_groups; group++, unit += i) {
pcpu_first_unit_cpu = NR_CPUS;
for (group = 0, unit = 0; group < ai->nr_groups; group++, unit += i) {
@@
-1619,7
+1619,7
@@
int __init pcpu_setup_first_chunk(const struct pcpu_alloc_info *ai,
continue;
BUG_ON(cpu > nr_cpu_ids || !cpu_possible(cpu));
continue;
BUG_ON(cpu > nr_cpu_ids || !cpu_possible(cpu));
- BUG_ON(unit_map[cpu] !=
NR_CPUS
);
+ BUG_ON(unit_map[cpu] !=
UINT_MAX
);
unit_map[cpu] = unit + i;
unit_off[cpu] = gi->base_offset + i * ai->unit_size;
unit_map[cpu] = unit + i;
unit_off[cpu] = gi->base_offset + i * ai->unit_size;
@@
-1632,7
+1632,7
@@
int __init pcpu_setup_first_chunk(const struct pcpu_alloc_info *ai,
pcpu_nr_units = unit;
for_each_possible_cpu(cpu)
pcpu_nr_units = unit;
for_each_possible_cpu(cpu)
- BUG_ON(unit_map[cpu] ==
NR_CPUS
);
+ BUG_ON(unit_map[cpu] ==
UINT_MAX
);
pcpu_nr_groups = ai->nr_groups;
pcpu_group_offsets = group_offsets;
pcpu_nr_groups = ai->nr_groups;
pcpu_group_offsets = group_offsets;