From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D4233C433DB for ; Mon, 1 Mar 2021 20:34:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A6AB260201 for ; Mon, 1 Mar 2021 20:34:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243584AbhCAUdi (ORCPT ); Mon, 1 Mar 2021 15:33:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237215AbhCARH6 (ORCPT ); Mon, 1 Mar 2021 12:07:58 -0500 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45F9BC061756 for ; Mon, 1 Mar 2021 09:07:17 -0800 (PST) Received: by mail-ej1-x62b.google.com with SMTP id jt13so29615408ejb.0 for ; Mon, 01 Mar 2021 09:07:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=IxFWs0oSU3V/NwnpfCvBJ5DgtOSVkYwO/FOfviidy1k=; b=txCf4l4pnUYHnMMbaJ+nwcAmrJ5ZF3Esp9SrwyXS8fquZcYAjnVSuLO5lqp2yhPo7t Fb2XxDHLr1OOoKy2dU6xNfvpb3FJZg3g+h5R4NHmkbqjpT3+jke2SORlpIISKFF89bld aHlGlQqv4jd3L7V8+5PiwCZNL+6ENSAsrI1C6DDqO/O5CLEKFNgYyEeFMpn0tiUdUt75 IK2vBaChZcFbexfDJ2jLW1yDvgY4IdG2Ezb7pPzNkTprW+PabRns1J+fEuElHuDijrW/ 9TpomORJI745VH06++izgLQa+/AqeHCQOdOIjU1pOBrl9trrPGFQ28egcJs+ltmQPbq2 5QeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=IxFWs0oSU3V/NwnpfCvBJ5DgtOSVkYwO/FOfviidy1k=; b=lzkbX7SS5FM+9OH+Jr/rXsNfBuRixU83GT3GsBs6LB/Gc7B6lu3jet4iDTcOrDnYGH tZD+co5rMqxu89yBh19Ztudwecp9tOHuqHM7L8dh9Set1NWL7SKvTabZ62+O5aqaW/Ll QtafKA3CQ0a8p4dJs9Alm4bWEwjLZ+KwRVXCN4NP+6S2YHK5b7mzioJEmxw0AF411VRc YDpcJgsnom+7giMrjwjpc22DjBl1RadxU2IumNn2dceVlTTKLIB205DcPChvkljSXm46 hJYTNU+8B+FgE/7yX+ZCn1zzyqD5gbYcgh/VbB4ysLVcNWyeTZv5F3BAEgPoACix/M3Z gtvA== X-Gm-Message-State: AOAM531shmbjNxkwuVHKllOFiVIZI1DuQ2UKQDrcduBxfdgxMwKRC3PN 69wJG0waCuhPFrbAwO6+rHnzOEgL3x7aPu9Kfzw= X-Google-Smtp-Source: ABdhPJwbLEh+sPaoVJInF1JOPo6OGCi/xw159FENojhi6Ypp8UP3BIItWWpqAZ6/5OuoDO2WXQ+Z7t0ggHSbBM50uT0= X-Received: by 2002:a17:907:2bf6:: with SMTP id gv54mr17291479ejc.514.1614618435996; Mon, 01 Mar 2021 09:07:15 -0800 (PST) MIME-Version: 1.0 References: <20210226021254.3980-1-shy828301@gmail.com> In-Reply-To: From: Yang Shi Date: Mon, 1 Mar 2021 09:07:03 -0800 Message-ID: Subject: Re: [PATCH] doc: memcontrol: add description for oom_kill To: Michal Hocko Cc: Johannes Weiner , Roman Gushchin , Shakeel Butt , Andrew Morton , Jonathan Corbet , Linux MM , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 1, 2021 at 4:15 AM Michal Hocko wrote: > > On Fri 26-02-21 08:42:29, Yang Shi wrote: > > On Thu, Feb 25, 2021 at 11:30 PM Michal Hocko wrote: > > > > > > On Thu 25-02-21 18:12:54, Yang Shi wrote: > > > > When debugging an oom issue, I found the oom_kill counter of memcg is > > > > confusing. At the first glance without checking document, I thought it > > > > just counts for memcg oom, but it turns out it counts both global and > > > > memcg oom. > > > > > > Yes, this is the case indeed. The point of the counter was to count oom > > > victims from the memcg rather than matching that to the source of the > > > oom. Rememeber that this could have been a memcg oom up in the > > > hierarchy as well. Counting victims on the oom origin could be equally > > > > Yes, it is updated hierarchically on v2, but not on v1. I'm supposed > > this is because v1 may work in non-hierarchcal mode? If this is the > > only reason we may be able to remove this to get aligned with v2 since > > non-hierarchal mode is no longer supported. > > I believe the reson is that v1 can have tasks in the intermediate > (non-leaf) memcgs. So you wouldn't have a way to tell whether the oom > kill has happened in such a memcg or somewhere down the hierarchy. Aha, I forgot it, that's bad. Although we don't have tasks in intermediate nodes in practice, I do understand it is not forbidden as cgroup v2. > -- > Michal Hocko > SUSE Labs From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DF252C433E0 for ; Mon, 1 Mar 2021 17:07:26 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 807F665172 for ; Mon, 1 Mar 2021 17:07:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 807F665172 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 112D28D008A; Mon, 1 Mar 2021 12:07:26 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0C42E8D0063; Mon, 1 Mar 2021 12:07:26 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 001218D008A; Mon, 1 Mar 2021 12:07:25 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0215.hostedemail.com [216.40.44.215]) by kanga.kvack.org (Postfix) with ESMTP id DF6B78D0063 for ; Mon, 1 Mar 2021 12:07:25 -0500 (EST) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id A70F1181AF5CA for ; Mon, 1 Mar 2021 17:07:25 +0000 (UTC) X-FDA: 77871936450.01.E5792C4 Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) by imf05.hostedemail.com (Postfix) with ESMTP id 665E6E005F2B for ; Mon, 1 Mar 2021 17:07:16 +0000 (UTC) Received: by mail-ej1-f51.google.com with SMTP id w1so29581308ejf.11 for ; Mon, 01 Mar 2021 09:07:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=IxFWs0oSU3V/NwnpfCvBJ5DgtOSVkYwO/FOfviidy1k=; b=txCf4l4pnUYHnMMbaJ+nwcAmrJ5ZF3Esp9SrwyXS8fquZcYAjnVSuLO5lqp2yhPo7t Fb2XxDHLr1OOoKy2dU6xNfvpb3FJZg3g+h5R4NHmkbqjpT3+jke2SORlpIISKFF89bld aHlGlQqv4jd3L7V8+5PiwCZNL+6ENSAsrI1C6DDqO/O5CLEKFNgYyEeFMpn0tiUdUt75 IK2vBaChZcFbexfDJ2jLW1yDvgY4IdG2Ezb7pPzNkTprW+PabRns1J+fEuElHuDijrW/ 9TpomORJI745VH06++izgLQa+/AqeHCQOdOIjU1pOBrl9trrPGFQ28egcJs+ltmQPbq2 5QeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=IxFWs0oSU3V/NwnpfCvBJ5DgtOSVkYwO/FOfviidy1k=; b=mkY0NGCe+Hrj/2/IOfUqd3GfmcITDmsPhmPoi9RRnJJA3fjC/y3vUJTnTH8w7GZcri ArzSZnh5EzXX9CNJVu2BACB1mkktjgpYlQ1Dr3s1WBE7Vvn6moz5QLyzfci9Z6Q2nVQX pS6ncBKKZa/GvrgM24As4LIyO+PoojMhr6fSFmO1Pa5l0QS3rDJUPSd1vPwWT3BHxqrO gopjA8NS+UbhCI3Tv15PK7tPdUeM72odwvy5OFnNWk/2Kmsxz9Fn+X3Qq2I4RcNy8s6a F2Lo68rNq7eKPoI8nEsi9n6zcYwaHZLIXo5UTgTOK+1ZA3h+PxqBRNTPBfjBvMjrthaU Wb2Q== X-Gm-Message-State: AOAM53034UiiPJ2mj/dm2mdjFklPPrL9ZzgUb6b8wSGsv6X0fVGjJseT 5DebXHIy+30xDbx3mXqzIDBJvTdqTODeQ3Dbk0E= X-Google-Smtp-Source: ABdhPJwbLEh+sPaoVJInF1JOPo6OGCi/xw159FENojhi6Ypp8UP3BIItWWpqAZ6/5OuoDO2WXQ+Z7t0ggHSbBM50uT0= X-Received: by 2002:a17:907:2bf6:: with SMTP id gv54mr17291479ejc.514.1614618435996; Mon, 01 Mar 2021 09:07:15 -0800 (PST) MIME-Version: 1.0 References: <20210226021254.3980-1-shy828301@gmail.com> In-Reply-To: From: Yang Shi Date: Mon, 1 Mar 2021 09:07:03 -0800 Message-ID: Subject: Re: [PATCH] doc: memcontrol: add description for oom_kill To: Michal Hocko Cc: Johannes Weiner , Roman Gushchin , Shakeel Butt , Andrew Morton , Jonathan Corbet , Linux MM , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 665E6E005F2B X-Stat-Signature: rr3scfoq6f5x7uni3qjpuj8szwxb11cu Received-SPF: none (gmail.com>: No applicable sender policy available) receiver=imf05; identity=mailfrom; envelope-from=""; helo=mail-ej1-f51.google.com; client-ip=209.85.218.51 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1614618436-355463 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Mar 1, 2021 at 4:15 AM Michal Hocko wrote: > > On Fri 26-02-21 08:42:29, Yang Shi wrote: > > On Thu, Feb 25, 2021 at 11:30 PM Michal Hocko wrote: > > > > > > On Thu 25-02-21 18:12:54, Yang Shi wrote: > > > > When debugging an oom issue, I found the oom_kill counter of memcg is > > > > confusing. At the first glance without checking document, I thought it > > > > just counts for memcg oom, but it turns out it counts both global and > > > > memcg oom. > > > > > > Yes, this is the case indeed. The point of the counter was to count oom > > > victims from the memcg rather than matching that to the source of the > > > oom. Rememeber that this could have been a memcg oom up in the > > > hierarchy as well. Counting victims on the oom origin could be equally > > > > Yes, it is updated hierarchically on v2, but not on v1. I'm supposed > > this is because v1 may work in non-hierarchcal mode? If this is the > > only reason we may be able to remove this to get aligned with v2 since > > non-hierarchal mode is no longer supported. > > I believe the reson is that v1 can have tasks in the intermediate > (non-leaf) memcgs. So you wouldn't have a way to tell whether the oom > kill has happened in such a memcg or somewhere down the hierarchy. Aha, I forgot it, that's bad. Although we don't have tasks in intermediate nodes in practice, I do understand it is not forbidden as cgroup v2. > -- > Michal Hocko > SUSE Labs