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=-3.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,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 A58C8C3A5A9 for ; Sat, 2 May 2020 14:45:39 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6254821775 for ; Sat, 2 May 2020 14:45:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=cmpxchg-org.20150623.gappssmtp.com header.i=@cmpxchg-org.20150623.gappssmtp.com header.b="Cic1EQWT" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6254821775 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cmpxchg.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id EAC0C8E0006; Sat, 2 May 2020 10:45:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E83468E0001; Sat, 2 May 2020 10:45:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D99CF8E0006; Sat, 2 May 2020 10:45:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0209.hostedemail.com [216.40.44.209]) by kanga.kvack.org (Postfix) with ESMTP id C0F518E0001 for ; Sat, 2 May 2020 10:45:38 -0400 (EDT) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 830A0180AD806 for ; Sat, 2 May 2020 14:45:38 +0000 (UTC) X-FDA: 76772052756.27.home41_6b68028eebb04 X-HE-Tag: home41_6b68028eebb04 X-Filterd-Recvd-Size: 4867 Received: from mail-qk1-f195.google.com (mail-qk1-f195.google.com [209.85.222.195]) by imf01.hostedemail.com (Postfix) with ESMTP for ; Sat, 2 May 2020 14:45:37 +0000 (UTC) Received: by mail-qk1-f195.google.com with SMTP id k81so9393736qke.5 for ; Sat, 02 May 2020 07:45:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=LX+U8LD8imPRTAekPeqgptx64l4uRmTaxCyGbFohhCA=; b=Cic1EQWTFPlBof/wEFdfIUmPXhnkkDQxIqwS9oL999SiK3/JgPOMQnlliqwmqq3C5h hDYowsa/ckx/exkFRX5fWC/XndkSaZ/AKnFMLrX27bFHs3iKkBT0W5SNXEf6lOjZUQBc u1KJC8gmeSDYZ6ZezScSMX0A2D0sSRDmX0b1o/PHFQXMFheXeWLzdLJXC4oikCF126vf gLnkZz8ukC/jBoEJAZLiXPW6u8nU8vFHYanGJ/gNUCkBPhs81xP53LD8/J6fnanXSjFJ A7eAiUeaWNV1+r4SvkTXHuRPr13gwfJGk05w0J4glqOUa5YkRx1bb/aDeevJzIj/Mxpg cYww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=LX+U8LD8imPRTAekPeqgptx64l4uRmTaxCyGbFohhCA=; b=V451yDOXx4PpCmDuQmcJvdjtVPC0f9rzX+O/s20C5uvNf5H9Ej2Te5ToFbi8u0PBcp vVo9PKMQ05VYLcNsdIijln0hEmZpIUFJfl8F6iiqrDBCXEnXoaV2yxTSve1+penOLao8 7EHctOtLvTxSqr3xZGWJk+npME+4xqdR8hC9A0clsjUArcA2rEtRBhmF+T4GbWkA9Ofc 7cQXTl0qPqOJ/eK2qha121kDbOru3K68M3VNJ8XmW/5ZMlY6qzzFDjkobntpA8jax/ir Y5DCG/mfgvXkRVwDi14ZfcIjJEUB1b/C3+GiMK/Mw3VQhzzIzAsozd6Dx9K3aq0UTMyY ERiQ== X-Gm-Message-State: AGi0PuarNiGAzkW+ynHE54EO/yh6SVEHEjlanr2EkOFaxCvSwBpSAYT+ PO4df1wemnEdeycGjkbUr8PXaQ== X-Google-Smtp-Source: APiQypJuLP3DjHov7bJJ2mbCBfvHg7LZRv4BSPZ3B5Vt2nf556L2Y+6LNszFDwp32qglED5s377hjg== X-Received: by 2002:a05:620a:1370:: with SMTP id d16mr8247326qkl.233.1588430737383; Sat, 02 May 2020 07:45:37 -0700 (PDT) Received: from localhost ([2620:10d:c091:480::1:1439]) by smtp.gmail.com with ESMTPSA id w134sm5283284qkb.47.2020.05.02.07.45.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 May 2020 07:45:36 -0700 (PDT) Date: Sat, 2 May 2020 10:45:25 -0400 From: Johannes Weiner To: Yafang Shao Cc: akpm@linux-foundation.org, linux-mm@kvack.org, Chris Down , Michal Hocko Subject: Re: [PATCH resend] mm, memcg: fix inconsistent oom event behavior Message-ID: <20200502144525.GB51551@cmpxchg.org> References: <20200502141055.7378-1-laoar.shao@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200502141055.7378-1-laoar.shao@gmail.com> 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 Sat, May 02, 2020 at 10:10:55AM -0400, Yafang Shao wrote: > A recent commit 9852ae3fe529 ("mm, memcg: consider subtrees in > memory.events") changes the behavior of memcg events, which will > consider subtrees in memory.events. But oom_kill event is a special one > as it is used in both cgroup1 and cgroup2. In cgroup1, it is displayed > in memory.oom_control. The file memory.oom_control is in both root memcg > and non root memcg, that is different with memory.event as it only in > non-root memcg. That commit is okay for cgroup2, but it is not okay for > cgroup1 as it will cause inconsistent behavior between root memcg and > non-root memcg. > > Here's an example on why this behavior is inconsistent in cgroup1. > root memcg > / > memcg foo > / > memcg bar > > Suppose there's an oom_kill in memcg bar, then the oon_kill will be > > root memcg : memory.oom_control(oom_kill) 0 > / > memcg foo : memory.oom_control(oom_kill) 1 > / > memcg bar : memory.oom_control(oom_kill) 1 > > For the non-root memcg, its memory.oom_control(oom_kill) includes its > descendants' oom_kill, but for root memcg, it doesn't include its > descendants' oom_kill. That means, memory.oom_control(oom_kill) has > different meanings in different memcgs. That is inconsistent. Then the user > has to know whether the memcg is root or not. > > If we can't fully support it in cgroup1, for example by adding > memory.events.local into cgroup1 as well, then let's don't touch > its original behavior. > > Fixes: 9852ae3fe529 ("mm, memcg: consider subtrees in memory.events") > Reviewed-by: Shakeel Butt > Cc: Chris Down > Cc: Michal Hocko > Cc: Johannes Weiner > Signed-off-by: Yafang Shao Acked-by: Johannes Weiner