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.5 required=3.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 F30C4C432C0 for ; Fri, 22 Nov 2019 10:28:47 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B904B20714 for ; Fri, 22 Nov 2019 10:28:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B904B20714 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 276286B04BC; Fri, 22 Nov 2019 05:28:47 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 226476B04BD; Fri, 22 Nov 2019 05:28:47 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 13D206B04BE; Fri, 22 Nov 2019 05:28:47 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0055.hostedemail.com [216.40.44.55]) by kanga.kvack.org (Postfix) with ESMTP id F2AD46B04BC for ; Fri, 22 Nov 2019 05:28:46 -0500 (EST) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with SMTP id 9A2524DAD for ; Fri, 22 Nov 2019 10:28:46 +0000 (UTC) X-FDA: 76183539852.11.beam39_4c8c5ff1a014f X-HE-Tag: beam39_4c8c5ff1a014f X-Filterd-Recvd-Size: 5807 Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by imf24.hostedemail.com (Postfix) with ESMTP for ; Fri, 22 Nov 2019 10:28:45 +0000 (UTC) Received: by mail-wm1-f68.google.com with SMTP id z19so6983420wmk.3 for ; Fri, 22 Nov 2019 02:28:45 -0800 (PST) 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:user-agent; bh=DqSAKVEaFxSHM/Ol8qQXhiRH0ayGvOVJcbpQrBXoIhE=; b=mwCzstFNTN+/bFSVZvFkrr+NXyeJAX6A6EJul6IrUzDUp1mgihmme0jZZ1rbyit1JK Hvobb1fiwOj8125aYbkWNc7ZCsJ4oFMYUPTQxJ2xXAhwMKQMRQv7Dk5Q/MhnRiW0SZJO /kfn1LHflSt2B+KLy1gNbE6YFCbOMD6jWYAms8R/3kTboRSu71YBm6CzQOuiuAzSaNtP aexZTfYNQCaMXzL9T2c7ZVYrJ9OEMjOZ5YQhJgItJJJZWxish6NlTv10agWGnZ+WP/iz ARJTJiD5jyEIlHrtWo4DCGvOACM+Du3TdsFwmtoM1iFyN7ohHerbvtUa9CLIfn9foCDq TlcA== X-Gm-Message-State: APjAAAWLBr6jnf5paFi88u2fgK+deFtRp8X6l6CWFJxUM7vtUm4GNcBj TBA2YJtLDfDWNG3KS12f53o= X-Google-Smtp-Source: APXvYqws4R6S9up3tf3DcRQUtdy18dAnNQih8Vz418pCIqTO1JQRmxIVQ/TmRwb/CotvT6U15aWlAw== X-Received: by 2002:a05:600c:2253:: with SMTP id a19mr15537715wmm.97.1574418524757; Fri, 22 Nov 2019 02:28:44 -0800 (PST) Received: from localhost (prg-ext-pat.suse.com. [213.151.95.130]) by smtp.gmail.com with ESMTPSA id y2sm3231832wmy.2.2019.11.22.02.28.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Nov 2019 02:28:43 -0800 (PST) Date: Fri, 22 Nov 2019 11:28:42 +0100 From: Michal Hocko To: Yafang Shao Cc: Johannes Weiner , Vladimir Davydov , Andrew Morton , Linux MM Subject: Re: [PATCH] mm, memcg: show memcg min setting in oom messages Message-ID: <20191122102842.GR23213@dhcp22.suse.cz> References: <1574239985-1916-1-git-send-email-laoar.shao@gmail.com> <20191120102157.GF23213@dhcp22.suse.cz> <20191120114043.GH23213@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) 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 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. [...] > > > I have said in the commit log, that we don't know why the file cache > > > can't be reclaimed (when evictable is 0 and dirty is 0 as well.) > > > > And the counter argument is that this will not help you there much in > > many large and much more common cases. > > > > I argue, and I might be wrong here so feel free to correct me, that the > > reclaim protection guarantee (min) is something to be under admins > > control. It shouldn't really happen nilly-willy because it has really > > large consequences, the OOM including. So if there is a suspicious > > amount of memory that could be reclaimed normally then the reclaim > > protection is really the first suspect to go after. > > -- > > I don't know whether it happens nilly-willy or not. It is a reclaim protection guarantee (so essentially an mlock like thing) so it better have to be properly considered when used. > But if we all know that it may cause OOMs and it don't take too much > effort to show it in the OOM messages, I do not think we are in agreement here. As mentioned above the oom report is quite heavy already. So it should be other way around. There should be a strong reason to add something more. A real use case where not having that information is making debugging ooms considerably much harder. -- Michal Hocko SUSE Labs