Skip to content

Commit

Permalink
vmscan: add newly swapped in pages to the inactive list
Browse files Browse the repository at this point in the history
Swapin_readahead can read in a lot of data that the processes in memory
never need.  Adding swap cache pages to the inactive list prevents them
from putting too much pressure on the working set.

This has the potential to help the programs that are already in memory,
but it could also be a disadvantage to processes that are trying to get
swapped in.

Signed-off-by: Rik van Riel <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Rik van Riel authored and torvalds committed Oct 20, 2008
1 parent 7e9cd48 commit c5fdae4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mm/swap_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ struct page *read_swap_cache_async(swp_entry_t entry, gfp_t gfp_mask,
/*
* Initiate read into locked page and return.
*/
lru_cache_add_active_anon(new_page);
lru_cache_add_anon(new_page);
swap_readpage(NULL, new_page);
return new_page;
}
Expand Down

0 comments on commit c5fdae4

Please sign in to comment.