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 ACF90C46CA3 for ; Mon, 4 Dec 2023 18:16:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4AA006B02DB; Mon, 4 Dec 2023 13:16:02 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4596F6B02DF; Mon, 4 Dec 2023 13:16:02 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 321476B02E0; Mon, 4 Dec 2023 13:16:02 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 1E2666B02DB for ; Mon, 4 Dec 2023 13:16:02 -0500 (EST) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id ECD91A08DF for ; Mon, 4 Dec 2023 18:16:01 +0000 (UTC) X-FDA: 81529939722.16.78DA049 Received: from out-171.mta1.migadu.com (out-171.mta1.migadu.com [95.215.58.171]) by imf02.hostedemail.com (Postfix) with ESMTP id 03B4C80034 for ; Mon, 4 Dec 2023 18:15:58 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=UInPrONm; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf02.hostedemail.com: domain of kent.overstreet@linux.dev designates 95.215.58.171 as permitted sender) smtp.mailfrom=kent.overstreet@linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1701713759; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=xC4jCVvT+IFQ6qX/7Rd+v3ZG1sbqYN9jp27m45RKW54=; b=rXUa+W6N6eFxaFkDpwBpZAiVy9URWxZNa4fwD/ivGGuLSOrFHI1+D8rQw5ijQNVo68cXWL cFlQhlnTU62uLZ3DMPpRA/qAXrA3HEZqLCPjxgJNz+gq46TNcQi0sD1d6WKxDXdnPZ5Oom Xg5LmxkSC35ENHTve1M6dTg+FuaoAIs= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=UInPrONm; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf02.hostedemail.com: domain of kent.overstreet@linux.dev designates 95.215.58.171 as permitted sender) smtp.mailfrom=kent.overstreet@linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1701713759; a=rsa-sha256; cv=none; b=C0ngtzja7bkTmKnieVg39fnhgF+iobCUq2cBJkt0NU/2mekvhJoZaAqjo/EAEaKyUlgbl2 8c7p7pDX7zO7E+8PzdgzsLWGps0lkqTigGnlKPAxy++Ve9YAb9wM19z0wBv1EtMs9pBKiN OQ/oAhKXPDs9z64espXVTdAZvSiIQcQ= 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-Rspamd-Queue-Id: 03B4C80034 X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: m155qcgbehwfpnwx7e7ypipu7adbqjr4 X-HE-Tag: 1701713758-230044 X-HE-Meta: U2FsdGVkX1/cx1wO5LkXZ7cluMM/TweYfkGdYI7/8oyKLwgDtr2Gr3N0fGwtXHLRbkZ2EGw2PJd6Opa1smRn63Y4ma9cDr04BTerJ1SKqO5ZLJEDExt84AnaOfG4ZoM5pFB4Xp+1F0iDbFGPJOWsjtqQ+pa4KO0rhW7c7u4jAHIaA/O8kJp3+IIWkmHNxJD85jKS5kD4XyWJjgnwgiYzbDLKayLW6WmBVothS311Oy1VwgjIa1nzQtI2baCVjcmSzIfCVCUPrzfBBo/1OHkqu/7HIZ+CjYi5coJlB6r3Z7Qq2bY1OsGHEZ04LHi/xrxOBX9gvz76EIYavxg7JAc0epY7byk7ECA7W25UB+Y3XZGZGb5GvYIS3fiH+rl3qd5ARGmNbZlJ69aAAEvjC+f5TPIyS0aYNY4CgIFkPnvnR5r7O9xpdKN9jlWucO9QnaQx4oQJxe0mrKCOjTki/yHJGNJd83b0GLrGXmq5HLVPrUk6VErqiFPj6cRzf4u+eHOnqsfVRp40OnWtZfd/B+MaOjp8KdVtNrSDCMgYLqdMvCMclS9ZQiF13eXTF0H5s+anmOOuSAndzNxBgUD9ilMWl/f8taKmNJmnH6lMOW5egyubCnnd1jrHRxtBZwhzPH/yLZCiF3nmz3U8GjWeNchFGNr0XmhFWFplNexDBt7VNVZ8UNwLagJQ8MJ3RrKhIiEBXx/Qw0Yy52YuLpKU3N6NZTjsessQeSB0S9pjnJvzH7OZXOzZpTPG846WqXdR4z7LoXmaU+zG+oI0Cj1iTz4vAcU7kq3yrpLh8uugrLVKM2DIy+RpZF3SH9IoQYMXkTUiiZSr5H0bqAfB+Gqa/CCTZFxBKhAg+G2sxmbBEh+6QMitfCbGU7Lkxea/n0+7Dmg0etgS+JhMRD76QlBY3sNpvZbyzifzGywXWKA9trE5YgvvGRziVd9Q8t63bv+zc+RAj6kU2/xxZBPPiT5n7Ef KlBjQW43 TYqB0N4JfcqLJvI0el4o1P65S7C1PfUSHYVQh8tFG2raS93BhvBWiplK75ehl615fFP2ssJLSWMHVHNUvOe8RoC3CrGNewouSo0otLlQ/tuBaKHqa6DtN66IB/9pOGRWMoucRxHbVz+g4N18= 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: List-Subscribe: List-Unsubscribe: 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.