Commit 24d404dc10b903da271e943a0f6b032dcbd177d8

Authored by Johannes Weiner
Committed by Linus Torvalds
1 parent 70ecb3cb03

mm: memcontrol: switch soft limit default back to infinity

Commit 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>
Acked-by: Michal Hocko <mhocko@suse.cz>
Acked-by: Vladimir Davydov <vdavydov@parallels.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 1 changed file with 4 additions and 1 deletions Side-by-side Diff

... ... @@ -4679,6 +4679,7 @@
4679 4679 if (parent_css == NULL) {
4680 4680 root_mem_cgroup = memcg;
4681 4681 page_counter_init(&memcg->memory, NULL);
  4682 + memcg->soft_limit = PAGE_COUNTER_MAX;
4682 4683 page_counter_init(&memcg->memsw, NULL);
4683 4684 page_counter_init(&memcg->kmem, NULL);
4684 4685 }
... ... @@ -4724,6 +4725,7 @@
4724 4725  
4725 4726 if (parent->use_hierarchy) {
4726 4727 page_counter_init(&memcg->memory, &parent->memory);
  4728 + memcg->soft_limit = PAGE_COUNTER_MAX;
4727 4729 page_counter_init(&memcg->memsw, &parent->memsw);
4728 4730 page_counter_init(&memcg->kmem, &parent->kmem);
4729 4731  
... ... @@ -4733,6 +4735,7 @@
4733 4735 */
4734 4736 } else {
4735 4737 page_counter_init(&memcg->memory, NULL);
  4738 + memcg->soft_limit = PAGE_COUNTER_MAX;
4736 4739 page_counter_init(&memcg->memsw, NULL);
4737 4740 page_counter_init(&memcg->kmem, NULL);
4738 4741 /*
... ... @@ -4807,7 +4810,7 @@
4807 4810 mem_cgroup_resize_limit(memcg, PAGE_COUNTER_MAX);
4808 4811 mem_cgroup_resize_memsw_limit(memcg, PAGE_COUNTER_MAX);
4809 4812 memcg_update_kmem_limit(memcg, PAGE_COUNTER_MAX);
4810   - memcg->soft_limit = 0;
  4813 + memcg->soft_limit = PAGE_COUNTER_MAX;
4811 4814 }
4812 4815  
4813 4816 #ifdef CONFIG_MMU