Received: by 10.223.148.5 with SMTP id 5csp5956345wrq; Wed, 17 Jan 2018 07:42:53 -0800 (PST) X-Google-Smtp-Source: ACJfBovcaDkd6EFG3js6gSzAxBE3dsmdtjgi1I3O+ZhFAZFEgSKXiOiH7mnanYTMjlHA7gSpKmdC X-Received: by 10.84.171.228 with SMTP id l91mr5364589plb.387.1516203772989; Wed, 17 Jan 2018 07:42:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516203772; cv=none; d=google.com; s=arc-20160816; b=eY+5gdN8nwddIOZH+lexxKv6Emtf8H1XbAqhlvw2YI3s216ZCr772KWJu+ik8d/bwY FoortI1BffHIjDcmZ8OEoKj1TG0PkfpB2pzP8qDj4UiXyzEWdFhqtoYCXdGPCGCRosv+ G0LeECZNX9pS/hs8h0+EiaH9ZUFjj+Nzvgrh6Ibuvny7VMS0drLS4UcE6dtcP/4KIZJy bQRQoefFdSpGhdfcMKCT8wfK0ywTjGfGJxgO3yHaz3xlM6+mJ6U6lUNAC8ANFwOe2K0B fJPlAA9PXgNx56hsKCr8Ox3lxzjQkuWfPxjWSkzh9JgP0mBw0qYD8G8zYRQno44+wejC Ag2Q== 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:dkim-signature:arc-authentication-results; bh=EPqYbciQrTG0JihwLZlFLm1Z1NQ+//IP+c3PY1vqSO0=; b=KVZFfgB7gzLlI93sJbVp85Q2oQyePGpnQZf9eDHFuQU1HBYApDm9ZpmDsplAV+cJWK tzEJo2dyeCEd3VJm1Jqze8sdsWQn6HEqOTcy+ylIBu4q184AhC+R0AuSAV6gvHvBc+Gu Pqi5aXQghEbUXHa3t0wQKJ7NhB5E5YD69HNjtwLiW/CFbOjnAw2LAliR0RQKPUI/0eM6 Mq+cdr6L2S7g+TYR0uYqn96ghW5Zg/PPTEfvWRSwqE0pTqshxJpfyqXP+5Jtn4WDjNzo mQoRUWWN4eKR8OBFZebRv++q/OcIW7V2zlUtCdQjtu2a+xVv0d7Di7m6j3PykqUPm362 HGzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=ZFJM0WSD; 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 d65si4160803pga.399.2018.01.17.07.42.38; Wed, 17 Jan 2018 07:42:52 -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; dkim=fail header.i=@gmail.com header.s=20161025 header.b=ZFJM0WSD; 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 S1753724AbeAQPmD (ORCPT + 99 others); Wed, 17 Jan 2018 10:42:03 -0500 Received: from mail-qk0-f170.google.com ([209.85.220.170]:34267 "EHLO mail-qk0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753629AbeAQPl7 (ORCPT ); Wed, 17 Jan 2018 10:41:59 -0500 Received: by mail-qk0-f170.google.com with SMTP id b76so25780804qkc.1; Wed, 17 Jan 2018 07:41:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=EPqYbciQrTG0JihwLZlFLm1Z1NQ+//IP+c3PY1vqSO0=; b=ZFJM0WSDeIVHnV7tbiWvgdAwX/mUNkYDZ6iF0qLnV8tC5KSJHG8KIklOC+ZPmLZBJN CDhbY/Is//AFf92AYeH4Y/WATVZ4DTgvOe8RRWUQ+3BA/vDH8CQFryCwBHeWvcFD3C79 /at7svThF8qQolNyEym7Ly/FF4Yd3PXZh2YzpAPclm4lGbZDKz/OnAojhMgteay4T+5h VIW/s6ONZF9Urkxtnsyr0SAxFbb8RQDiBmYu/KfXgi+wC2IHYHBwCiDCcImXUUNzLk6q 6Sus6PsmS1Q1oezDXVNX8khI8WtAQWMgh9maIapaibG8pTHzGkYt5x3jd0QNvEvlXoED +wkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=EPqYbciQrTG0JihwLZlFLm1Z1NQ+//IP+c3PY1vqSO0=; b=HRsxMYb1ceAo/HQHBGOk9WC86Rz3sy79o0BI06y0BvXCEPHirEh/0oef8iherY+R1M b3l3+qrPucGh25n9qFlrsjBJXQIiNynQbX+uB+8MTJ3E3rS8JdPK/lo540m/QW9p7Ue6 wvgNcecS7TinxyL8EZU39sCE959yO4IYMCQDywncs9nNKFkNpUjTlydf79GDvbpkECCM R6Z4HR/aNR7+Q58z41Q2RizBqhscMdtoogFZx/33d76xSWxmcLMkT+ciR2Pmnneevl5m pe+ryEAPR6q/l+GajJa6zt1ggU5GPYD2rNY7tp1ADf00YhQLqu/45+Vk+2E2bMVX+a50 R4fg== X-Gm-Message-State: AKwxytdtoEVG3aQcxVmTcNEZvsOUbKTTFEMdZ1ROuicihkf3bHYhlGOV hCYkLPP+L8U42vFep+aNxCBx7W4m X-Received: by 10.55.147.199 with SMTP id v190mr59759661qkd.119.1516203718249; Wed, 17 Jan 2018 07:41:58 -0800 (PST) Received: from localhost (dhcp-ec-8-6b-ed-7a-cf.cpe.echoes.net. [72.28.5.223]) by smtp.gmail.com with ESMTPSA id d76sm3224143qka.2.2018.01.17.07.41.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Jan 2018 07:41:57 -0800 (PST) Date: Wed, 17 Jan 2018 07:41:55 -0800 From: Tejun Heo To: David Rientjes Cc: Andrew Morton , Roman Gushchin , Michal Hocko , 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: <20180117154155.GU3460072@devbig577.frc2.facebook.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, David. On Tue, Jan 16, 2018 at 06:15:08PM -0800, David Rientjes wrote: > The behavior of killing an entire indivisible memory consumer, enabled > by memory.oom_group, is an oom policy itself. It specifies that all I thought we discussed this before but maybe I'm misremembering. There are two parts to the OOM policy. One is victim selection, the other is the action to take thereafter. The two are different and conflating the two don't work too well. For example, please consider what should be given to the delegatee when delegating a subtree, which often is a good excercise when designing these APIs. When a given workload is selected for OOM kill (IOW, selected to free some memory), whether the workload can handle individual process kills or not is the property of the workload itself. Some applications can safely handle some of its processes picked off and killed. Most others can't and want to be handled as a single unit, which makes it a property of the workload. That makes sense in the hierarchy too because whether one process or the whole workload is killed doesn't infringe upon the parent's authority over resources which in turn implies that there's nothing to worry about how the parent's groupoom setting should constrain the descendants. OOM victim selection policy is a different beast. As you've mentioned multiple times, especially if you're worrying about people abusing OOM policies by creating sub-cgroups and so on, the policy, first of all, shouldn't be delegatable and secondly should have meaningful hierarchical restrictions so that a policy that an ancestor chose can't be nullified by a descendant. I'm not necessarily against adding hierarchical victim selection policy tunables; however, I am skeptical whether static tunables on cgroup hierarchy (including selectable policies) can be made clean and versatile enough, especially because the resource hierarchy doesn't necessarily, or rather in most cases, match the OOM victim selection decision tree, but I'd be happy to be proven wrong. Without explicit configurations, the only thing the OOM killer needs to guarantee is that the system can make forward progress. We've always been tweaking victim selection with or without cgroup and absolutely shouldn't be locked into a specific heuristics. The heuristics is an implementaiton detail subject to improvements. To me, your patchset actually seems to demonstrate that these are separate issues. The goal of groupoom is just to kill logical units as cgroup hierarchy can inform the kernel of how workloads are composed in the userspace. If you want to improve victim selection, sure, please go ahead, but your argument that groupoom can't be merged because of victim selection policy doesn't make sense to me. Thanks. -- tejun