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=-0.6 required=3.0 tests=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 896B9C432C0 for ; Mon, 25 Nov 2019 09:13:34 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3F3C120718 for ; Mon, 25 Nov 2019 09:13:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="LI528RtU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3F3C120718 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 D5E796B05BE; Mon, 25 Nov 2019 04:13:33 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CEB0B6B05BF; Mon, 25 Nov 2019 04:13:33 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BB0976B05C0; Mon, 25 Nov 2019 04:13:33 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0183.hostedemail.com [216.40.44.183]) by kanga.kvack.org (Postfix) with ESMTP id A0DD46B05BE for ; Mon, 25 Nov 2019 04:13:33 -0500 (EST) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with SMTP id 2461E98A4 for ; Mon, 25 Nov 2019 09:13:33 +0000 (UTC) X-FDA: 76194236706.12.sky84_1ef49474d7049 X-HE-Tag: sky84_1ef49474d7049 X-Filterd-Recvd-Size: 6213 Received: from mail-il1-f195.google.com (mail-il1-f195.google.com [209.85.166.195]) by imf22.hostedemail.com (Postfix) with ESMTP for ; Mon, 25 Nov 2019 09:13:32 +0000 (UTC) Received: by mail-il1-f195.google.com with SMTP id q15so13484492ils.8 for ; Mon, 25 Nov 2019 01:13:32 -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=8fuqWjSLN8MakWSLdfjZOEYDbu7Ij5Ad2BTn1WesFsg=; b=LI528RtUi4OjPWL7EiZMvOhiSItwVZE/UFnZR+YZfA6TpymU4Y8+JXzkKXPRXtLTrF n11by1TyRg6onn00qpBmimp5+dOkq8oQ9keW+s3J/EfYppmoj7vj1kJnDOQXhofhE1OK 6Cb7wotuEWCSoXxi0w5L4FIyTTA3mz/Yt/O7WxgtFR9l2WWjhB4Y6jPM7Z/p/pGEydE+ z/0kl0q/sSQ7bFMFwY4cVrPcDojGR2cJWUSTqPVCVQVpfRp9Dl+jerkjziNTOYe9vNeB iyJmcYAbNd2NFB0drB8mZVZ3L2mg6Ws3SHtmDbvHAMll3w1uUjG77H3U8LvvgihMcc4j kyKw== 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=8fuqWjSLN8MakWSLdfjZOEYDbu7Ij5Ad2BTn1WesFsg=; b=BFDpGJDti88NyVNp5MX6Qqwe+CmVVJGpd32FFE2s+hDcwwfWfQqM9g4CMBEgvv7GUq QF6kDAjnLyJoF+6QqYZ+aRAmo47m2KNC3FEjsCafXEjPPeOIpghd6St6AiIWcTZnn6p9 8b5WYbeWJ+rnCZueHZ6JfHBRvUymqrtD3N5B1nNiwp/fzDfqt6R2UQbO9c362xghMMO8 Fajf5ByfXlcHBMRakpjtZ7NIhqpUfpy//p3zNPkiuWXx5elw0nWAMe2Cf/BSN8bQivDO fO4coM/qkA5piFl7aHGdR5xwC9vOuhno4TX4Wjm/FYJrsPKv7RobRyYwhuWwhx5FVTSH PROg== X-Gm-Message-State: APjAAAVUskhtWUdhyweTyPOprhY9dRXm5MuKPubbTLp/s1vH5pj+C5Di MAAbaBDve9A0+bcmzLlc5ev/UuwPvwlTBSsnFws= X-Google-Smtp-Source: APXvYqw1DQnHdhqrIZUxXxt1lfTHEQ6yJfIeyeZPQw0vpSFf6fqzmGbV+WviFZY5RXC6JuDWjFS053HROylVQLaJKoU= X-Received: by 2002:a92:8404:: with SMTP id l4mr33707634ild.137.1574673212055; Mon, 25 Nov 2019 01:13:32 -0800 (PST) MIME-Version: 1.0 References: <1574239985-1916-1-git-send-email-laoar.shao@gmail.com> <20191120102157.GF23213@dhcp22.suse.cz> <20191120114043.GH23213@dhcp22.suse.cz> <20191122102842.GR23213@dhcp22.suse.cz> <20191125082040.GB31714@dhcp22.suse.cz> In-Reply-To: <20191125082040.GB31714@dhcp22.suse.cz> From: Yafang Shao Date: Mon, 25 Nov 2019 17:12:54 +0800 Message-ID: Subject: Re: [PATCH] mm, memcg: show memcg min setting in oom messages To: Michal Hocko Cc: Johannes Weiner , Vladimir Davydov , Andrew Morton , Linux MM Content-Type: text/plain; charset="UTF-8" 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, Nov 25, 2019 at 4:20 PM Michal Hocko wrote: > > On Sat 23-11-19 13:52:57, Yafang Shao wrote: > > On Fri, Nov 22, 2019 at 6:28 PM Michal Hocko wrote: > > > > > > On Wed 20-11-19 20:23:54, Yafang Shao wrote: > > > > On Wed, Nov 20, 2019 at 7:40 PM Michal Hocko wrote: > > > > > > > > > > On Wed 20-11-19 18:53:44, Yafang Shao wrote: > > > > > > On Wed, Nov 20, 2019 at 6:22 PM Michal Hocko wrote: > > > > > > > > > > > > > > On Wed 20-11-19 03:53:05, Yafang Shao wrote: > > > > > > > > A task running in a memcg may OOM because of the memory.min settings of his > > > > > > > > slibing and parent. If this happens, the current oom messages can't show > > > > > > > > why file page cache can't be reclaimed. > > > > > > > > > > > > > > min limit is not the only way to protect memory from being reclaim. The > > > > > > > memory might be pinned or unreclaimable for other reasons (e.g. swap > > > > > > > quota exceeded for memcg). > > > > > > > > > > > > Both swap or unreclaimabed (unevicteable) is printed in OOM messages. > > > > > > > > > > Not really. Consider a memcg which has reached it's swap limit. The > > > > > anonymous memory is not really reclaimable even when there is a lot of > > > > > swap space available. > > > > > > > > > > > > > The memcg swap limit is already printed in oom messages, see bellow, > > > > > > > > [ 141.721625] memory: usage 1228800kB, limit 1228800kB, failcnt 18337 > > > > [ 141.721958] swap: usage 0kB, limit 9007199254740988kB, failcnt 0 > > > > > > But you do not have any insight on the swap limit down the oom > > > hierarchy, do you? > > > > > > > > > Why not just print the memcgs which are under memory.min protection or > > > > > > something like a total number of min protected memory ? > > > > > > > > > > Yes, this would likely help. But the main question really reamains, is > > > > > this really worth it? > > > > > > > > > > > > > If it doesn't cost too much, I think it is worth to do it. > > > > As the oom path is not the critical path, so adding some print info > > > > should not add much overhead. > > > > > > Generating a lot of output for the oom reports has been a real problem > > > in many deployments. > > > > So why not only print non-zero counters ? > > If some counters are 0, we don't print them, that can reduce the oom reports. > > > > Something like "isolated_file:0 unevictable:0 dirty:0 writeback:0 > > unstable:0" can all be removed, > > and we consider them as zero by default. > > because that would make parsing more complex. > > > I mean we can optimze the OOM reports and only print the useful > > information to make it not be a problem in many deployments. > > We can, but it would be great to have it backed by som real usecase to > change the current behavior. I haven't heard anything so far. It is all > about "this would be nice" without a strong justification. Because I was told by you that "Generating a lot of output for the oom reports has been a real problem in many deployments.". Maybe I misunderstood you : ( Thanks Yafang