Received: by 10.223.176.5 with SMTP id f5csp329196wra; Tue, 30 Jan 2018 12:11:46 -0800 (PST) X-Google-Smtp-Source: AH8x227uH1IqgN5XmKnpQs5/gJDn4aWf8QteWEAs0kQGy0T/lY6J/beOQgGe59bxSWuffYPe3S1S X-Received: by 2002:a17:902:584b:: with SMTP id f11-v6mr26860941plj.244.1517343105968; Tue, 30 Jan 2018 12:11:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517343105; cv=none; d=google.com; s=arc-20160816; b=q6aKSD0jCypRqbhR/ZtLP3MlQuo4fpJlDOc01/guxcjMBWfIKRnG3Y+/jUm9A5ZIZW qCLLK2VAcFPBcgjpkjk+M1xDfPUUv7e8WXqR0TLJVlliotmz0Ury7R/NE2JCE8l2+exJ UKD1Uv3aslsRNQGrFD0OPI1J/0TKfdmwiB187yGM/YWVZWAkATsvXJEGhzkFg932HCmg JZ6f1C7T2wAw7mWH7vYG4i0hAAdAGAXsuqSgg8/W0bsNpgx3GBLvouLsl9z2yajiNNJ9 Qqzhx18wHnDVzd4BWVznM6afsV2js/dcshw5gckApCquvnkZWtDip2r8IbYE9uL1JKCZ VU/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=IFx0fGAhsjJIQAIHVdz35lD4zt0NG9/oNinyLRVzEpQ=; b=WUrpbjUrRIGkuTGJeGtDmKh1gnfG9uMaFmBnFFEhpfpcv619UoAHiG3RIEyffR5S0n ba8wkQZtLOvuYjZIiVTj2aKjX/v2LERHkGY73fxOBpITK6t16kOmWdIGxKVXLfozdNas zgoD1Hq6dqlHAmdaUxLBKz3XFUpZqy9P1YV3tp6RnPo30XF4YltyMxG3SHjQmbVCaU6L jzZxoT3xUcuQL30vEniya3ADNWsU0peUw40HgS9AzGV0sfikbyGOBf20bHU8QfGz9JSa M9heHB/b9XlpHBzDmXBVce6s26p0EmXdlOhtce7dEm2UbbGBdwCXgvy8vD6+vl7VlHzi cCZA== 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 bj3-v6si4375228plb.85.2018.01.30.12.11.31; Tue, 30 Jan 2018 12:11:45 -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 S1753294AbeA3Tjy (ORCPT + 99 others); Tue, 30 Jan 2018 14:39:54 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:53776 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751749AbeA3Tjw (ORCPT ); Tue, 30 Jan 2018 14:39:52 -0500 Received: from akpm3.svl.corp.google.com (unknown [104.133.9.92]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 05D71CFF; Tue, 30 Jan 2018 19:39:51 +0000 (UTC) Date: Tue, 30 Jan 2018 11:39:50 -0800 From: Andrew Morton To: Michal Hocko Cc: Roman Gushchin , Tejun Heo , David Rientjes , 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 v2 2/3] mm, memcg: replace cgroup aware oom killer mount option with tunable Message-Id: <20180130113950.f462c4575a9d8a008162a874@linux-foundation.org> In-Reply-To: <20180130122011.GB21609@dhcp22.suse.cz> References: <20180126143950.719912507bd993d92188877f@linux-foundation.org> <20180126161735.b999356fbe96c0acd33aaa66@linux-foundation.org> <20180129104657.GC21609@dhcp22.suse.cz> <20180129191139.GA1121507@devbig577.frc2.facebook.com> <20180130085445.GQ21609@dhcp22.suse.cz> <20180130115846.GA4720@castle.DHCP.thefacebook.com> <20180130120852.GA21609@dhcp22.suse.cz> <20180130121315.GA5888@castle.DHCP.thefacebook.com> <20180130122011.GB21609@dhcp22.suse.cz> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 30 Jan 2018 13:20:11 +0100 Michal Hocko wrote: > 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. Thanks. Some tweakage: --- a/Documentation/cgroup-v2.txt~mm-oom-docs-describe-the-cgroup-aware-oom-killer-fix-2-fix +++ a/Documentation/cgroup-v2.txt @@ -1292,13 +1292,13 @@ of the OOM'ing cgroup. Leaf cgroups and cgroups with oom_group option set are compared based on their cumulative memory usage. The root cgroup is treated as a -leaf memory cgroup as well, so it's compared with other leaf memory +leaf memory cgroup as well, so it is compared with other leaf memory cgroups. Due to internal implementation restrictions the size of -the root cgroup is a cumulative sum of oom_badness of all its tasks +the root cgroup is the cumulative sum of oom_badness of all its tasks (in other words oom_score_adj of each task is obeyed). Relying on -oom_score_adj (appart from OOM_SCORE_ADJ_MIN) can lead to over or -underestimating of the root cgroup consumption and it is therefore -discouraged. This might change in the future, though. +oom_score_adj (apart from OOM_SCORE_ADJ_MIN) can lead to over- or +underestimation of the root cgroup consumption and it is therefore +discouraged. This might change in the future, however. If there are no cgroups with the enabled memory controller, the OOM killer is using the "traditional" process-based approach. _