From: Michal Hocko <mhocko@kernel.org>
To: "Marek Marczykowski-Górecki" <marmarek@mimuw.edu.pl>
Cc: Johannes Weiner <hannes@cmpxchg.org>,
Andrew Morton <akpm@linux-foundation.org>,
Mel Gorman <mgorman@techsingularity.net>,
bugzilla-daemon@bugzilla.kernel.org, linux-mm@kvack.org,
Vladimir Davydov <vdavydov.dev@gmail.com>
Subject: Re: [Bug 189181] New: BUG: unable to handle kernel NULL pointer dereference in mem_cgroup_node_nr_lru_pages
Date: Thu, 1 Dec 2016 08:02:13 +0100 [thread overview]
Message-ID: <20161201070213.GA18272@dhcp22.suse.cz> (raw)
In-Reply-To: <20161201022454.GB21693@mail-personal>
On Thu 01-12-16 03:24:54, Marek Marczykowski-Gorecki wrote:
> On Wed, Nov 30, 2016 at 07:30:17PM +0100, Michal Hocko wrote:
> > On Wed 30-11-16 13:16:53, Johannes Weiner wrote:
> > > Hi Michael,
> > >
> > > On Wed, Nov 30, 2016 at 06:00:40PM +0100, Michal Hocko wrote:
> > [...]
> > > > diff --git a/mm/workingset.c b/mm/workingset.c
> > > > index 617475f529f4..0f07522c5c0e 100644
> > > > --- a/mm/workingset.c
> > > > +++ b/mm/workingset.c
> > > > @@ -348,7 +348,7 @@ static unsigned long count_shadow_nodes(struct shrinker *shrinker,
> > > > shadow_nodes = list_lru_shrink_count(&workingset_shadow_nodes, sc);
> > > > local_irq_enable();
> > > >
> > > > - if (memcg_kmem_enabled()) {
> > > > + if (memcg_kmem_enabled() && sc->memcg) {
> > > > pages = mem_cgroup_node_nr_lru_pages(sc->memcg, sc->nid,
> > > > LRU_ALL_FILE);
> > > > } else {
> > >
> > > If we do that, I'd remove the racy memcg_kmem_enabled() check
> > > altogether and just check for whether we have a memcg or not.
> >
> > But that would make this a memcg aware shrinker even when kmem is not
> > enabled...
> >
> > But now that I am looking into the code
> > shrink_slab:
> > if (memcg_kmem_enabled() &&
> > !!memcg != !!(shrinker->flags & SHRINKER_MEMCG_AWARE))
> > continue;
> >
> > this should be taken care of already. So sc->memcg should be indeed
> > sufficient. So unless I am missing something I will respin my local
> > patch and post it later after the reporter has some time to test the
> > current one.
>
> The above patch seems to help. At least the problem haven't occurred for
> the last ~40 VM startups.
I will consider this as
Tested-by: Marek Marczykowski-Gorecki <marmarek@mimuw.edu.pl>
OK? Thanks for the report and testing!
--
Michal Hocko
SUSE Labs
--
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>
next prev parent reply other threads:[~2016-12-01 7:02 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <bug-189181-27@https.bugzilla.kernel.org/>
2016-11-29 22:56 ` [Bug 189181] New: BUG: unable to handle kernel NULL pointer dereference in mem_cgroup_node_nr_lru_pages Andrew Morton
2016-11-30 17:00 ` Michal Hocko
2016-11-30 18:16 ` Johannes Weiner
2016-11-30 18:30 ` Michal Hocko
2016-12-01 0:33 ` Balbir Singh
2016-12-01 2:24 ` Marek Marczykowski-Górecki
2016-12-01 7:02 ` Michal Hocko [this message]
2016-12-01 10:58 ` Marek Marczykowski-Górecki
2016-12-01 10:07 ` Vladimir Davydov
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=20161201070213.GA18272@dhcp22.suse.cz \
--to=mhocko@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=bugzilla-daemon@bugzilla.kernel.org \
--cc=hannes@cmpxchg.org \
--cc=linux-mm@kvack.org \
--cc=marmarek@mimuw.edu.pl \
--cc=mgorman@techsingularity.net \
--cc=vdavydov.dev@gmail.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;
as well as URLs for NNTP newsgroup(s).