cgroups.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] mm: memcontrol: switch soft limit default back to infinity
@ 2014-12-28 18:47 Johannes Weiner
       [not found] ` <1419792468-9278-1-git-send-email-hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
  2014-12-29  8:42 ` Vladimir Davydov
  0 siblings, 2 replies; 3+ messages in thread
From: Johannes Weiner @ 2014-12-28 18:47 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Michal Hocko, Vladimir Davydov, Tejun Heo, linux-mm, cgroups,
	linux-kernel

3e32cb2e0a12 ("mm: memcontrol: lockless page counters") accidentally
switched the soft limit default from infinity to zero, which turns all
memcgs with even a single page into soft limit excessors and engages
soft limit reclaim on all of them during global memory pressure.  This
makes global reclaim generally more aggressive, but also inverts the
meaning of existing soft limit configurations where unset soft limits
are usually more generous than set ones.

Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
---
 mm/memcontrol.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index ef91e856c7e4..b7104a55ae64 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -4679,6 +4679,7 @@ mem_cgroup_css_alloc(struct cgroup_subsys_state *parent_css)
 	if (parent_css == NULL) {
 		root_mem_cgroup = memcg;
 		page_counter_init(&memcg->memory, NULL);
+		memcg->soft_limit = PAGE_COUNTER_MAX;
 		page_counter_init(&memcg->memsw, NULL);
 		page_counter_init(&memcg->kmem, NULL);
 	}
@@ -4724,6 +4725,7 @@ mem_cgroup_css_online(struct cgroup_subsys_state *css)
 
 	if (parent->use_hierarchy) {
 		page_counter_init(&memcg->memory, &parent->memory);
+		memcg->soft_limit = PAGE_COUNTER_MAX;
 		page_counter_init(&memcg->memsw, &parent->memsw);
 		page_counter_init(&memcg->kmem, &parent->kmem);
 
@@ -4733,6 +4735,7 @@ mem_cgroup_css_online(struct cgroup_subsys_state *css)
 		 */
 	} else {
 		page_counter_init(&memcg->memory, NULL);
+		memcg->soft_limit = PAGE_COUNTER_MAX;
 		page_counter_init(&memcg->memsw, NULL);
 		page_counter_init(&memcg->kmem, NULL);
 		/*
@@ -4807,7 +4810,7 @@ static void mem_cgroup_css_reset(struct cgroup_subsys_state *css)
 	mem_cgroup_resize_limit(memcg, PAGE_COUNTER_MAX);
 	mem_cgroup_resize_memsw_limit(memcg, PAGE_COUNTER_MAX);
 	memcg_update_kmem_limit(memcg, PAGE_COUNTER_MAX);
-	memcg->soft_limit = 0;
+	memcg->soft_limit = PAGE_COUNTER_MAX;
 }
 
 #ifdef CONFIG_MMU
-- 
2.2.0

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-12-29  8:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-28 18:47 [patch] mm: memcontrol: switch soft limit default back to infinity Johannes Weiner
     [not found] ` <1419792468-9278-1-git-send-email-hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
2014-12-29  8:22   ` Michal Hocko
2014-12-29  8:42 ` Vladimir Davydov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).