The patch titled Subject: mm, isolation: avoid checking unmovable pages across pageblock boundary has been added to the -mm tree. Its filename is mm-isolation-avoid-checking-unmovable-pages-across-pageblock-boundary.patch This patch should soon appear at https://ozlabs.org/~akpm/mmots/broken-out/mm-isolation-avoid-checking-unmovable-pages-across-pageblock-boundary.patch and later at https://ozlabs.org/~akpm/mmotm/broken-out/mm-isolation-avoid-checking-unmovable-pages-across-pageblock-boundary.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Li Xinhai <lixinhai.lxh@xxxxxxxxx> Subject: mm, isolation: avoid checking unmovable pages across pageblock boundary In has_unmovable_pages(), the page parameter would not always be the first page within a pageblock (see how the page pointer is passed in from start_isolate_page_range() after call __first_valid_page()), so that would cause checking unmovable pages span two pageblocks. After this patch, the checking is enforced within one pageblock no matter the page is first one or not, and obey the semantics of this function. This issue is found by code inspection. Link: https://lkml.kernel.org/r/20200824065811.383266-1-lixinhai.lxh@xxxxxxxxx Signed-off-by: Li Xinhai <lixinhai.lxh@xxxxxxxxx> Reviewed-by: Oscar Salvador <osalvador@xxxxxxx> Cc: Michal Hocko <mhocko@xxxxxxxx> Cc: David Hildenbrand <david@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/page_alloc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/mm/page_alloc.c~mm-isolation-avoid-checking-unmovable-pages-across-pageblock-boundary +++ a/mm/page_alloc.c @@ -8218,6 +8218,7 @@ struct page *has_unmovable_pages(struct { unsigned long iter = 0; unsigned long pfn = page_to_pfn(page); + unsigned long offset = pfn % pageblock_nr_pages; if (is_migrate_cma_page(page)) { /* @@ -8231,7 +8232,7 @@ struct page *has_unmovable_pages(struct return page; } - for (; iter < pageblock_nr_pages; iter++) { + for (; iter < pageblock_nr_pages - offset; iter++) { if (!pfn_valid_within(pfn + iter)) continue; _ Patches currently in -mm which might be from lixinhai.lxh@xxxxxxxxx are mm-isolation-avoid-checking-unmovable-pages-across-pageblock-boundary.patch