Skip to content

Commit e694385

Browse files
RichardWeiYangtorvalds
authored andcommitted
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>
1 parent 5d75260 commit e694385

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

mm/page_alloc.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6229,18 +6229,18 @@ static void __paginginit free_area_init_core(struct pglist_data *pgdat)
62296229

62306230
for (j = 0; j < MAX_NR_ZONES; j++) {
62316231
struct zone *zone = pgdat->node_zones + j;
6232-
unsigned long size, realsize, freesize, memmap_pages;
6232+
unsigned long size, freesize, memmap_pages;
62336233
unsigned long zone_start_pfn = zone->zone_start_pfn;
62346234

62356235
size = zone->spanned_pages;
6236-
realsize = freesize = zone->present_pages;
6236+
freesize = zone->present_pages;
62376237

62386238
/*
62396239
* Adjust freesize so that it accounts for how much memory
62406240
* is used by this zone for memmap. This affects the watermark
62416241
* and per-cpu initialisations
62426242
*/
6243-
memmap_pages = calc_memmap_size(size, realsize);
6243+
memmap_pages = calc_memmap_size(size, freesize);
62446244
if (!is_highmem_idx(j)) {
62456245
if (freesize >= memmap_pages) {
62466246
freesize -= memmap_pages;
@@ -6272,7 +6272,7 @@ static void __paginginit free_area_init_core(struct pglist_data *pgdat)
62726272
* when the bootmem allocator frees pages into the buddy system.
62736273
* And all highmem pages will be managed by the buddy system.
62746274
*/
6275-
zone->managed_pages = is_highmem_idx(j) ? realsize : freesize;
6275+
zone->managed_pages = freesize;
62766276
#ifdef CONFIG_NUMA
62776277
zone->node = nid;
62786278
#endif

0 commit comments

Comments
 (0)