lkml.org 
[lkml]   [2015]   [Jan]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[patch] mm: memcontrol: default hierarchy interface for memory fix - high reclaim
Date
High limit reclaim can currently overscan in proportion to how many
charges are happening concurrently. Tone it down such that charges
don't target the entire high-boundary excess, but instead only the
pages they charged themselves when excess is detected.

Reported-by: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
---
mm/memcontrol.c | 16 +++++-----------
1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 323a01fa1833..7adccee9fecb 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -2348,19 +2348,13 @@ done_restock:
refill_stock(memcg, batch - nr_pages);
/*
* If the hierarchy is above the normal consumption range,
- * make the charging task trim the excess.
+ * make the charging task trim their excess contribution.
*/
do {
- unsigned long nr_pages = page_counter_read(&memcg->memory);
- unsigned long high = ACCESS_ONCE(memcg->high);
-
- if (nr_pages > high) {
- mem_cgroup_events(memcg, MEMCG_HIGH, 1);
-
- try_to_free_mem_cgroup_pages(memcg, nr_pages - high,
- gfp_mask, true);
- }
-
+ if (page_counter_read(&memcg->memory) <= memcg->high)
+ continue;
+ mem_cgroup_events(memcg, MEMCG_HIGH, 1);
+ try_to_free_mem_cgroup_pages(memcg, nr_pages, gfp_mask, true);
} while ((memcg = parent_mem_cgroup(memcg)));
done:
return ret;
--
2.2.0


\
 
 \ /
  Last update: 2015-01-17 16:41    [W:2.302 / U:0.316 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site