aboutsummaryrefslogtreecommitdiff
path: root/mm/vmscan.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/vmscan.c')
-rw-r--r--mm/vmscan.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c
index d96e18726751..4dbfa8dcb8dc 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -2645,15 +2645,14 @@ static void shrink_node_memcgs(pg_data_t *pgdat, struct scan_control *sc)
unsigned long reclaimed;
unsigned long scanned;
- mem_cgroup_calculate_protection(target_memcg, memcg);
-
- if (mem_cgroup_below_min(memcg)) {
+ switch (mem_cgroup_protected(target_memcg, memcg)) {
+ case MEMCG_PROT_MIN:
/*
* Hard protection.
* If there is no reclaimable memory, OOM.
*/
continue;
- } else if (mem_cgroup_below_low(memcg)) {
+ case MEMCG_PROT_LOW:
/*
* Soft protection.
* Respect the protection only as long as
@@ -2665,6 +2664,16 @@ static void shrink_node_memcgs(pg_data_t *pgdat, struct scan_control *sc)
continue;
}
memcg_memory_event(memcg, MEMCG_LOW);
+ break;
+ case MEMCG_PROT_NONE:
+ /*
+ * All protection thresholds breached. We may
+ * still choose to vary the scan pressure
+ * applied based on by how much the cgroup in
+ * question has exceeded its protection
+ * thresholds (see get_scan_count).
+ */
+ break;
}
reclaimed = sc->nr_reclaimed;