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=-12.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 37261C433E0 for ; Fri, 26 Feb 2021 19:20:07 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B65B464F1F for ; Fri, 26 Feb 2021 19:20:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B65B464F1F 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 393648D000A; Fri, 26 Feb 2021 14:20:06 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3446D8D0002; Fri, 26 Feb 2021 14:20:06 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 233288D000A; Fri, 26 Feb 2021 14:20:06 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0090.hostedemail.com [216.40.44.90]) by kanga.kvack.org (Postfix) with ESMTP id 0D29E8D0002 for ; Fri, 26 Feb 2021 14:20:06 -0500 (EST) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id B9C2963F4 for ; Fri, 26 Feb 2021 19:20:05 +0000 (UTC) X-FDA: 77861384370.10.BACD09A Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) by imf16.hostedemail.com (Postfix) with ESMTP id AE70180192E4 for ; Fri, 26 Feb 2021 19:20:04 +0000 (UTC) Received: by mail-ed1-f54.google.com with SMTP id p2so12288884edm.12 for ; Fri, 26 Feb 2021 11:20:05 -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=tAgRNmsGOdl3/cgNTgckimnaWEgU9jQUQCrsL7tdGio=; b=F1YoAeR9FAM+1UpF++eXbPXOyDleQgQIJdYrUNA6Let3x//1AiwIJSWD7pxtFT0vZM NIaDUywKwuqGKv20X+MY40UhdKSXyjjasOV9BnSfdT5MVDX2t3P0cKCCNci2BXD0PMW5 UVO4tqS8pHBZQrxLCrh/VePbmmM7/rKDqEkBYDC1EOOYBW7MzPW5Ou+814mdiQGNiU1K 4xYoFHu2X7v7Vu0R2HyADlRS1Ohivsk2TKqWtHaixzQwID4kMWCCInNhkDIXKXihzeU6 otdd1Aqr/oTWTl7ESxd/VGrgJZswC6fxO94tmhbm6hzh29dGbljlOeoMCwdJP7A0S7IL YRCw== 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=tAgRNmsGOdl3/cgNTgckimnaWEgU9jQUQCrsL7tdGio=; b=IDMyZkEzO9TMBzyCCxNILeB4W/3MtrYGE4DP+ETAMNVQOeJAybtJAhD2DWQEPqDkNX ca3rICj8sBkbJE6MYZpJaN7PEtiIadg9aGqxXGhiCAjOJ1LAjhf9NQYNQROlmE5aC9JN /96scs8DJtg94wWiIVXmYYaAXqV51QZ7V/Mhh/d4JPG/h91RzFVgCJ62JkbIFKLVS6jS ZQMst0iHGuv+ls9QmMiVERE4lFkUyT3Seb8QPHE4FTTarHV94H5Oe7GTIiTTSTiD7U85 oV6PU8RVb2gdVY6mCAuMuBbE/100hrorXagGn7306cHNRhenOTMV04aLqOWI9Mh18wFe uCyA== X-Gm-Message-State: AOAM530WICYM5UBKeeVBpmst3FMZ6vy3799VjZq9aC+vEf2rC6nI9B1Q ixwaqFpX4wpm07Nqcnno1nMFmaP0w8UwFHlSR/I= X-Google-Smtp-Source: ABdhPJwyIGx+Yr3meZzdDNV+mbQOAEIbg9OJktwdmHZEQg5KEhJoQx+crPdWgBDj4Mj/HN/DwWl6v4zMZSIK+z49AQQ= X-Received: by 2002:a50:bec3:: with SMTP id e3mr5102234edk.290.1614367204017; Fri, 26 Feb 2021 11:20:04 -0800 (PST) MIME-Version: 1.0 References: <20210226021254.3980-1-shy828301@gmail.com> In-Reply-To: From: Yang Shi Date: Fri, 26 Feb 2021 11:19:51 -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: rspam03 X-Rspamd-Queue-Id: AE70180192E4 X-Stat-Signature: 9mgnmjrftzby56xfwwhbd4fi7hu3ooku Received-SPF: none (gmail.com>: No applicable sender policy available) receiver=imf16; identity=mailfrom; envelope-from=""; helo=mail-ed1-f54.google.com; client-ip=209.85.208.54 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1614367204-761528 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 Fri, Feb 26, 2021 at 8:42 AM 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. BTW, having the counter recorded hierarchically may help out one of our usecases. We want to monitor the oom_kill for some services, but systemd would wipe out the cgroup if the service is oom killed then restart the service from scratch (it means create a brand new cgroup with the same name). So this systemd behavior makes the counter useless if it is not recorded hierarchically. > > > confusing because in many cases there would be no victim counted for the > > above mentioned memcg ooms. > > > > > The cgroup v2 documents it, but the description is missed for cgroup v1. > > > > > > Signed-off-by: Yang Shi > > > > Acked-by: Michal Hocko > > > > > --- > > > Documentation/admin-guide/cgroup-v1/memory.rst | 3 +++ > > > 1 file changed, 3 insertions(+) > > > > > > diff --git a/Documentation/admin-guide/cgroup-v1/memory.rst b/Documentation/admin-guide/cgroup-v1/memory.rst > > > index 0936412e044e..44d5429636e2 100644 > > > --- a/Documentation/admin-guide/cgroup-v1/memory.rst > > > +++ b/Documentation/admin-guide/cgroup-v1/memory.rst > > > @@ -851,6 +851,9 @@ At reading, current status of OOM is shown. > > > (if 1, oom-killer is disabled) > > > - under_oom 0 or 1 > > > (if 1, the memory cgroup is under OOM, tasks may be stopped.) > > > + - oom_kill integer counter > > > + The number of processes belonging to this cgroup killed by any > > > + kind of OOM killer. > > > > > > 11. Memory Pressure > > > =================== > > > -- > > > 2.26.2 > > > > > > > -- > > Michal Hocko > > SUSE Labs