mm/compation.c: checking page in lru twice
Subsystems (2)
PATCH 1/1 mm/compation.c: checking page in lru twice
in isolate_migratepages() have check page in LRU twice, the next one at _isolate_lru_page().
---
mm/compaction.c | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
mm/compaction.c +0 -3
@@ -321,9 +321,6 @@ static unsigned long isolate_migratepages(struct zone *zone,continue ; } -if (!PageLRU (page)) -continue ; -/* * PageLRU is set, and lru_lock excludes isolation, * splitting and collapsing (collapsing has already
--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 5 lines · Figo.zhang
in
isolate_migratepages()have check page in LRU twice, the next one at_isolate_lru_page().Signed-off-by Figo.zhang <[email protected]>
Not checking for PageLRU means that PageTransHuge() gets called for each page. While the scanner is active and the lock released, a transparent hugepage can be created and potentially we test PageTransHuge() on a tail page. This will trigger a BUG if CONFIG_DEBUG_VM is set.
Quoted 20 lines
mm/compaction.c| 3 ---1 files changed, 0 insertions(+), 3 deletions(-)mm/compaction.c +0
-3@@ -321,9 +321,6 @@ static unsigned long isolate_migratepages(struct zone *zone,continue ; } -if (!PageLRU (page)) -continue ; -/* * PageLRU is set, and lru_lock excludes isolation, * splitting and collapsing (collapsing has already
Signature · 2 lines
Mel Gorman SUSE Labs
Quoted 5 lines · Mel Gorman
Quoted 4 lines · Figo.zhang
in
isolate_migratepages()have check page in LRU twice, the next one at_isolate_lru_page().
Quoted 7 lines
Quoted 1 line
Signed-off-by Figo.zhang <[email protected]>Not checking for PageLRU means that
PageTransHuge()gets called for each page. While the scanner is active and the lock released, a transparent hugepage can be created and potentially we testPageTransHuge()on a tail page. This will trigger a BUG ifCONFIG_DEBUG_VMis set.
Agreed. The compound_order also would become unsafe even if it was initially an head page (if it's a compound page not in lru). And compound_trans_order isn't a solution either because we need to be head for it to be safe like you said, better not having to use compound_trans_order.
--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 3 lines · Figo.zhang
in
isolate_migratepages()have check page in LRU twice, the next one at_isolate_lru_page().
hugetlbfs or any other compound page won't have PageLRU set and they may go away from under us leading to compound_order not being reliable if we remove the PageLRU check before compound_order. So we need to verify the page is in LRU before running compound_order safely. And if we hold the lru_lock, the page won't be isolated under us, and we know it's not going to get splitted either.
We might use compound_trans_order but that's only reliable if run on the head page so it's not so reliable, and so far it's only used by memory-failure to "diminish" the risk of races in reading the compound order, but it's not the best having to use compound_trans_order (and memory-failure remains unsafe w.r.t to hugetlbfs being released during hwpoisoning, so compound_trans_order might have to be improved for it).
--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>