summaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorzhong jiang <zhongjiang@huawei.com>2017-12-15 11:22:13 +1100
committerStephen Rothwell <sfr@canb.auug.org.au>2017-12-19 15:28:46 +1100
commit1f730926c6e5d467c0767c5e7d89ab2cd0ee1eaf (patch)
treef90f40f872ccc551d2c137f054bd9187564b8dcd /mm
parent3bdb359ad03e0234e18017864b78b1eca7a0ed33 (diff)
mm/page_owner: align with pageblock_nr_pages
Currently, init_pages_in_zone() walks the zone in pageblock_nr_pages steps. MAX_ORDER_NR_PAGES is possible to have holes when CONFIG_HOLES_IN_ZONE is set. it is likely to be different between MAX_ORDER_NR_PAGES and pageblock_nr_pages. if we skip the size of MAX_ORDER_NR_PAGES, it will result in the second 2M memroy leak. Meanwhile, the change will make the code consistent. because the entire function is based on the pageblock_nr_pages steps. Link: http://lkml.kernel.org/r/1512395284-13588-1-git-send-email-zhongjiang@huawei.com Signed-off-by: zhong jiang <zhongjiang@huawei.com> Cc: Michal Hocko <mhocko@kernel.org> Cc: Vlastimil Babka <vbabka@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Diffstat (limited to 'mm')
-rw-r--r--mm/page_owner.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/page_owner.c b/mm/page_owner.c
index 5ab4f0a5ff4b..08e4e6e4cf3c 100644
--- a/mm/page_owner.c
+++ b/mm/page_owner.c
@@ -544,7 +544,7 @@ static void init_pages_in_zone(pg_data_t *pgdat, struct zone *zone)
*/
for (; pfn < end_pfn; ) {
if (!pfn_valid(pfn)) {
- pfn = ALIGN(pfn + 1, MAX_ORDER_NR_PAGES);
+ pfn = ALIGN(pfn + 1, pageblock_nr_pages);
continue;
}