[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20171005075757.ziyj7kyzyrx7ghd6@dhcp22.suse.cz>
Date: Thu, 5 Oct 2017 09:57:57 +0200
From: Michal Hocko <mhocko@...nel.org>
To: Yang Shi <yang.s@...baba-inc.com>
Cc: cl@...ux.com, penberg@...nel.org, rientjes@...gle.com,
iamjoonsoo.kim@....com, akpm@...ux-foundation.org,
linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/3] mm: oom: show unreclaimable slab info when
unreclaimable slabs > user memory
On Thu 05-10-17 02:08:48, Yang Shi wrote:
>
>
> On 10/4/17 7:27 AM, Michal Hocko wrote:
> > On Wed 04-10-17 02:06:17, Yang Shi wrote:
> > > +static bool is_dump_unreclaim_slabs(void)
> > > +{
> > > + unsigned long nr_lru;
> > > +
> > > + nr_lru = global_node_page_state(NR_ACTIVE_ANON) +
> > > + global_node_page_state(NR_INACTIVE_ANON) +
> > > + global_node_page_state(NR_ACTIVE_FILE) +
> > > + global_node_page_state(NR_INACTIVE_FILE) +
> > > + global_node_page_state(NR_ISOLATED_ANON) +
> > > + global_node_page_state(NR_ISOLATED_FILE) +
> > > + global_node_page_state(NR_UNEVICTABLE);
> > > +
> > > + return (global_node_page_state(NR_SLAB_UNRECLAIMABLE) > nr_lru);
> > > +}
> >
> > I am sorry I haven't pointed this earlier (I was following only half
> > way) but this should really be memcg aware. You are checking only global
> > counters. I do not think it is an absolute must to provide per-memcg
> > data but you should at least check !is_memcg_oom(oc).
>
> BTW, I saw there is already such check in dump_header that looks like the
> below code:
>
> if (oc->memcg)
> mem_cgroup_print_oom_info(oc->memcg, p);
> else
> show_mem(SHOW_MEM_FILTER_NODES, oc->nodemask);
>
> I'm supposed it'd better to replace "oc->memcg" to "is_memcg_oom(oc)" since
> they do the same check and "is_memcg_oom" interface sounds preferable.
Yes, is_memcg_oom is better
> Then I'm going to move unreclaimable slabs dump to the "else" block.
makes sense.
--
Michal Hocko
SUSE Labs
Powered by blists - more mailing lists