diff options
-rw-r--r-- | mm/percpu.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/mm/percpu.c b/mm/percpu.c index 0ae7a09141e..af0cc7a58f9 100644 --- a/mm/percpu.c +++ b/mm/percpu.c | |||
@@ -1630,6 +1630,16 @@ int __init pcpu_embed_first_chunk(size_t reserved_size, size_t dyn_size, | |||
1630 | areas[group] = ptr; | 1630 | areas[group] = ptr; |
1631 | 1631 | ||
1632 | base = min(ptr, base); | 1632 | base = min(ptr, base); |
1633 | } | ||
1634 | |||
1635 | /* | ||
1636 | * Copy data and free unused parts. This should happen after all | ||
1637 | * allocations are complete; otherwise, we may end up with | ||
1638 | * overlapping groups. | ||
1639 | */ | ||
1640 | for (group = 0; group < ai->nr_groups; group++) { | ||
1641 | struct pcpu_group_info *gi = &ai->groups[group]; | ||
1642 | void *ptr = areas[group]; | ||
1633 | 1643 | ||
1634 | for (i = 0; i < gi->nr_units; i++, ptr += ai->unit_size) { | 1644 | for (i = 0; i < gi->nr_units; i++, ptr += ai->unit_size) { |
1635 | if (gi->cpu_map[i] == NR_CPUS) { | 1645 | if (gi->cpu_map[i] == NR_CPUS) { |