[PATCH] mmotm: memcg-mm-introduce-lowlimit-reclaim-fix.patch
From: Michal Hocko
Date: Fri May 02 2014 - 08:03:49 EST
Use reclaim eligibility rather than low_limit. Generic code doesn't
have to be aware of the reason why a group is not eligible.
---
mm/vmscan.c | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 8ecf323a1c81..f195a0db5fbb 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -2215,8 +2215,15 @@ static inline bool should_continue_reclaim(struct zone *zone,
}
}
+/**
+ * __shrink_zone - shrinks a given zone
+ *
+ * @zone: zone to shrink
+ * @sc: scan control with additional reclaim parameters
+ * @check_memcg_eligible: check each memcg whether it is eligible for reclaim
+ */
static unsigned __shrink_zone(struct zone *zone, struct scan_control *sc,
- bool follow_low_limit)
+ bool check_memcg_eligible)
{
unsigned long nr_reclaimed, nr_scanned;
unsigned nr_scanned_groups = 0;
@@ -2237,10 +2244,10 @@ static unsigned __shrink_zone(struct zone *zone, struct scan_control *sc,
struct lruvec *lruvec;
/*
- * Memcg might be under its low limit so we have to
- * skip it during the first reclaim round
+ * Memcg might be protected from the reclaim so we have
+ * to skip it during the first reclaim round
*/
- if (follow_low_limit &&
+ if (check_memcg_eligible &&
!mem_cgroup_reclaim_eligible(memcg, root)) {
/*
* It would be more optimal to skip the memcg
@@ -2289,8 +2296,8 @@ static void shrink_zone(struct zone *zone, struct scan_control *sc)
if (!__shrink_zone(zone, sc, true)) {
/*
* First round of reclaim didn't find anything to reclaim
- * because of low limit protection so try again and ignore
- * the low limit this time.
+ * because of the reclaim protection so try again and ignore
+ * reclaim eligibility of memcgs.
*/
__shrink_zone(zone, sc, false);
}
--
2.0.0.rc0
--
Michal Hocko
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/