Re: [PATCH 3/3] mm: oom: show unreclaimable slab info when unreclaimable slabs > user memory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]
  Powered by Linux