[RAMEN9610-12171] mm/hpa: fix possible inifinite page isolation
If HPA starts isolating pages in a page block that is currently
isolated in another thread, the page block possibly remains isolated
infinitely because HPA decides the target migratetype of the page block
from the current migratetype of it. Once it gets migratetype of a page
block as MT_ISOLATE and passes it to alloc_contig_range(), the final
migratetype of the page block becomes MT_ISOLATE which is not expected.
See the following race condition described by Jaewon Kim.
CPU0 CPU1
get_pageblock_migratetype
-> get MT_NON_ISOLATE as previous MT
alloc_contig_range_fast
__alloc_contig_range
start_isolate_page_range
-> set to MT_ISOALTE
get_pageblock_migratetype
-> get MT_ISOLATE as previous MT
alloc_contig_range_fast
__alloc_contig_range
start_isolate_page_range
-> set to MT_ISOALTE
undo_isolate_page_range to the
-> recover to MT_NON_ISOLATE
undo_isolate_page_range
-> recover to MT_ISOLATE
He observed a page block is remained isolated for a log time.
Change-Id: I933b5c1a281ee32f400d63913c52301bb01cb550
Reported-by: Jaewon Kim <jaewon31.kim@samsung.com>
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>