Commit 8a0921712ec6d00754b5d7afea78137772efee0a
Committed by
Tejun Heo
1 parent
687b0ad275
Exists in
master
and in
16 other branches
percpu: use VMALLOC_TOTAL instead of VMALLOC_END - VMALLOC_START
vmalloc already gives a useful macro to calculate the total vmalloc size. Use it. Signed-off-by: Laura Abbott <lauraa@codeaurora.org> Signed-off-by: Tejun Heo <tj@kernel.org>
Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff
mm/percpu.c
... | ... | @@ -1686,10 +1686,10 @@ |
1686 | 1686 | max_distance += ai->unit_size; |
1687 | 1687 | |
1688 | 1688 | /* warn if maximum distance is further than 75% of vmalloc space */ |
1689 | - if (max_distance > (VMALLOC_END - VMALLOC_START) * 3 / 4) { | |
1689 | + if (max_distance > VMALLOC_TOTAL * 3 / 4) { | |
1690 | 1690 | pr_warning("PERCPU: max_distance=0x%zx too large for vmalloc " |
1691 | 1691 | "space 0x%lx\n", max_distance, |
1692 | - (unsigned long)(VMALLOC_END - VMALLOC_START)); | |
1692 | + VMALLOC_TOTAL); | |
1693 | 1693 | #ifdef CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK |
1694 | 1694 | /* and fail if we have fallback */ |
1695 | 1695 | rc = -EINVAL; |