Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2894126rdb; Mon, 4 Dec 2023 10:16:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IHeqDuJm+AfiD2yvTw7wX7/kJIE1BNP5c5p1g6K6eD364gK7b/N1uEN/bQb1nFBnXqvwNmL X-Received: by 2002:a05:6a20:7493:b0:18f:97c:615e with SMTP id p19-20020a056a20749300b0018f097c615emr5184972pzd.91.1701713793089; Mon, 04 Dec 2023 10:16:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701713793; cv=none; d=google.com; s=arc-20160816; b=ZEjkzZ10W85uS7sCUPDusetoQR4M6Oig1ov7L2EYeEwGf8/3I5S+NRBmN4G3DJcPLn qd8set3pKxhI6sSTFwYFstFUlMf7L59ZanJwPf+2r95oaowDDwYC2Q3Q6ydIruafXs34 3GnrJwF0eXWAGCL/8pp8Ku4taRRhA4Z7zHeYrJaTpSic6+MLI8B2LAaeCDhDhk23un3h St98Uuz0cEbfOw8HTt2JUKnrlJBspuVyy0cMkCs6gYAiV9wIIQ7X+qz5Oi/fwtMkDg4x SGEfi+iu4CZ4o79cWQXWoeexQDwSgz25I/pUMHjB9jWOrak9ZkdI4ynFoIHPhgHowkV2 T5dg== 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=xC4jCVvT+IFQ6qX/7Rd+v3ZG1sbqYN9jp27m45RKW54=; fh=sP08z9fNV69tvFjtJ+r75WmUf6uZHuzd+w00qqhGM8s=; b=n1FwWHaWBWaUvxuhI6LT/9B3LVg8aNCbuNOiKnRi0ZdoiVrnF6fj6q/FDpglK9ZIbc LHgWsx1RN2TXqOSH2pX5MzJyCwtt5EgFEjO0Yp1BSe/28Ghg+EctHFj99WUb3a1lGscf /OtMzF8eJd1Co9FgOdk/n1IEFDW7/UvVDyyD8crQiE7wbq1Izs3nX1ObKc5fUCbt+hBD COzjCyaV4atECXlR6DquiNftMJoqEmHKzK0/+8Fm9O/66aCiyjrMvX0NyWn7iUGdNUqA 3oJaa3rYe5XTMeWeSErv670mz8ahvdQwmId9UrVgF/GoOCoNXubx7BDCmFpSWue36cFe WvJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=UInPrONm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id fa11-20020a056a002d0b00b006ce05b64d14si5766089pfb.93.2023.12.04.10.16.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 10:16:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=UInPrONm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 772B08091C77; Mon, 4 Dec 2023 10:16:30 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231922AbjLDSPy (ORCPT + 99 others); Mon, 4 Dec 2023 13:15:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231783AbjLDSPx (ORCPT ); Mon, 4 Dec 2023 13:15:53 -0500 Received: from out-183.mta1.migadu.com (out-183.mta1.migadu.com [95.215.58.183]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3E0BCA for ; Mon, 4 Dec 2023 10:15:58 -0800 (PST) Date: Mon, 4 Dec 2023 13:15:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1701713756; 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=xC4jCVvT+IFQ6qX/7Rd+v3ZG1sbqYN9jp27m45RKW54=; b=UInPrONmCV4wOdcNrtM+3QKuViLTgz3GTf2O+imE34q5jZJZWmag47hsLh1rGFQh7N2A06 qITVIBE9zgAidF9KNEnWUrz6bRgzRRoe3BTqo51XOnC76bY3uIRfgfkCLdOdLu2FtAAIVG r8ZFMCosxb6H6BFvH3WEvhQCnFDR3MI= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Michal Hocko 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: <20231204181553.tyxeq7zy54cuc3o7@moria.home.lan> References: <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: X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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 howler.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 (howler.vger.email [0.0.0.0]); Mon, 04 Dec 2023 10:16:30 -0800 (PST) On Mon, Dec 04, 2023 at 11:33:12AM +0100, Michal Hocko wrote: > 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. If you've got an idea for a refinement, please submit your own patch and I'll look at incorporating it into the series.