From: Michal Hocko <mhocko-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Johannes Weiner <hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
Cc: Brad Bolen <bradleybolen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Jaegeuk Kim <jaegeuk-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Andrew Morton
<akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>,
Vladimir Davydov
<vdavydov.dev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org,
cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: kernel panic on null pointer on page->mem_cgroup
Date: Mon, 21 Aug 2017 15:23:45 +0200 [thread overview]
Message-ID: <20170821132345.GK25956@dhcp22.suse.cz> (raw)
In-Reply-To: <20170821130218.GA1371-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
On Mon 21-08-17 09:02:18, Johannes Weiner wrote:
> On Thu, Aug 10, 2017 at 01:56:05PM +0200, Michal Hocko wrote:
> > On Wed 09-08-17 14:38:25, Johannes Weiner wrote:
> > > The issue is that writeback doesn't hold a page reference and the page
> > > might get freed after PG_writeback is cleared (and the mapping is
> > > unlocked) in test_clear_page_writeback(). The stat functions looking
> > > up the page's node or zone are safe, as those attributes are static
> > > across allocation and free cycles. But page->mem_cgroup is not, and it
> > > will get cleared if we race with truncation or migration.
> >
> > Is there anything that prevents us from holding a reference on a page
> > under writeback?
>
> Hm, I'm hesitant to add redundant life-time management to the page
> there just for memcg, which is not always configured in.
>
> Pinning the memcg instead is slightly more complex, but IMO has the
> complexity in a preferrable place.
If that is the single place that needs such a special handling and it is
very likely to stay that way then the additional complexity is probably
justified. I am just worried that this is really subtle and history
tells us that such a code usually kicks us back later.
> Would you agree?
Well, I was not objecting to the patch. It seems correct I am just
worried a robust fix would be preferable. And a clear object life time
sounds like a more robust thing to do.
--
Michal Hocko
SUSE Labs
next prev parent reply other threads:[~2017-08-21 13:23 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20170805155241.GA94821@jaegeuk-macbookpro.roam.corp.google.com>
[not found] ` <20170808010150.4155-1-bradleybolen@gmail.com>
2017-08-08 16:21 ` kernel panic on null pointer on page->mem_cgroup Johannes Weiner
[not found] ` <20170808162122.GA14689-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
2017-08-08 16:56 ` Jaegeuk Kim
[not found] ` <20170808165601.GA7693-Bkjb4tF/BptrGMd72DVhOyZ7yTyXFdtBkQQo+JxHRPFibQn6LdNjmg@public.gmane.org>
2017-08-08 17:37 ` Johannes Weiner
[not found] ` <20170808173704.GA22887-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
2017-08-08 19:13 ` Brad Bolen
2017-08-08 20:08 ` Johannes Weiner
2017-08-09 1:44 ` Jaegeuk Kim
[not found] ` <20170809014459.GB7693-Bkjb4tF/BptrGMd72DVhOyZ7yTyXFdtBkQQo+JxHRPFibQn6LdNjmg@public.gmane.org>
2017-08-09 2:39 ` Brad Bolen
2017-08-09 18:38 ` Johannes Weiner
2017-08-10 11:56 ` Michal Hocko
2017-08-21 13:02 ` Johannes Weiner
[not found] ` <20170821130218.GA1371-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
2017-08-21 13:23 ` Michal Hocko [this message]
2017-08-10 13:50 ` Brad Bolen
2017-08-11 1:30 ` Brad Bolen
2017-08-11 21:37 ` Jaegeuk Kim
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=20170821132345.GK25956@dhcp22.suse.cz \
--to=mhocko-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
--cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
--cc=bradleybolen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org \
--cc=jaegeuk-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org \
--cc=vdavydov.dev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.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