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
On Mon, 2 Feb 2009, Balbir Singh wrote:

> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index 8e4be9c..954b0d5 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -813,6 +813,25 @@ bool mem_cgroup_oom_called(struct task_struct *task)
> rcu_read_unlock();
> return ret;
> }
> +
> +void mem_cgroup_print_mem_info(struct mem_cgroup *memcg)
> +{
> + if (!memcg)
> + return;
> +
> + printk(KERN_WARNING "Memory cgroups's name %s\n",
> + memcg->css.cgroup->dentry->d_name.name);
> + printk(KERN_WARNING "Cgroup memory: usage %llu, limit %llu"
> + " failcnt %llu\n", res_counter_read_u64(&memcg->res, RES_USAGE),
> + res_counter_read_u64(&memcg->res, RES_LIMIT),
> + res_counter_read_u64(&memcg->res, RES_FAILCNT));
> + printk(KERN_WARNING "Cgroup memory+swap: usage %llu, limit %llu "
> + "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.

I think you'd want a less critical log level for these messages such as
KERN_INFO.


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