aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
Diffstat (limited to 'mm')
-rw-r--r--mm/vmscan.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 9588973849d0..a8347b677e74 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -909,7 +909,8 @@ int isolate_lru_page(struct page *page)
909 * of reclaimed pages 909 * of reclaimed pages
910 */ 910 */
911static unsigned long shrink_inactive_list(unsigned long max_scan, 911static unsigned long shrink_inactive_list(unsigned long max_scan,
912 struct zone *zone, struct scan_control *sc, int file) 912 struct zone *zone, struct scan_control *sc,
913 int priority, int file)
913{ 914{
914 LIST_HEAD(page_list); 915 LIST_HEAD(page_list);
915 struct pagevec pvec; 916 struct pagevec pvec;
@@ -927,8 +928,19 @@ static unsigned long shrink_inactive_list(unsigned long max_scan,
927 unsigned long nr_freed; 928 unsigned long nr_freed;
928 unsigned long nr_active; 929 unsigned long nr_active;
929 unsigned int count[NR_LRU_LISTS] = { 0, }; 930 unsigned int count[NR_LRU_LISTS] = { 0, };
930 int mode = (sc->order > PAGE_ALLOC_COSTLY_ORDER) ? 931 int mode = ISOLATE_INACTIVE;
931 ISOLATE_BOTH : ISOLATE_INACTIVE; 932
933 /*
934 * If we need a large contiguous chunk of memory, or have
935 * trouble getting a small set of contiguous pages, we
936 * will reclaim both active and inactive pages.
937 *
938 * We use the same threshold as pageout congestion_wait below.
939 */
940 if (sc->order > PAGE_ALLOC_COSTLY_ORDER)
941 mode = ISOLATE_BOTH;
942 else if (sc->order && priority < DEF_PRIORITY - 2)
943 mode = ISOLATE_BOTH;
932 944
933 nr_taken = sc->isolate_pages(sc->swap_cluster_max, 945 nr_taken = sc->isolate_pages(sc->swap_cluster_max,
934 &page_list, &nr_scan, sc->order, mode, 946 &page_list, &nr_scan, sc->order, mode,
@@ -1172,7 +1184,7 @@ static unsigned long shrink_list(enum lru_list lru, unsigned long nr_to_scan,
1172 shrink_active_list(nr_to_scan, zone, sc, priority, file); 1184 shrink_active_list(nr_to_scan, zone, sc, priority, file);
1173 return 0; 1185 return 0;
1174 } 1186 }
1175 return shrink_inactive_list(nr_to_scan, zone, sc, file); 1187 return shrink_inactive_list(nr_to_scan, zone, sc, priority, file);
1176} 1188}
1177 1189
1178/* 1190/*