diff options
Diffstat (limited to 'mm')
-rw-r--r-- | mm/percpu.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/mm/percpu.c b/mm/percpu.c index e4e08b87b77e..ec158bb5f86d 100644 --- a/mm/percpu.c +++ b/mm/percpu.c | |||
@@ -1868,13 +1868,14 @@ int __init pcpu_embed_first_chunk(size_t reserved_size, ssize_t dyn_size, | |||
1868 | max_distance = 0; | 1868 | max_distance = 0; |
1869 | for (group = 0; group < ai->nr_groups; group++) { | 1869 | for (group = 0; group < ai->nr_groups; group++) { |
1870 | ai->groups[group].base_offset = areas[group] - base; | 1870 | ai->groups[group].base_offset = areas[group] - base; |
1871 | max_distance = max(max_distance, ai->groups[group].base_offset); | 1871 | max_distance = max_t(size_t, max_distance, |
1872 | ai->groups[group].base_offset); | ||
1872 | } | 1873 | } |
1873 | max_distance += ai->unit_size; | 1874 | max_distance += ai->unit_size; |
1874 | 1875 | ||
1875 | /* warn if maximum distance is further than 75% of vmalloc space */ | 1876 | /* warn if maximum distance is further than 75% of vmalloc space */ |
1876 | if (max_distance > (VMALLOC_END - VMALLOC_START) * 3 / 4) { | 1877 | if (max_distance > (VMALLOC_END - VMALLOC_START) * 3 / 4) { |
1877 | pr_warning("PERCPU: max_distance=0x%lx too large for vmalloc " | 1878 | pr_warning("PERCPU: max_distance=0x%zx too large for vmalloc " |
1878 | "space 0x%lx\n", | 1879 | "space 0x%lx\n", |
1879 | max_distance, VMALLOC_END - VMALLOC_START); | 1880 | max_distance, VMALLOC_END - VMALLOC_START); |
1880 | #ifdef CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK | 1881 | #ifdef CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK |