From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932157AbcE0O0b (ORCPT ); Fri, 27 May 2016 10:26:31 -0400 Received: from mail-wm0-f47.google.com ([74.125.82.47]:35429 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751575AbcE0O03 (ORCPT ); Fri, 27 May 2016 10:26:29 -0400 Date: Fri, 27 May 2016 16:26:26 +0200 From: Michal Hocko To: Vladimir Davydov Cc: Andrew Morton , Tetsuo Handa , David Rientjes , Johannes Weiner , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] mm: oom: deduplicate victim selection code for memcg and global oom Message-ID: <20160527142626.GQ27686@dhcp22.suse.cz> References: <40e03fd7aaf1f55c75d787128d6d17c5a71226c2.1464358556.git.vdavydov@virtuozzo.com> <3bbc7b70dae6ace0b8751e0140e878acfdfffd74.1464358556.git.vdavydov@virtuozzo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3bbc7b70dae6ace0b8751e0140e878acfdfffd74.1464358556.git.vdavydov@virtuozzo.com> User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 27-05-16 17:17:42, 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 am doing quite large changes in this area and this would cause many conflicts. Do you think you can postpone this after my patchset [1] gets sorted out please? I haven't looked at the patch carefully so I cannot tell much about it right now but just wanted to give a heads up for the conflicts. [1] http://lkml.kernel.org/r/1464266415-15558-1-git-send-email-mhocko@kernel.org Thanks! > > Signed-off-by: Vladimir Davydov > --- > include/linux/memcontrol.h | 15 ++++ > include/linux/oom.h | 51 ------------- > mm/memcontrol.c | 112 ++++++++++----------------- > mm/oom_kill.c | 183 +++++++++++++++++++++++++++++---------------- > 4 files changed, 176 insertions(+), 185 deletions(-) -- Michal Hocko SUSE Labs