summaryrefslogtreecommitdiffstats
path: root/mm/vmscan.c
diff options
context:
space:
mode:
authorZhihui Zhang <zzhsuny@gmail.com>2015-06-24 19:56:42 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-06-24 20:49:42 -0400
commit95bbc0c7210a7397fec1cd219f896ca95bf29e3e (patch)
treea2dc0ec161c0d15d9393136384c0f2351793a66b /mm/vmscan.c
parentf012a84aff7a7f1d50b060e8b205ad68ffb86045 (diff)
mm: rename RECLAIM_SWAP to RECLAIM_UNMAP
The name SWAP implies that we are dealing with anonymous pages only. In fact, the original patch that introduced the min_unmapped_ratio logic was to fix an issue related to file pages. Rename it to RECLAIM_UNMAP to match what does. Historically, commit a6dc60f8975a ("vmscan: rename sc.may_swap to may_unmap") renamed .may_swap to .may_unmap, leaving RECLAIM_SWAP behind. commit 2e2e42598908 ("vmscan,memcg: reintroduce sc->may_swap") reintroduced .may_swap for memory controller. Signed-off-by: Zhihui Zhang <zzhsuny@gmail.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Mel Gorman <mel@csn.ul.ie> Cc: Rik van Riel <riel@redhat.com> Cc: Michal Hocko <mhocko@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/vmscan.c')
-rw-r--r--mm/vmscan.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c
index c627fa4c991f..19ef01e90ac4 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -3597,7 +3597,7 @@ int zone_reclaim_mode __read_mostly;
3597#define RECLAIM_OFF 0 3597#define RECLAIM_OFF 0
3598#define RECLAIM_ZONE (1<<0) /* Run shrink_inactive_list on the zone */ 3598#define RECLAIM_ZONE (1<<0) /* Run shrink_inactive_list on the zone */
3599#define RECLAIM_WRITE (1<<1) /* Writeout pages during reclaim */ 3599#define RECLAIM_WRITE (1<<1) /* Writeout pages during reclaim */
3600#define RECLAIM_SWAP (1<<2) /* Swap pages out during reclaim */ 3600#define RECLAIM_UNMAP (1<<2) /* Unmap pages during reclaim */
3601 3601
3602/* 3602/*
3603 * Priority for ZONE_RECLAIM. This determines the fraction of pages 3603 * Priority for ZONE_RECLAIM. This determines the fraction of pages
@@ -3639,12 +3639,12 @@ static long zone_pagecache_reclaimable(struct zone *zone)
3639 long delta = 0; 3639 long delta = 0;
3640 3640
3641 /* 3641 /*
3642 * If RECLAIM_SWAP is set, then all file pages are considered 3642 * If RECLAIM_UNMAP is set, then all file pages are considered
3643 * potentially reclaimable. Otherwise, we have to worry about 3643 * potentially reclaimable. Otherwise, we have to worry about
3644 * pages like swapcache and zone_unmapped_file_pages() provides 3644 * pages like swapcache and zone_unmapped_file_pages() provides
3645 * a better estimate 3645 * a better estimate
3646 */ 3646 */
3647 if (zone_reclaim_mode & RECLAIM_SWAP) 3647 if (zone_reclaim_mode & RECLAIM_UNMAP)
3648 nr_pagecache_reclaimable = zone_page_state(zone, NR_FILE_PAGES); 3648 nr_pagecache_reclaimable = zone_page_state(zone, NR_FILE_PAGES);
3649 else 3649 else
3650 nr_pagecache_reclaimable = zone_unmapped_file_pages(zone); 3650 nr_pagecache_reclaimable = zone_unmapped_file_pages(zone);
@@ -3675,15 +3675,15 @@ static int __zone_reclaim(struct zone *zone, gfp_t gfp_mask, unsigned int order)
3675 .order = order, 3675 .order = order,
3676 .priority = ZONE_RECLAIM_PRIORITY, 3676 .priority = ZONE_RECLAIM_PRIORITY,
3677 .may_writepage = !!(zone_reclaim_mode & RECLAIM_WRITE), 3677 .may_writepage = !!(zone_reclaim_mode & RECLAIM_WRITE),
3678 .may_unmap = !!(zone_reclaim_mode & RECLAIM_SWAP), 3678 .may_unmap = !!(zone_reclaim_mode & RECLAIM_UNMAP),
3679 .may_swap = 1, 3679 .may_swap = 1,
3680 }; 3680 };
3681 3681
3682 cond_resched(); 3682 cond_resched();
3683 /* 3683 /*
3684 * We need to be able to allocate from the reserves for RECLAIM_SWAP 3684 * We need to be able to allocate from the reserves for RECLAIM_UNMAP
3685 * and we also need to be able to write out pages for RECLAIM_WRITE 3685 * and we also need to be able to write out pages for RECLAIM_WRITE
3686 * and RECLAIM_SWAP. 3686 * and RECLAIM_UNMAP.
3687 */ 3687 */
3688 p->flags |= PF_MEMALLOC | PF_SWAPWRITE; 3688 p->flags |= PF_MEMALLOC | PF_SWAPWRITE;
3689 lockdep_set_current_reclaim_state(gfp_mask); 3689 lockdep_set_current_reclaim_state(gfp_mask);