lkml.org 
[lkml]   [2009]   [Feb]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [-mm patch] Show memcg information during OOM
    > +void mem_cgroup_print_mem_info(struct mem_cgroup *memcg)
    > +{
    > + printk(KERN_WARNING "Memory cgroups's name %s\n",
    > + memcg->css.cgroup->dentry->d_name.name);
    > + printk(KERN_WARNING "Memory cgroup RSS : usage %llu, limit %llu"
    > + " failcnt %llu\n", res_counter_read_u64(&memcg->res, RES_USAGE),

    ", failcnt %llu\n" ?

    > + res_counter_read_u64(&memcg->res, RES_LIMIT),
    > + res_counter_read_u64(&memcg->res, RES_FAILCNT));
    > + printk(KERN_WARNING "Memory cgroup swap: usage %llu, limit %llu "
    > + "failcnt %llu\n",

    ", failcnt %llu\n" ?

    > + res_counter_read_u64(&memcg->memsw, RES_USAGE),
    > + res_counter_read_u64(&memcg->memsw, RES_LIMIT),
    > + res_counter_read_u64(&memcg->memsw, RES_FAILCNT));
    > +}
    > +
    > /*
    > * Unlike exported interface, "oom" parameter is added. if oom==true,
    > * oom-killer can be invoked.
    > diff --git a/mm/oom_kill.c b/mm/oom_kill.c
    > index d3b9bac..b8e53ae 100644
    > --- a/mm/oom_kill.c
    > +++ b/mm/oom_kill.c
    > @@ -392,6 +392,7 @@ static int oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order,
    > current->comm, gfp_mask, order, current->oomkilladj);
    > task_lock(current);
    > cpuset_print_task_mems_allowed(current);
    > + mem_cgroup_print_mem_info(mem);

    I think this can be put outside the task lock. The lock is used to call task_cs() safely in
    cpuset_print_task_mems_allowed().

    > task_unlock(current);
    > dump_stack();
    > show_mem();
    >


    \
     
     \ /
      Last update: 2009-02-03 02:33    [W:4.133 / U:0.116 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site