From: Baoquan He <bhe@redhat.com>
To: Michal Hocko <mhocko@kernel.org>
Cc: akpm@linux-foundation.org, tj@kernel.org,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH v2] memcg: Only record foreign writebacks with dirty pages when memcg is not disabled
Date: Tue, 24 Sep 2019 21:04:58 +0800 [thread overview]
Message-ID: <20190924130458.GB31919@MiWiFi-R3L-srv> (raw)
In-Reply-To: <20190924122747.GQ23050@dhcp22.suse.cz>
On 09/24/19 at 02:27pm, Michal Hocko wrote:
> On Tue 24-09-19 19:11:51, Baoquan He wrote:
> > diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> > index f3c15bb07cce..84e3fdb1ccb4 100644
> > --- a/mm/memcontrol.c
> > +++ b/mm/memcontrol.c
> > @@ -4317,6 +4317,9 @@ void mem_cgroup_track_foreign_dirty_slowpath(struct page *page,
> >
> > trace_track_foreign_dirty(page, wb);
> >
> > + if (mem_cgroup_disabled())
> > + return;
> > +
>
> This doesn't seem correct. We shouldn't even enter the slowpath with
> memcg disabled AFAIC. The check should be done at mem_cgroup_track_foreign_dirty
> level.
You mean the way in v1 patch, right? It's also fine to me.
I am worried about the case that memcg is enabled, the checking by
calling mem_cgroup_disabled() will lower efficiency. And it entering
into mem_cgroup_track_foreign_dirty_slowpath() should be a rare event.
Thanks
Baoquan
next prev parent reply other threads:[~2019-09-24 13:05 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-23 8:30 [PATCH] " Baoquan He
2019-09-23 8:42 ` Baoquan He
2019-09-24 11:11 ` [PATCH v2] " Baoquan He
2019-09-24 12:27 ` Michal Hocko
2019-09-24 13:04 ` Baoquan He [this message]
2019-09-24 13:16 ` Michal Hocko
2019-09-24 13:43 ` Baoquan He
2019-09-24 13:46 ` Michal Hocko
2019-09-24 14:19 ` [PATCH v3] " Baoquan He
2019-09-24 14:37 ` Michal Hocko
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=20190924130458.GB31919@MiWiFi-R3L-srv \
--to=bhe@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox