lkml.org 
[lkml]   [2017]   [Oct]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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

\
 
 \ /
  Last update: 2017-10-05 11:14    [W:0.066 / U:0.260 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site