Received: by 10.223.176.5 with SMTP id f5csp2714965wra; Mon, 29 Jan 2018 02:47:43 -0800 (PST) X-Google-Smtp-Source: AH8x226dgl4qUSG8zf4ICrYBaXXLXBM4fus7rz2YzIVnHkrzBLWZVK2zAXBc4Ze5ck2Ba3sRV7kW X-Received: by 10.99.65.65 with SMTP id o62mr17236656pga.392.1517222863833; Mon, 29 Jan 2018 02:47:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517222863; cv=none; d=google.com; s=arc-20160816; b=tepE1yVikHVmgDDyL4/A2laa1KPCbkw/gHzggclyw6CbTIvwTl4GkaiWROAdJCHXaa hNFSBDgXEjE61hrV6OnXDX65IjXkygiFcw46DES1igposiwt1LW9yKt9NMlX3tJsKmGN N2PPQnnqQylkPRyT3JE29RdxeKOChuCfZnKuMONe5iUV7KKOKTAOTMH03CoqA/pItQpa GIF1vxLiTORJongg+TG0vLlb4RFGD63YtyeMXIWUpR0NSuoUutjjzMNef2qLKf9EqbDK OF6xe7OG5+WG6z/feQ900NY77BncaZ5QGpT9degHOK2pOCO5pXuVagO6j+yVZ008is/N H8kg== 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=ORy+V6YoQo1TS/AjnAeEtr4zMt6cjjchfVVl3D0FyIQ=; b=X6Ad8yTbf5RI6ngM1ZlR4RZ8avH8eXD7Kr/aWyQCfYnrtmRmRQNWYJ9Qp3LFbZ2bI+ KDgyEAMEMygINii764ckDWmw6/YAGuCE1tNB7nedcsTENxC+0qj6Z0cIfRqdN1gXoNmf XqnBGEeXiI/xrtblq6xWwQSxE4sAqnYEX+yUykAMrcfX7SAz2u27N5QbXwieylIwRB9M geNWWCSpt7KOXL83z3GMc0BS0CIuHGPQQXciQbBLhEQfcahtM5Cw+mQLOJ1YhtdrHB7H m3Z7TtdKs1fjUixMsZ5WOYocpIqqerkLkOS+0RGcavO5qpm97oKKTZEmwbId/TlmNYe7 r2Eg== 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 u79si11674995pfi.315.2018.01.29.02.47.29; Mon, 29 Jan 2018 02:47:43 -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 S1751547AbeA2KrC (ORCPT + 99 others); Mon, 29 Jan 2018 05:47:02 -0500 Received: from mx2.suse.de ([195.135.220.15]:38470 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751321AbeA2KrA (ORCPT ); Mon, 29 Jan 2018 05:47:00 -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 8BA41AAB9; Mon, 29 Jan 2018 10:46:58 +0000 (UTC) Date: Mon, 29 Jan 2018 11:46:57 +0100 From: Michal Hocko To: Andrew Morton Cc: David Rientjes , Roman Gushchin , Vladimir Davydov , Johannes Weiner , Tetsuo Handa , Tejun Heo , 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 v2 2/3] mm, memcg: replace cgroup aware oom killer mount option with tunable Message-ID: <20180129104657.GC21609@dhcp22.suse.cz> References: <20180125160016.30e019e546125bb13b5b6b4f@linux-foundation.org> <20180126143950.719912507bd993d92188877f@linux-foundation.org> <20180126161735.b999356fbe96c0acd33aaa66@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180126161735.b999356fbe96c0acd33aaa66@linux-foundation.org> 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 Fri 26-01-18 16:17:35, Andrew Morton wrote: > On Fri, 26 Jan 2018 14:52:59 -0800 (PST) David Rientjes wrote: [...] > > Those use cases are also undocumented such that the user doesn't know the > > behavior they are opting into. Nowhere in the patchset does it mention > > anything about oom_score_adj other than being oom disabled. It doesn't > > mention that a per-process tunable now depends strictly on whether it is > > attached to root or not. It specifies a fair comparison between the root > > mem cgroup and leaf mem cgroups, which is obviously incorrect by the > > implementation itself. So I'm not sure the user would know which use > > cases it is valid for, which is why I've been trying to make it generally > > purposeful and documented. > > Documentation patches are nice. We can cc:stable them too, so no huge > hurry. What about this? From c02d8bc1396d5ab3785d01f577e2ee74e5dd985e Mon Sep 17 00:00:00 2001 From: Michal Hocko Date: Mon, 29 Jan 2018 11:42:59 +0100 Subject: [PATCH] oom, memcg: clarify root memcg oom accounting David Rientjes has pointed out that the current way how the root memcg is accounted for the cgroup aware OOM killer is undocumented. Unlike regular cgroups there is no accounting going on in the root memcg (mostly for performance reasons). Therefore we are suming up oom_badness of its tasks. This might result in an over accounting because of the oom_score_adj setting. Document this for now. Signed-off-by: Michal Hocko --- Documentation/cgroup-v2.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Documentation/cgroup-v2.txt b/Documentation/cgroup-v2.txt index 2eaed1e2243d..7dff106bba57 100644 --- a/Documentation/cgroup-v2.txt +++ b/Documentation/cgroup-v2.txt @@ -1292,7 +1292,11 @@ the memory controller considers only cgroups belonging to the sub-tree of the OOM'ing cgroup. The root cgroup is treated as a leaf memory cgroup, so it's compared -with other leaf memory cgroups and cgroups with oom_group option set. +with other leaf memory cgroups and cgroups with oom_group option +set. Due to internal implementation restrictions the size of the root +cgroup is a cumulative sum of oom_badness of all its tasks (in other +words oom_score_adj of each task is obeyed). This might change in the +future. If there are no cgroups with the enabled memory controller, the OOM killer is using the "traditional" process-based approach. -- 2.15.1 -- Michal Hocko SUSE Labs