mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-10-31 18:09:19 +00:00
mm: vmscan: improve comment on low-page cache handling
Fix comment style and elaborate on why anonymous memory is force-scanned when file cache runs low. Signed-off-by: Johannes Weiner <hannes@cmpxchg.org> Reviewed-by: Rik van Riel <riel@redhat.com> Acked-by: Mel Gorman <mgorman@suse.de> Reviewed-by: Michal Hocko <mhocko@suse.cz> Cc: Hugh Dickins <hughd@google.com> Cc: Satoru Moriya <satoru.moriya@hds.com> Cc: Simon Jeons <simon.jeons@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
10316b313c
commit
11d16c25bb
1 changed files with 7 additions and 5 deletions
12
mm/vmscan.c
12
mm/vmscan.c
|
@ -1713,13 +1713,15 @@ static void get_scan_count(struct lruvec *lruvec, struct scan_control *sc,
|
|||
file = get_lru_size(lruvec, LRU_ACTIVE_FILE) +
|
||||
get_lru_size(lruvec, LRU_INACTIVE_FILE);
|
||||
|
||||
/*
|
||||
* If it's foreseeable that reclaiming the file cache won't be
|
||||
* enough to get the zone back into a desirable shape, we have
|
||||
* to swap. Better start now and leave the - probably heavily
|
||||
* thrashing - remaining file pages alone.
|
||||
*/
|
||||
if (global_reclaim(sc)) {
|
||||
free = zone_page_state(zone, NR_FREE_PAGES);
|
||||
free = zone_page_state(zone, NR_FREE_PAGES);
|
||||
if (unlikely(file + free <= high_wmark_pages(zone))) {
|
||||
/*
|
||||
* If we have very few page cache pages, force-scan
|
||||
* anon pages.
|
||||
*/
|
||||
fraction[0] = 1;
|
||||
fraction[1] = 0;
|
||||
denominator = 1;
|
||||
|
|
Loading…
Reference in a new issue