Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1706932

Re: [v4 2/4] mm, oom: cgroup-aware OOM killer

From David Rientjes <rientjes@google.com>
Newsgroups linux.kernel
Subject Re: [v4 2/4] mm, oom: cgroup-aware OOM killer
Date 2017-08-09 01:10 +0200
Message-ID <uclNn-6X2-7@gated-at.bofh.it> (permalink)
References <u7v0Z-11L-9@gated-at.bofh.it> <u7YPn-38N-11@gated-at.bofh.it> <u9GOm-5h7-25@gated-at.bofh.it> <u9IQa-6Iq-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, 1 Aug 2017, Roman Gushchin wrote:

> > To the rest of the patch. I have to say I do not quite like how it is
> > implemented. I was hoping for something much simpler which would hook
> > into oom_evaluate_task. If a task belongs to a memcg with kill-all flag
> > then we would update the cumulative memcg badness (more specifically the
> > badness of the topmost parent with kill-all flag). Memcg will then
> > compete with existing self contained tasks (oom_badness will have to
> > tell whether points belong to a task or a memcg to allow the caller to
> > deal with it). But it shouldn't be much more complex than that.
> 
> I'm not sure, it will be any simpler. Basically I'm doing the same:
> the difference is that you want to iterate over tasks and for each
> task traverse the memcg tree, update per-cgroup oom score and find
> the corresponding memcg(s) with the kill-all flag. I'm doing the opposite:
> traverse the cgroup tree, and for each leaf cgroup iterate over processes.
> 
> Also, please note, that even without the kill-all flag the decision is made
> on per-cgroup level (except tasks in the root cgroup).
> 

I think your implementation is preferred and is actually quite simple to 
follow, and I would encourage you to follow through with it.  It has a 
similar implementation to what we have done for years to kill a process 
from a leaf memcg.

I did notice that oom_kill_memcg_victim() calls directly into 
__oom_kill_process(), however, so we lack the traditional oom killer 
output that shows memcg usage and potential tasklist.  I think we should 
still be dumping this information to the kernel log so that we can see a 
breakdown of charged memory.

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: [v4 2/4] mm, oom: cgroup-aware OOM killer Michal Hocko <mhocko@kernel.org> - 2017-08-01 17:00 +0200
  Re: [v4 2/4] mm, oom: cgroup-aware OOM killer Michal Hocko <mhocko@kernel.org> - 2017-08-01 19:10 +0200
    Re: [v4 2/4] mm, oom: cgroup-aware OOM killer Michal Hocko <mhocko@kernel.org> - 2017-08-02 09:30 +0200
      Re: [v4 2/4] mm, oom: cgroup-aware OOM killer Michal Hocko <mhocko@kernel.org> - 2017-08-03 15:10 +0200
  Re: [v4 2/4] mm, oom: cgroup-aware OOM killer David Rientjes <rientjes@google.com> - 2017-08-09 01:10 +0200

csiph-web