Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2612858rdb; Mon, 4 Dec 2023 02:33:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IGcOLwr7GY8dU6y0YdIa0oKWNovEIqXziU/HCs8GGxDOgVzWuFxmEmHGyLYRlmQvsp+BB7W X-Received: by 2002:a05:6a20:431a:b0:18f:97c:9261 with SMTP id h26-20020a056a20431a00b0018f097c9261mr1597673pzk.70.1701686011238; Mon, 04 Dec 2023 02:33:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701686011; cv=none; d=google.com; s=arc-20160816; b=Fizc8QP+z8qy4i8y5uexnSBa2Zdxmp6+obcUq8KZQg9mShGlxLToZyNSVv9ajl2Snl FAurrG9YLZc1KZRASUMULI0+0dDoD3UICRNMdkP8/FE/+rMy+kqUeM4Uqv8xtdfYtgHy 43DyQOTQSOvNl1OWCScZl0lWryyXAS0Moz/lB0iNQhnfJZu2Q5iVOKgwhcxwKOcD7y/Y HRnGlpdT6N2QlLOWm8XPRZoKpdXQVgBJo/JBGhEvnp8GZVKPbsgj1OM6kRUIUwo8M125 Ka7qLIbDWL41o9Lb6GD4SYsLq5rEf1yXaTW3l+ZLXZhIiK1T763dRZifHXlJ2HH7td2Z 9aSQ== 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:date; bh=XHo8qUBYA8mjC5LxZXrwwYc/BAZXDSSjs6t81waab/E=; fh=DA+T9F8AovCHKpaTy2H/O7bcQeP85gT8yIWFSGUV5lI=; b=czab+cxyWCZd6N+feB3KolXNTJS0LETZc4BLuppNqWdJF5CPcDYWevwKzdrgz5dgXv KkaA45ICk6h1o2ZrJVO5EGxCTrrPQoKZvtPrS6N8SYcjMVTeBD/oxiweLhLXvuSZ75UA QOPdgddgvWdiXZU2Eo0PMqLYiETr0f+Qo9fTSIKHoaRe6V1Orrc+/EaK9DtWn2MsIBc2 vF/I1e3jxGGsZlnQjXrnMfAi0q++j1puWEZU6w+0ZgmMqp2D66u9WaTE4x/g22CJyOEZ ujgrGL6KdEGmyTznuWX7EPunDelNyvpFDqqjMTklHM1e/uT8H502U16ZnxMi7vE7Ujin g3HA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id do11-20020a056a004a0b00b006cd853221easi7247855pfb.362.2023.12.04.02.33.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 02:33:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 9326B8077492; Mon, 4 Dec 2023 02:33:28 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231817AbjLDKdL (ORCPT + 99 others); Mon, 4 Dec 2023 05:33:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229789AbjLDKdJ (ORCPT ); Mon, 4 Dec 2023 05:33:09 -0500 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2a07:de40:b251:101:10:150:64:2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F25A85 for ; Mon, 4 Dec 2023 02:33:15 -0800 (PST) Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 5B9CC1F8A6; Mon, 4 Dec 2023 10:33:13 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 4138D1398A; Mon, 4 Dec 2023 10:33:13 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id ZoffDemqbWW9VwAAD6G6ig (envelope-from ); Mon, 04 Dec 2023 10:33:13 +0000 Date: Mon, 4 Dec 2023 11:33:12 +0100 From: Michal Hocko To: Kent Overstreet Cc: Roman Gushchin , Qi Zheng , Muchun Song , Linux-MM , linux-kernel@vger.kernel.org, Andrew Morton , Dave Chinner Subject: Re: [PATCH 2/7] mm: shrinker: Add a .to_text() method for shrinkers Message-ID: References: <76A1EE85-B62C-49B3-889C-80F9A2A88040@linux.dev> <20231128035345.5c7yc7jnautjpfoc@moria.home.lan> <20231129231147.7msiocerq7phxnyu@moria.home.lan> <20231201014745.b2ud4w3ymztdtctu@moria.home.lan> <20231201212506.skgzaoafi5zgi3pi@moria.home.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231201212506.skgzaoafi5zgi3pi@moria.home.lan> X-Spamd-Bar: +++++++++++++++ Authentication-Results: smtp-out2.suse.de; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=suse.com (policy=quarantine); spf=fail (smtp-out2.suse.de: domain of mhocko@suse.com does not designate 2a07:de40:b281:104:10:150:64:97 as permitted sender) smtp.mailfrom=mhocko@suse.com X-Rspamd-Server: rspamd2 X-Spamd-Result: default: False [15.00 / 50.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_FAIL(1.00)[-all]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MID_RHS_NOT_FQDN(0.50)[]; DMARC_POLICY_QUARANTINE(1.50)[suse.com : No valid SPF, No valid DKIM,quarantine]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; RCVD_COUNT_THREE(0.00)[3]; MX_GOOD(-0.01)[]; RCPT_COUNT_SEVEN(0.00)[8]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(2.20)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%] X-Spam-Score: 15.00 X-Rspamd-Queue-Id: 5B9CC1F8A6 X-Spam: Yes X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Mon, 04 Dec 2023 02:33:28 -0800 (PST) On Fri 01-12-23 16:25:06, Kent Overstreet wrote: > On Fri, Dec 01, 2023 at 11:04:23AM +0100, Michal Hocko wrote: > > On Thu 30-11-23 20:47:45, Kent Overstreet wrote: > > > On Thu, Nov 30, 2023 at 09:14:35AM +0100, Michal Hocko wrote: > > [...] > > > > All that being said, I am with you on the fact that the oom report in > > > > its current form could see improvements. > > > > > > I'm glad we're finally in agreement on something! > > > > > > If you want to share your own ideas on what could be improved and what > > > you find useful, maybe we could find some more common ground. > > > > One thing that I would consider an improvement is to have a way to > > subscribe drivers with excessive memory consumption or those which are > > struggling to dump their state. > > Remember the memory allocation profiling patchset? The one where you > kept complaining about "maintenancy overhead"? Yes, I still maintain my opinion on that approach. I have never questioned usefulness of the information. > We can plug that into the show_mem report too, and list the top 10 > allocations by file and line number. > > > Maybe your proposal can be extended that way but the crucial point is to > > not dump all sorts of random shrinkers' state and end up with unwieldy > > reports. If, on the other hand, any particular shrinker struggles to > > reclaim memory and it is sitting on a lot of memory it could be able to > > flag itself to be involved in the dump. > > Great, since as was mentioned in the original commit message it's not > "all sorts of random shrinkers", but top 10 by objects reported, what > I've got here should make you happy. Can we do better and make that a shrinker decision rather than an arbitrary top N selection? The thing is that shrinkers might even not matter in many cases so their output would be just a balast. The number of objects is not universaly great choice. As Dave mentioned metdata might be pinning other objects. That being said, if you want to give more debugability power to shrinkers then it makes more sense to allow them to opt-in for the oom report rather than control which of them to involve from the oom reporting code which doesn't have enough context on its own. -- Michal Hocko SUSE Labs