Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 166513
b: refs/heads/master
c: 6ea529a
h: refs/heads/master
i:
  166511: c98c0e8
v: v3
  • Loading branch information
Tejun Heo committed Sep 29, 2009
1 parent 28fc7af commit 1f62f42
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a70c691376c7c7f94af41395848066f59501fffd
refs/heads/master: 6ea529a2037ce662fc6bfa572b46d47407d08805
20 changes: 18 additions & 2 deletions trunk/mm/percpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1786,7 +1786,7 @@ int __init pcpu_embed_first_chunk(size_t reserved_size, ssize_t dyn_size,
void *base = (void *)ULONG_MAX;
void **areas = NULL;
struct pcpu_alloc_info *ai;
size_t size_sum, areas_size;
size_t size_sum, areas_size, max_distance;
int group, i, rc;

ai = pcpu_build_alloc_info(reserved_size, dyn_size, atom_size,
Expand Down Expand Up @@ -1836,8 +1836,24 @@ int __init pcpu_embed_first_chunk(size_t reserved_size, ssize_t dyn_size,
}

/* base address is now known, determine group base offsets */
for (group = 0; group < ai->nr_groups; group++)
max_distance = 0;
for (group = 0; group < ai->nr_groups; group++) {
ai->groups[group].base_offset = areas[group] - base;
max_distance = max(max_distance, ai->groups[group].base_offset);
}
max_distance += ai->unit_size;

/* warn if maximum distance is further than 75% of vmalloc space */
if (max_distance > (VMALLOC_END - VMALLOC_START) * 3 / 4) {
pr_warning("PERCPU: max_distance=0x%lx too large for vmalloc "
"space 0x%lx\n",
max_distance, VMALLOC_END - VMALLOC_START);
#ifdef CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK
/* and fail if we have fallback */
rc = -EINVAL;
goto out_free;
#endif
}

pr_info("PERCPU: Embedded %zu pages/cpu @%p s%zu r%zu d%zu u%zu\n",
PFN_DOWN(size_sum), base, ai->static_size, ai->reserved_size,
Expand Down

0 comments on commit 1f62f42

Please sign in to comment.