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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 79010C433F5 for ; Fri, 22 Apr 2022 15:10:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AA66A6B0088; Fri, 22 Apr 2022 11:09:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A55B56B0089; Fri, 22 Apr 2022 11:09:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 945456B008A; Fri, 22 Apr 2022 11:09:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.25]) by kanga.kvack.org (Postfix) with ESMTP id 859256B0088 for ; Fri, 22 Apr 2022 11:09:59 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id 67875120636 for ; Fri, 22 Apr 2022 15:09:59 +0000 (UTC) X-FDA: 79384850118.03.24F4CA5 Received: from out1.migadu.com (out1.migadu.com [91.121.223.63]) by imf19.hostedemail.com (Postfix) with ESMTP id 41BA81A002A for ; Fri, 22 Apr 2022 15:09:56 +0000 (UTC) Date: Fri, 22 Apr 2022 08:09:48 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1650640196; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=FuSilkQrD0XHypF9NHM/iQufTOifJtoJtKA0QjM80gQ=; b=ogvZvMz0qmRqn6QDbBgi2ylHy0TQA3uWaXlbE2Qr5PhovLBd6Wn+NU6jdRIreeLszV8F0T 6vKrZZb2n1v73UODttDRnOV+VFz4bTzSb5v8lROD6lWxhYq1rSkVWs2ELGwxEOI0lkMR0a /6VVGN0zpZMKdJS97D22pC8bfMik1wM= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Roman Gushchin To: Michal Hocko Cc: Kent Overstreet , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, hch@lst.de, hannes@cmpxchg.org, akpm@linux-foundation.org, linux-clk@vger.kernel.org, linux-tegra@vger.kernel.org, linux-input@vger.kernel.org Subject: Re: [PATCH v2 8/8] mm: Centralize & improve oom reporting in show_mem.c Message-ID: References: <20220421234837.3629927-1-kent.overstreet@gmail.com> <20220421234837.3629927-14-kent.overstreet@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 41BA81A002A X-Rspam-User: Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=ogvZvMz0; spf=pass (imf19.hostedemail.com: domain of roman.gushchin@linux.dev designates 91.121.223.63 as permitted sender) smtp.mailfrom=roman.gushchin@linux.dev; dmarc=pass (policy=none) header.from=linux.dev X-Stat-Signature: pwzbzhdn6637aekszpcjjqzkp47huem4 X-HE-Tag: 1650640196-505372 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, Apr 22, 2022 at 02:58:19PM +0200, Michal Hocko wrote: > On Thu 21-04-22 19:48:37, Kent Overstreet wrote: > > This patch: > > - Changes show_mem() to always report on slab usage > > - Instead of reporting on all slabs, we only report on top 10 slabs, > > and in sorted order > > As I've already pointed out in the email thread for the previous > version, this would be better in its own patch explaining why we want to > make this unconditional and why to limit the number caches to print. > Why the trashold shouldn't be absolute size based? > > > - Also reports on shrinkers, with the new shrinkers_to_text(). > > Shrinkers need to be included in OOM/allocation failure reporting > > because they're responsible for memory reclaim - if a shrinker isn't > > giving up its memory, we need to know which one and why. > > Again, I do agree that information about shrinkers can be useful but > there are two main things to consider. Do we want to dump that > information unconditionaly? E.g. does it make sense to print for all > allocation requests (even high order, GFP_NOWAIT...)? Should there be > any explicit trigger when to dump this data (like too many shrinkers > failing etc)? To add a concern: largest shrinkers are usually memcg-aware. Scanning over the whole cgroup tree (with potentially hundreds or thousands of cgroups) and over all shrinkers from the oom context sounds like a bad idea to me. IMO it's more appropriate to do from userspace by oomd or a similar daemon, well before the in-kernel OOM kicks in. > > Last but not least let me echo the concern from the other reply. Memory > allocations are not really reasonable to be done from the oom context so > the pr_buf doesn't sound like a good tool here. +1