From: Andrew Morton <akpm@linux-foundation.org>
To: Dmitry Osipenko <digetx@gmail.com>
Cc: Alex Shi <alex.shi@linux.alibaba.com>,
Johannes Weiner <hannes@cmpxchg.org>,
Shakeel Butt <shakeelb@google.com>, Roman Gushchin <guro@fb.com>,
Lorenzo Stoakes <lstoakes@gmail.com>,
Stephen Rothwell <sfr@canb.auug.org.au>,
Alexander Duyck <alexander.h.duyck@linux.intel.com>,
Yafang Shao <laoar.shao@gmail.com>,
Wei Yang <richard.weiyang@gmail.com>,
linux-kernel@vger.kernel.org,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] mm/memcg: bail out early when !memcg in mem_cgroup_lruvec
Date: Mon, 30 Nov 2020 12:19:56 -0800 [thread overview]
Message-ID: <20201130121956.d03efaa95d3112d0b91291d6@linux-foundation.org> (raw)
In-Reply-To: <67aacbba-7049-bee8-0ad4-ab4db588c841@gmail.com>
On Mon, 30 Nov 2020 22:44:11 +0300 Dmitry Osipenko <digetx@gmail.com> wrote:
> > From: Alex Shi <alex.shi@linux.alibaba.com>
> > Date: Wed, 25 Nov 2020 14:06:33 +0800
> > Subject: [PATCH v2] mm/memcg: bail out early when !memcg in mem_cgroup_lruvec
> >
> > Sometime, we use NULL memcg in mem_cgroup_lruvec(memcg, pgdat)
> > so we could get out early in the situation to avoid useless checking.
> >
> > Polished as Andrew Morton's suggestion.
> >
> > --- a/include/linux/memcontrol.h
> > +++ b/include/linux/memcontrol.h
> > @@ -610,20 +610,17 @@ mem_cgroup_nodeinfo(struct mem_cgroup *memcg, int nid)
> > static inline struct lruvec *mem_cgroup_lruvec(struct mem_cgroup *memcg,
> > struct pglist_data *pgdat)
> > {
> > - struct mem_cgroup_per_node *mz;
> > struct lruvec *lruvec;
> >
> > - if (mem_cgroup_disabled()) {
> > + if (mem_cgroup_disabled() || !memcg) {
> > lruvec = &pgdat->__lruvec;
> > - goto out;
> > - }
> > + } else {
> > + struct mem_cgroup_per_node *mz;
> >
> > - if (!memcg)
> > - memcg = root_mem_cgroup;
> > + mz = mem_cgroup_nodeinfo(memcg, pgdat->node_id);
> > + lruvec = &mz->lruvec;
> > + }
> >
> > - mz = mem_cgroup_nodeinfo(memcg, pgdat->node_id);
> > - lruvec = &mz->lruvec;
> > -out:
> > /*
> > * Since a node can be onlined after the mem_cgroup was created,
> > * we have to be prepared to initialize lruvec->pgdat here;
> >
>
> Hi,
>
> This patch causes a hard lock on one of my ARM32 devices using today's
> linux-next, please fix.
Thanks.
This is unexpected. I assume you've confirmed that reverting this
change from linux-next fixes things?
prev parent reply other threads:[~2020-11-30 20:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-27 3:08 Alex Shi
2020-11-28 4:02 ` Andrew Morton
2020-11-29 4:43 ` Alex Shi
2020-11-30 19:44 ` Dmitry Osipenko
2020-11-30 20:19 ` Andrew Morton [this message]
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=20201130121956.d03efaa95d3112d0b91291d6@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=alex.shi@linux.alibaba.com \
--cc=alexander.h.duyck@linux.intel.com \
--cc=digetx@gmail.com \
--cc=guro@fb.com \
--cc=hannes@cmpxchg.org \
--cc=laoar.shao@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lstoakes@gmail.com \
--cc=richard.weiyang@gmail.com \
--cc=sfr@canb.auug.org.au \
--cc=shakeelb@google.com \
/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
Powered by JetHome