diff options
author | Wei Yang <richard.weiyang@gmail.com> | 2018-06-07 20:06:04 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-06-07 20:34:35 -0400 |
commit | e69438596bb3e97809e76be315e54a4a444f4797 (patch) | |
tree | 307e813f11204cf50d1ac109c6dccc33f8e39ebf /mm/page_alloc.c | |
parent | 5d752600a8c373382264392f5b573b2fc9c0e8ea (diff) |
mm/page_alloc: remove realsize in free_area_init_core()
Highmem's realsize always equals to freesize, so it is not necessary to
spare a variable to record this.
Link: http://lkml.kernel.org/r/20180413083859.65888-1-richard.weiyang@gmail.com
Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Michal Hocko <mhocko@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r-- | mm/page_alloc.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 22320ea27489..4fbe211340e0 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -6229,18 +6229,18 @@ static void __paginginit free_area_init_core(struct pglist_data *pgdat) | |||
6229 | 6229 | ||
6230 | for (j = 0; j < MAX_NR_ZONES; j++) { | 6230 | for (j = 0; j < MAX_NR_ZONES; j++) { |
6231 | struct zone *zone = pgdat->node_zones + j; | 6231 | struct zone *zone = pgdat->node_zones + j; |
6232 | unsigned long size, realsize, freesize, memmap_pages; | 6232 | unsigned long size, freesize, memmap_pages; |
6233 | unsigned long zone_start_pfn = zone->zone_start_pfn; | 6233 | unsigned long zone_start_pfn = zone->zone_start_pfn; |
6234 | 6234 | ||
6235 | size = zone->spanned_pages; | 6235 | size = zone->spanned_pages; |
6236 | realsize = freesize = zone->present_pages; | 6236 | freesize = zone->present_pages; |
6237 | 6237 | ||
6238 | /* | 6238 | /* |
6239 | * Adjust freesize so that it accounts for how much memory | 6239 | * Adjust freesize so that it accounts for how much memory |
6240 | * is used by this zone for memmap. This affects the watermark | 6240 | * is used by this zone for memmap. This affects the watermark |
6241 | * and per-cpu initialisations | 6241 | * and per-cpu initialisations |
6242 | */ | 6242 | */ |
6243 | memmap_pages = calc_memmap_size(size, realsize); | 6243 | memmap_pages = calc_memmap_size(size, freesize); |
6244 | if (!is_highmem_idx(j)) { | 6244 | if (!is_highmem_idx(j)) { |
6245 | if (freesize >= memmap_pages) { | 6245 | if (freesize >= memmap_pages) { |
6246 | freesize -= memmap_pages; | 6246 | freesize -= memmap_pages; |
@@ -6272,7 +6272,7 @@ static void __paginginit free_area_init_core(struct pglist_data *pgdat) | |||
6272 | * when the bootmem allocator frees pages into the buddy system. | 6272 | * when the bootmem allocator frees pages into the buddy system. |
6273 | * And all highmem pages will be managed by the buddy system. | 6273 | * And all highmem pages will be managed by the buddy system. |
6274 | */ | 6274 | */ |
6275 | zone->managed_pages = is_highmem_idx(j) ? realsize : freesize; | 6275 | zone->managed_pages = freesize; |
6276 | #ifdef CONFIG_NUMA | 6276 | #ifdef CONFIG_NUMA |
6277 | zone->node = nid; | 6277 | zone->node = nid; |
6278 | #endif | 6278 | #endif |