consider swap space when we decide compaction goes or not
Subsystems (3)
PATCH 1/1 consider swap space when we decide compaction goes or not
It's pointless to go reclaiming when we have no swap space and lots of anon pages in inactive list.
Cc KOSAKI Motohiro <[email protected]>
Cc Mel Gorman <[email protected]>
Cc Rik van Riel <[email protected]>
Cc Johannes Weiner <[email protected]>
Cc Andrea Arcangeli <[email protected]>
Signed-off-by Minchan Kim <[email protected]>
--- mm/vmscan.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)
mm/vmscan.c +3 -2
@@ -2015,8 +2015,9 @@ static inline bool should_continue_reclaim(struct zone *zone,* inactive lists are large enough, continue reclaiming */ pages_for_compaction = (2UL << sc->order); - inactive_lru_pages =zone_nr_lru_pages (zone, sc,LRU_INACTIVE_ANON ) + -zone_nr_lru_pages (zone, sc,LRU_INACTIVE_FILE ); + inactive_lru_pages =zone_nr_lru_pages (zone, sc,LRU_INACTIVE_FILE ); +if (nr_swap_pages >0 ) + inactive_lru_pages +=zone_nr_lru_pages (zone, sc,LRU_INACTIVE_ANON );if (sc->nr_reclaimed < pages_for_compaction && inactive_lru_pages > pages_for_compaction)return true;
Signature · 8 lines
1.7.6.4 -- 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 19 lines · Minchan Kim
It's pointless to go reclaiming when we have no swap space and lots of anon pages in inactive list.
Cc KOSAKI Motohiro <[email protected]>Cc Mel Gorman <[email protected]>Cc Rik van Riel <[email protected]>Cc Johannes Weiner <[email protected]>Cc Andrea Arcangeli <[email protected]>Signed-off-by Minchan Kim <[email protected]>--- mm/vmscan.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)mm/vmscan.c +0
-0@@ -2015,8 +2015,9 @@ static inline bool should_continue_reclaim(struct zone *zone,* inactive lists are large enough, continue reclaiming
mm/vmscan.c static inline bool should_continue_reclaim(struct zone *zone, · line 2023
Quoted 10 lines
mm/vmscan.c +3
-2*/ pages_for_compaction = (2UL << sc->order); - inactive_lru_pages =zone_nr_lru_pages (zone, sc,LRU_INACTIVE_ANON ) + -zone_nr_lru_pages (zone, sc,LRU_INACTIVE_FILE ); + inactive_lru_pages =zone_nr_lru_pages (zone, sc,LRU_INACTIVE_FILE ); +if (nr_swap_pages >0 ) + inactive_lru_pages +=zone_nr_lru_pages (zone, sc,LRU_INACTIVE_ANON );if (sc->nr_reclaimed < pages_for_compaction && inactive_lru_pages > pages_for_compaction)return true;
The changelog does not win a prize for detail but it makes sense. Without this patch, it is possible when swap is disabled to continue trying to reclaim when there are only anonymous page in the system even though that will not make any progress.
Acked-by Mel Gorman <[email protected]>
Signature · 9 lines
Mel Gorman SUSE Labs -- 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 9 lines · Minchan Kim
It's pointless to go reclaiming when we have no swap space and lots of anon pages in inactive list.
Cc KOSAKI Motohiro<[email protected]>Cc Mel Gorman<[email protected]>Cc Rik van Riel<[email protected]>Cc Johannes Weiner<[email protected]>Cc Andrea Arcangeli<[email protected]>Signed-off-by Minchan Kim<[email protected]>
Reviewed-by Rik van Riel <[email protected]>
Signature · 8 lines
All rights reversed -- 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>