diff for duplicates of <20140909145044.GA16027@cmpxchg.org> diff --git a/a/1.txt b/N1/1.txt index 044f29e..6bb6d6e 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -74,3 +74,47 @@ please double check that this is in fact a regression independent of Thanks! --- +>From 465c5caa0628d640c2493e9d849dc9a1f0b373a4 Mon Sep 17 00:00:00 2001 +From: Johannes Weiner <hannes@cmpxchg.org> +Date: Tue, 9 Sep 2014 09:25:20 -0400 +Subject: [patch] mm: memcontrol: do not track soft limit excess on the root + level + +Dave encounters res_counter lock contention from memcg_check_events() +when running a multi-threaded page fault benchmark in the root group. + +This lock is taken to maintain the tree of soft limit excessors, which +is used by global reclaim to prioritize excess groups. But that makes +no sense on the root level - parent to all other groups, and so all +this overhead is unnecessary. Skip it. + +[ The soft limit really shouldn't even be settable on the root level, + but it's been like that forever, so don't risk breaking dopy user + space over this now. ] + +Reported-by: Dave Hansen <dave@sr71.net> +Signed-off-by: Johannes Weiner <hannes@cmpxchg.org> +--- + mm/memcontrol.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/mm/memcontrol.c b/mm/memcontrol.c +index 085dc6d2f876..b4de17e4f267 100644 +--- a/mm/memcontrol.c ++++ b/mm/memcontrol.c +@@ -1013,10 +1013,11 @@ static void memcg_check_events(struct mem_cgroup *memcg, struct page *page) + /* threshold event is triggered in finer grain than soft limit */ + if (unlikely(mem_cgroup_event_ratelimit(memcg, + MEM_CGROUP_TARGET_THRESH))) { +- bool do_softlimit; ++ bool do_softlimit = false; + bool do_numainfo __maybe_unused; + +- do_softlimit = mem_cgroup_event_ratelimit(memcg, ++ if (!mem_cgroup_is_root(memcg)) ++ do_softlimit = mem_cgroup_event_ratelimit(memcg, + MEM_CGROUP_TARGET_SOFTLIMIT); + #if MAX_NUMNODES > 1 + do_numainfo = mem_cgroup_event_ratelimit(memcg, +-- +2.0.4 diff --git a/a/content_digest b/N1/content_digest index c9eb69a..69b2e84 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -95,6 +95,50 @@ "\n" "Thanks!\n" "\n" - --- + "---\n" + ">From 465c5caa0628d640c2493e9d849dc9a1f0b373a4 Mon Sep 17 00:00:00 2001\n" + "From: Johannes Weiner <hannes@cmpxchg.org>\n" + "Date: Tue, 9 Sep 2014 09:25:20 -0400\n" + "Subject: [patch] mm: memcontrol: do not track soft limit excess on the root\n" + " level\n" + "\n" + "Dave encounters res_counter lock contention from memcg_check_events()\n" + "when running a multi-threaded page fault benchmark in the root group.\n" + "\n" + "This lock is taken to maintain the tree of soft limit excessors, which\n" + "is used by global reclaim to prioritize excess groups. But that makes\n" + "no sense on the root level - parent to all other groups, and so all\n" + "this overhead is unnecessary. Skip it.\n" + "\n" + "[ The soft limit really shouldn't even be settable on the root level,\n" + " but it's been like that forever, so don't risk breaking dopy user\n" + " space over this now. ]\n" + "\n" + "Reported-by: Dave Hansen <dave@sr71.net>\n" + "Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>\n" + "---\n" + " mm/memcontrol.c | 5 +++--\n" + " 1 file changed, 3 insertions(+), 2 deletions(-)\n" + "\n" + "diff --git a/mm/memcontrol.c b/mm/memcontrol.c\n" + "index 085dc6d2f876..b4de17e4f267 100644\n" + "--- a/mm/memcontrol.c\n" + "+++ b/mm/memcontrol.c\n" + "@@ -1013,10 +1013,11 @@ static void memcg_check_events(struct mem_cgroup *memcg, struct page *page)\n" + " \t/* threshold event is triggered in finer grain than soft limit */\n" + " \tif (unlikely(mem_cgroup_event_ratelimit(memcg,\n" + " \t\t\t\t\t\tMEM_CGROUP_TARGET_THRESH))) {\n" + "-\t\tbool do_softlimit;\n" + "+\t\tbool do_softlimit = false;\n" + " \t\tbool do_numainfo __maybe_unused;\n" + " \n" + "-\t\tdo_softlimit = mem_cgroup_event_ratelimit(memcg,\n" + "+\t\tif (!mem_cgroup_is_root(memcg))\n" + "+\t\t\tdo_softlimit = mem_cgroup_event_ratelimit(memcg,\n" + " \t\t\t\t\t\tMEM_CGROUP_TARGET_SOFTLIMIT);\n" + " #if MAX_NUMNODES > 1\n" + " \t\tdo_numainfo = mem_cgroup_event_ratelimit(memcg,\n" + "-- \n" + 2.0.4 -be9348af6341146b3223ad7435a929626f9bd83f2432aa45c704677295e5c209 +043a7c395f42b881749ab4ae5f1a7d73946daba34bdb6b41f6f04d22c4e7de12
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.