Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm: page_alloc: validate buddy before check its migratetype.

Whenever a buddy page is found, page_is_buddy() should be called to
check its validity. Add the missing check during pageblock merge check.

Fixes: 1dd214b8f21c ("mm: page_alloc: avoid merging non-fallbackable pageblocks with others")
Link: https://lore.kernel.org/all/20220330154208.71aca532@gandalf.local.home/
Reported-and-tested-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Zi Yan <ziy@nvidia.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Zi Yan and committed by
Linus Torvalds
787af64d d5fd43ba

+3
+3
mm/page_alloc.c
··· 1108 1108 1109 1109 buddy_pfn = __find_buddy_pfn(pfn, order); 1110 1110 buddy = page + (buddy_pfn - pfn); 1111 + 1112 + if (!page_is_buddy(page, buddy, order)) 1113 + goto done_merging; 1111 1114 buddy_mt = get_pageblock_migratetype(buddy); 1112 1115 1113 1116 if (migratetype != buddy_mt