Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp793203pxb; Fri, 22 Apr 2022 11:15:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzIp3fESNkxo04fRcvoKdoAlhKweRS/2ZvWmCuypqKVoIG5auKovLJiRzLDBoH5R5BDxEyj X-Received: by 2002:a05:6a00:3014:b0:50c:eb87:4438 with SMTP id ay20-20020a056a00301400b0050ceb874438mr4697775pfb.43.1650651333843; Fri, 22 Apr 2022 11:15:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650651333; cv=none; d=google.com; s=arc-20160816; b=yrjZoUtiTrZ1ymhdKFYlF26HT95wwmF4g2PysNwD/iYkh3s6fTpXQUHvz1uBfhyL9Y MgFdaMunnV/6H1Z0p0seRzaVcTnFXriMRtOzLgtdC4uvktHzeYW7gtZktZ1yKGKd1Mqo hinn69QdnnEVnijsqEjInGKfAIVeBbIwls/BIG4w0zZqtenJs50Fk8ldKBhs00NSvyRd mQM7eqnQtXM6I1rlNAs1lemHCVJPMdFAjM7ZiaYF1UasEddWiFrl+ValPWgZIt/cJVrM EeytrIedaUhozIcxolxXhhIdUQ8UkuMLV86u9vOXnOSOy+gDPGepoCCAYooegHeQ7eAm lR3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:dkim-signature:date; bh=FuSilkQrD0XHypF9NHM/iQufTOifJtoJtKA0QjM80gQ=; b=JWMwmlP2Se66ZfERQB9Vnplmdvx1wG13Pf6sbcTtc0bR//8nr39kcepYlLhra1jenY 74u19S0kpg66w5nnFos9qSRFWS1KwJowzOo2Yn4zbXn27oMXAp6DM+mIxjxlIrSJEfJg B4dBz5I/a18R9El6ivPcj8J+Meox/mkEoBp8QguyFl3P9mWrDLMTB5yEbSyjF+mvnV5b z3yKcw3SLSGJpS1Z2iDzxrBJx13iH/u4+TqNFU5d1/CBiAeNtZF/vz20GIeA2dVwthoS 4mVBO45OCn1TzjmZ/op002rY6KokHbMFFuTwyAsP5ZBgxyr9IAAmLC5fOd3qqp+imS7d TVZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=ogvZvMz0; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id q14-20020a65684e000000b0039dae8c6305si9168630pgt.471.2022.04.22.11.15.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 11:15:33 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=ogvZvMz0; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6E2C0102CE4; Fri, 22 Apr 2022 10:49:56 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1449249AbiDVPNq (ORCPT + 99 others); Fri, 22 Apr 2022 11:13:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1449230AbiDVPMy (ORCPT ); Fri, 22 Apr 2022 11:12:54 -0400 Received: from out1.migadu.com (out1.migadu.com [91.121.223.63]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0CB1F1083; Fri, 22 Apr 2022 08:09:58 -0700 (PDT) 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-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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