Skip to content

Commit fc280fe

Browse files
vwaxtorvalds
authored andcommitted
mm: prevent NR_ISOLATE_* stats from going negative
Commit 6afcf8e ("mm, compaction: fix NR_ISOLATED_* stats for pfn based migration") moved the dec_node_page_state() call (along with the page_is_file_cache() call) to after putback_lru_page(). But page_is_file_cache() can change after putback_lru_page() is called, so it should be called before putback_lru_page(), as it was before that patch, to prevent NR_ISOLATE_* stats from going negative. Without this fix, non-CONFIG_SMP kernels end up hanging in the while(too_many_isolated()) { congestion_wait() } loop in shrink_active_list() due to the negative stats. Mem-Info: active_anon:32567 inactive_anon:121 isolated_anon:1 active_file:6066 inactive_file:6639 isolated_file:4294967295 ^^^^^^^^^^ unevictable:0 dirty:115 writeback:0 unstable:0 slab_reclaimable:2086 slab_unreclaimable:3167 mapped:3398 shmem:18366 pagetables:1145 bounce:0 free:1798 free_pcp:13 free_cma:0 Fixes: 6afcf8e ("mm, compaction: fix NR_ISOLATED_* stats for pfn based migration") Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Rabin Vincent <[email protected]> Acked-by: Michal Hocko <[email protected]> Cc: Ming Ling <[email protected]> Cc: Minchan Kim <[email protected]> Cc: Vlastimil Babka <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent d34b073 commit fc280fe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/migrate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,9 @@ void putback_movable_pages(struct list_head *l)
184184
unlock_page(page);
185185
put_page(page);
186186
} else {
187-
putback_lru_page(page);
188187
dec_node_page_state(page, NR_ISOLATED_ANON +
189188
page_is_file_cache(page));
189+
putback_lru_page(page);
190190
}
191191
}
192192
}

0 commit comments

Comments
 (0)