Re: [patch] mm, memcg: store memcg name for oom kill log consistency

From: Michal Hocko
Date: Thu Sep 05 2013 - 09:52:40 EST


On Thu 29-08-13 15:30:32, Michal Hocko wrote:
> On Wed 28-08-13 23:03:54, David Rientjes wrote:
> > A shared buffer is currently used for the name of the oom memcg and the
> > memcg of the killed process. There is no serialization of memcg oom
> > kills, so this buffer can easily be overwritten if there is a concurrent
> > oom kill in another memcg.
>
> Right.
>
> > This patch stores the names of the memcgs directly in struct mem_cgroup.
>
> I do not like to make every mem_cgroup larger even if it never sees an
> OOM.
>
> Wouldn't it be much easier to add a new lock (memcg_oom_info_lock) inside
> mem_cgroup_print_oom_info instead? This would have a nice side effect
> that parallel memcg oom kill messages wouldn't interleave.

What about the following?
---