From: Michal Hocko <mhocko@kernel.org>
To: Johannes Weiner <hannes@cmpxchg.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Mel Gorman <mgorman@techsingularity.net>,
bugzilla-daemon@bugzilla.kernel.org, linux-mm@kvack.org,
marmarek@mimuw.edu.pl, 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: Wed, 30 Nov 2016 19:30:17 +0100 [thread overview]
Message-ID: <20161130183016.GO18432@dhcp22.suse.cz> (raw)
In-Reply-To: <20161130181653.GA30558@cmpxchg.org>
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.
> What do you think, Vladimir?
--
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-11-30 18:30 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 [this message]
2016-12-01 0:33 ` Balbir Singh
2016-12-01 2:24 ` Marek Marczykowski-Górecki
2016-12-01 7:02 ` Michal Hocko
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=20161130183016.GO18432@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).