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


Groups > linux.kernel > #1432365

Re: [PATCH v2] mm: oom: deduplicate victim selection code for memcg and global oom

From David Rientjes <rientjes@google.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2] mm: oom: deduplicate victim selection code for memcg and global oom
Date 2016-06-28 02:20 +0200
Message-ID <rOOUV-7Fq-1@gated-at.bofh.it> (permalink)
References <rOI38-2Qk-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, 27 Jun 2016, Vladimir Davydov wrote:

> When selecting an oom victim, we use the same heuristic for both memory
> cgroup and global oom. The only difference is the scope of tasks to
> select the victim from. So we could just export an iterator over all
> memcg tasks and keep all oom related logic in oom_kill.c, but instead we
> duplicate pieces of it in memcontrol.c reusing some initially private
> functions of oom_kill.c in order to not duplicate all of it. That looks
> ugly and error prone, because any modification of select_bad_process
> should also be propagated to mem_cgroup_out_of_memory.
> 
> Let's rework this as follows: keep all oom heuristic related code
> private to oom_kill.c and make oom_kill.c use exported memcg functions
> when it's really necessary (like in case of iterating over memcg tasks).
> 

I don't know how others feel, but this actually turns out harder to read 
for me with all the extra redirection with minimal savings (a few dozen 
lines of code).

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


Thread

[PATCH v2] mm: oom: deduplicate victim selection code for memcg and global oom Vladimir Davydov <vdavydov@virtuozzo.com> - 2016-06-27 19:00 +0200
  Re: [PATCH v2] mm: oom: deduplicate victim selection code for memcg  and global oom David Rientjes <rientjes@google.com> - 2016-06-28 02:20 +0200
    Re: [PATCH v2] mm: oom: deduplicate victim selection code for memcg  and global oom Michal Hocko <mhocko@kernel.org> - 2016-07-01 13:30 +0200

csiph-web