Do not cross section boundary when moving pages between mobility lists
Subsystems (2)
PATCH 1/1 Do not cross section boundary when moving pages between mobility lists
move-free-pages-between-lists-on-steal-fix-2.patch fixed an issue with a BUG_ON() that checked for a page just outside a MAX_ORDER_NR_PAGES boundary. In fact, the proper place to check it was earlier. A situation can occur on SPARSEMEM where a section boundary is crossed which will cause problems on some machines. This patch addresses the problem.
---
mm/page_alloc.c +4 -4
@@ -743,10 +743,10 @@ int move_freepages(struct zone *zone,* Remove at a later date when no bug reports exist related to * CONFIG_PAGE_GROUP_BY_MOBILITY */ -BUG_ON (page_zone (start_page) !=page_zone (end_page -1 )); +BUG_ON (page_zone (start_page) !=page_zone (end_page));#endif -for (page = start_page; page < end_page;) { +for (page = start_page; page <= end_page;) {if (!pfn_valid_within (page_to_pfn (page))) { page++;continue ;
@@ -776,8 +776,8 @@ int move_freepages_block(struct zone *zo start_pfn =page_to_pfn (page); start_pfn = start_pfn & ~(MAX_ORDER_NR_PAGES -1 ); start_page =pfn_to_page (start_pfn); - end_page = start_page +MAX_ORDER_NR_PAGES ; - end_pfn = start_pfn +MAX_ORDER_NR_PAGES ; + end_page = start_page +MAX_ORDER_NR_PAGES -1 ; + end_pfn = start_pfn +MAX_ORDER_NR_PAGES -1 ;/* Do not cross zone boundaries */ if (start_pfn < zone->zone_start_pfn)
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 7 lines
move-free-pages-between-lists-on-steal-fix-2.patch fixed an issue with a
BUG_ON()that checked for a page just outside aMAX_ORDER_NR_PAGESboundary. In fact, the proper place to check it was earlier. A situation can occur on SPARSEMEM where a section boundary is crossed which will cause problems on some machines. This patch addresses the problem.Signed-off-by Mel Gorman <[email protected]>
I reviewed it, looks ok. :-)
Thanks.
Signature · 8 lines
Yasunori Goto -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>