Received: by 10.223.176.46 with SMTP id f43csp4288299wra; Tue, 23 Jan 2018 07:13:46 -0800 (PST) X-Google-Smtp-Source: AH8x224gMkKQWo+oRVL5+s8P7L9PhvRY8kmf2rJ4eOZvp03ZGF7TvuanPncii4RXLu9l8R+Bukrt X-Received: by 2002:a17:902:6ac4:: with SMTP id i4-v6mr5974645plt.304.1516720426842; Tue, 23 Jan 2018 07:13:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516720426; cv=none; d=google.com; s=arc-20160816; b=0pVR7cPa33WKCEC6f8uxwTAbzCnumPmGKHH04mQO7TB7kZNP/LFBlb5Wq747i0NodE R8dtiXXvOjEZnc5DTcKw/hRb1zcmCkVv/cJgWEEFErzewLUYvsdcCAdEMpuQbRFaM18d SNTJEfQfm+PBbhHkH2OOr/qIMkGGoJ4Rd4xjPr1denkKnvh7arqcrUDJ02mbPZAXGKZc 5qBRd51jf2zUgN9qBZKbtNqzKuKU2TIMCJclsqqRomfO/a9Z3PvNMqsgYC1SfdAFgBac u6FJpU2rzUHuqIsORe5aKj7IHeFmNA86McOA1gyUveyax/CjV+zjS3S54EzTkcffyd3Z MVyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=0spAXrT5CABEKyAjY+lNf63letSDm/MuU/3/MuCP51o=; b=uIWsDSP1afBofVntfjps62U1ErosC7EHN0jO7anX9MguNMeN0eMzWu5ExHEnZh5T+Q Sef3YEis/WWcOYdJZ9DLyFlPkecwqkRKpE/+1bpWRKQ2M0AFA/uDwVc8bpNl0stmDwK/ xm+2VMU6S1YDWzyboWrEhdqnHFFTKetsy8DDqlW8KrBzZ1cobNy16wlHEO2Jwj26E4nn HMtCqmczsDyzU+s4tVh5xvE2FEHVGGU5WZql3UkQdVsTGalVSzKudYZvy/m+W49eJAde utc/NBc/aN9DnM3ZejIqKHqg49byPUnqAfZjWp46KnEOPTHG1UpvMuM/AZ+9OHfITj57 nI5w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z20si1607346pfj.118.2018.01.23.07.13.32; Tue, 23 Jan 2018 07:13:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751372AbeAWPNG (ORCPT + 99 others); Tue, 23 Jan 2018 10:13:06 -0500 Received: from mx2.suse.de ([195.135.220.15]:54114 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750960AbeAWPNE (ORCPT ); Tue, 23 Jan 2018 10:13:04 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 4FB27AF18; Tue, 23 Jan 2018 15:13:02 +0000 (UTC) Date: Tue, 23 Jan 2018 16:13:00 +0100 From: Michal Hocko To: David Rientjes Cc: Tejun Heo , Andrew Morton , Roman Gushchin , Vladimir Davydov , Johannes Weiner , Tetsuo Handa , kernel-team@fb.com, cgroups@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [patch -mm 3/4] mm, memcg: replace memory.oom_group with policy tunable Message-ID: <20180123151300.GP1526@dhcp22.suse.cz> References: <20180117154155.GU3460072@devbig577.frc2.facebook.com> <20180117160004.GH2900@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 17-01-18 14:18:33, David Rientjes wrote: > On Wed, 17 Jan 2018, Michal Hocko wrote: > > > Absolutely agreed! And moreover, there are not all that many ways what > > to do as an action. You just kill a logical entity - be it a process or > > a logical group of processes. But you have way too many policies how > > to select that entity. Do you want to chose the youngest process/group > > because all the older ones have been computing real stuff and you would > > lose days of your cpu time? Or should those who pay more should be > > protected (aka give them static priorities), or you name it... > > > > That's an argument for making the interface extensible, yes. And there is no interface to control the selection yet so we can develop one on top. > > I am sorry, I still didn't grasp the full semantic of the proposed > > soluton but the mere fact it is starting by conflating selection and the > > action is a no go and a wrong API. This is why I've said that what you > > (David) outlined yesterday is probably going to suffer from a much > > longer discussion and most likely to be not acceptable. Your patchset > > proves me correct... > > I'm very happy to change the API if there are better suggestions. That > may end up just being an memory.oom_policy file, as this implements, and > separating out a new memory.oom_action that isn't a boolean value to > either do a full group kill or only a single process. Or it could be what > I suggested in my mail to Tejun, such as "hierarchy killall" written to > memory.oom_policy, which would specify a single policy and then an > optional mechanism. With my proposed patchset, there would then be three > policies: "none", "cgroup", and "tree" and one possible optional > mechanism: "killall". You haven't convinced me at all. This all sounds more like "what if" than a really thought through interface. I've tried to point out that having a real policy driven victim selection is a _hard_ thing to do _right_. On the other hand oom_group makes semantic sense. It controls the killable entity and there are usecases which want to consider the full memcg as a single killable entity. No matter what selection policy we chose on top. It is just a natural API. Now you keep arguing about the victim selection and different strategies to implement it. We will not move forward as long as you keep conflating the two things, I am afraid. -- Michal Hocko SUSE Labs