[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160628161642.GA30658@esperanza>
Date: Tue, 28 Jun 2016 19:16:42 +0300
From: Vladimir Davydov <vdavydov@...tuozzo.com>
To: David Rientjes <rientjes@...gle.com>
CC: Andrew Morton <akpm@...ux-foundation.org>,
Michal Hocko <mhocko@...nel.org>,
Johannes Weiner <hannes@...xchg.org>,
Tetsuo Handa <penguin-kernel@...ove.sakura.ne.jp>,
<linux-mm@...ck.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] mm: oom: deduplicate victim selection code for memcg
and global oom
On Mon, Jun 27, 2016 at 05:14:31PM -0700, David Rientjes wrote:
> 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).
Well, if you guys find the code difficult to read after this patch,
let's leave it as is. Sorry for the noise.
Powered by blists - more mailing lists