From: Vladimir Davydov <vdavydov@parallels.com>
To: Johannes Weiner <hannes@cmpxchg.org>
Cc: linux-mm@kvack.org, Michal Hocko <mhocko@suse.cz>,
Greg Thelen <gthelen@google.com>, Tejun Heo <tj@kernel.org>,
cgroups@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [patch 3/3] mm: memcontrol: continue cache reclaim from offlined groups
Date: Mon, 22 Sep 2014 12:32:04 +0400 [thread overview]
Message-ID: <20140922083204.GC18526@esperanza> (raw)
In-Reply-To: <1411243235-24680-4-git-send-email-hannes@cmpxchg.org>
On Sat, Sep 20, 2014 at 04:00:35PM -0400, Johannes Weiner wrote:
> On cgroup deletion, outstanding page cache charges are moved to the
> parent group so that they're not lost and can be reclaimed during
> pressure on/inside said parent. But this reparenting is fairly tricky
> and its synchroneous nature has led to several lock-ups in the past.
>
> Since css iterators now also include offlined css, memcg iterators can
> be changed to include offlined children during reclaim of a group, and
> leftover cache can just stay put.
>
> There is a slight change of behavior in that charges of deleted groups
> no longer show up as local charges in the parent. But they are still
> included in the parent's hierarchical statistics.
>
> Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
> ---
> mm/memcontrol.c | 260 ++------------------------------------------------------
> 1 file changed, 5 insertions(+), 255 deletions(-)
>
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index 019a44ac25d6..48531433a2fc 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -736,8 +736,6 @@ static void disarm_static_keys(struct mem_cgroup *memcg)
> disarm_kmem_keys(memcg);
> }
>
> -static void drain_all_stock_async(struct mem_cgroup *memcg);
> -
> static struct mem_cgroup_per_zone *
> mem_cgroup_zone_zoneinfo(struct mem_cgroup *memcg, struct zone *zone)
> {
> @@ -1208,7 +1206,7 @@ struct mem_cgroup *mem_cgroup_iter(struct mem_cgroup *root,
> goto out_unlock;
> continue;
> }
> - if (css == &root->css || css_tryget_online(css)) {
> + if (css == &root->css || css_tryget(css)) {
> memcg = mem_cgroup_from_css(css);
> break;
> }
> @@ -2349,10 +2347,12 @@ static void refill_stock(struct mem_cgroup *memcg, unsigned int nr_pages)
> * of the hierarchy under it. sync flag says whether we should block
Please update the comment.
> * until the work is done.
> */
> -static void drain_all_stock(struct mem_cgroup *root_memcg, bool sync)
> +static void drain_all_stock(struct mem_cgroup *root_memcg)
> {
> int cpu, curcpu;
>
> + if (!mutex_trylock(&percpu_charge_mutex))
> + return;
It's not obvious why we need it here. The old code has an explanatory
comment. Could you please add one?
Thanks,
Vladimir
--
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>
WARNING: multiple messages have this Message-ID (diff)
From: Vladimir Davydov <vdavydov@parallels.com>
To: Johannes Weiner <hannes@cmpxchg.org>
Cc: <linux-mm@kvack.org>, Michal Hocko <mhocko@suse.cz>,
Greg Thelen <gthelen@google.com>, Tejun Heo <tj@kernel.org>,
<cgroups@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [patch 3/3] mm: memcontrol: continue cache reclaim from offlined groups
Date: Mon, 22 Sep 2014 12:32:04 +0400 [thread overview]
Message-ID: <20140922083204.GC18526@esperanza> (raw)
In-Reply-To: <1411243235-24680-4-git-send-email-hannes@cmpxchg.org>
On Sat, Sep 20, 2014 at 04:00:35PM -0400, Johannes Weiner wrote:
> On cgroup deletion, outstanding page cache charges are moved to the
> parent group so that they're not lost and can be reclaimed during
> pressure on/inside said parent. But this reparenting is fairly tricky
> and its synchroneous nature has led to several lock-ups in the past.
>
> Since css iterators now also include offlined css, memcg iterators can
> be changed to include offlined children during reclaim of a group, and
> leftover cache can just stay put.
>
> There is a slight change of behavior in that charges of deleted groups
> no longer show up as local charges in the parent. But they are still
> included in the parent's hierarchical statistics.
>
> Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
> ---
> mm/memcontrol.c | 260 ++------------------------------------------------------
> 1 file changed, 5 insertions(+), 255 deletions(-)
>
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index 019a44ac25d6..48531433a2fc 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -736,8 +736,6 @@ static void disarm_static_keys(struct mem_cgroup *memcg)
> disarm_kmem_keys(memcg);
> }
>
> -static void drain_all_stock_async(struct mem_cgroup *memcg);
> -
> static struct mem_cgroup_per_zone *
> mem_cgroup_zone_zoneinfo(struct mem_cgroup *memcg, struct zone *zone)
> {
> @@ -1208,7 +1206,7 @@ struct mem_cgroup *mem_cgroup_iter(struct mem_cgroup *root,
> goto out_unlock;
> continue;
> }
> - if (css == &root->css || css_tryget_online(css)) {
> + if (css == &root->css || css_tryget(css)) {
> memcg = mem_cgroup_from_css(css);
> break;
> }
> @@ -2349,10 +2347,12 @@ static void refill_stock(struct mem_cgroup *memcg, unsigned int nr_pages)
> * of the hierarchy under it. sync flag says whether we should block
Please update the comment.
> * until the work is done.
> */
> -static void drain_all_stock(struct mem_cgroup *root_memcg, bool sync)
> +static void drain_all_stock(struct mem_cgroup *root_memcg)
> {
> int cpu, curcpu;
>
> + if (!mutex_trylock(&percpu_charge_mutex))
> + return;
It's not obvious why we need it here. The old code has an explanatory
comment. Could you please add one?
Thanks,
Vladimir
next prev parent reply other threads:[~2014-09-22 8:32 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-20 20:00 [patch 0/3] mm: memcontrol: eliminate charge reparenting Johannes Weiner
2014-09-20 20:00 ` Johannes Weiner
2014-09-20 20:00 ` [patch 1/3] mm: memcontrol: take a css reference for each charged page Johannes Weiner
2014-09-20 20:00 ` Johannes Weiner
2014-09-22 8:24 ` Vladimir Davydov
2014-09-22 8:24 ` Vladimir Davydov
[not found] ` <1411243235-24680-2-git-send-email-hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
2014-10-08 13:27 ` Michal Hocko
2014-10-08 13:27 ` Michal Hocko
2014-10-08 13:27 ` Michal Hocko
2014-10-08 13:29 ` Michal Hocko
2014-10-08 13:29 ` Michal Hocko
2014-09-20 20:00 ` [patch 2/3] mm: memcontrol: remove obsolete kmemcg pinning tricks Johannes Weiner
2014-09-20 20:00 ` Johannes Weiner
[not found] ` <1411243235-24680-3-git-send-email-hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
2014-09-22 8:25 ` Vladimir Davydov
2014-09-22 8:25 ` Vladimir Davydov
2014-09-22 8:25 ` Vladimir Davydov
2014-10-08 13:32 ` Michal Hocko
2014-10-08 13:32 ` Michal Hocko
2014-09-20 20:00 ` [patch 3/3] mm: memcontrol: continue cache reclaim from offlined groups Johannes Weiner
2014-09-20 20:00 ` Johannes Weiner
2014-09-22 8:32 ` Vladimir Davydov [this message]
2014-09-22 8:32 ` Vladimir Davydov
2014-10-08 14:03 ` Michal Hocko
2014-10-08 14:03 ` Michal Hocko
2014-09-21 15:50 ` [patch 0/3] mm: memcontrol: eliminate charge reparenting Vladimir Davydov
2014-09-21 15:50 ` Vladimir Davydov
[not found] ` <1411243235-24680-1-git-send-email-hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
2014-10-08 12:48 ` Michal Hocko
2014-10-08 12:48 ` Michal Hocko
2014-10-08 12:48 ` Michal Hocko
2014-10-08 14:17 ` Johannes Weiner
2014-10-08 14:17 ` Johannes Weiner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140922083204.GC18526@esperanza \
--to=vdavydov@parallels.com \
--cc=cgroups@vger.kernel.org \
--cc=gthelen@google.com \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.cz \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.