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 37647C4167B for ; Mon, 4 Dec 2023 10:33:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C29DF6B0257; Mon, 4 Dec 2023 05:33:17 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BB2966B0296; Mon, 4 Dec 2023 05:33:17 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A544B6B0297; Mon, 4 Dec 2023 05:33:17 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 91C186B0257 for ; Mon, 4 Dec 2023 05:33:17 -0500 (EST) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 668391A018B for ; Mon, 4 Dec 2023 10:33:17 +0000 (UTC) X-FDA: 81528773634.18.4E3B244 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by imf20.hostedemail.com (Postfix) with ESMTP id 2EB4D1C0022 for ; Mon, 4 Dec 2023 10:33:14 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=none; spf=pass (imf20.hostedemail.com: domain of mhocko@suse.com designates 195.135.223.131 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1701685995; 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; bh=XHo8qUBYA8mjC5LxZXrwwYc/BAZXDSSjs6t81waab/E=; b=OhxgDoAxcRS+YXItFcth6J9ZgdU+sWeG17+XZ94vpmgRtrSCRXLtkSVgeHGBdEaAtAmLND 3964jyu1ftkWrVW2+5PW9+EZZdbog4oi8sbzOI5m7cWclrCvsFphKcC6XKyFdcJgfFZWRd Q46An2YINAFa7yl7NNJMKN0m1n9kz2c= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1701685995; a=rsa-sha256; cv=none; b=fJ3fy+hEHP6gusrJ9sFFztS/biLKKwgGdPdpVqSwJZZYydBt39O8A/gzHzctKeFSTtbFWz EnEwTxf50MNsWLC31Xfy2Ycvxj/hfNhbAN+JYqUqe1+jsLZL1oEy4gIj9WYvTl+JG08mEI ACmMhW0qPiGvYMsGNZT8qr+ryvs183M= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=none; spf=pass (imf20.hostedemail.com: domain of mhocko@suse.com designates 195.135.223.131 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com 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: +++++++++++++++ X-Spam: Yes X-Rspamd-Queue-Id: 2EB4D1C0022 X-Rspam-User: X-Stat-Signature: 3963898yy6gs6jr197qwrks9zs6ry8w6 X-Rspamd-Server: rspam03 X-HE-Tag: 1701685994-330025 X-HE-Meta: U2FsdGVkX1/KsOTfMoBXNUvk4SBtFPfDWOi1eLBHqUclPPWiRbRiRJpz6t9zXCVHHrX3KVNjZgtjh8JBWAvuOWV0r5S3mEfu5a7xVfDNz0LSU7Igk3g2yBjB8NamjnUVznD0+0lMI0UrS234Do6AdD7u16BASIuFfsCVRzifTMPPHMeHO6ko7BC7AUajNlwZsNcx0QIfyScuLHWx5txtiZsF5pWxtajRPaGItnCEWiAS/fjFkP20R83GplLbbFOiHjKz8+otUSyFz2LhZU7HHoSVL59xSvq6Krtu+FhfvlLHn+/7/5rInc8O2mVyAtDcHwhk/J0hf3bToyzi69k2upsffyqlE8fqbjVzbr21cJFLxJQG7tjKnsgqLPAatQCNg/zJAGMwMIbkubeHQAT91v+nREC0d1DSr64XomFLYg7tcv0ZCph7ezATLLc6K6DKMBWBLnB5UY48IoxHDY40CsdcnO2tLhd38u4jD5Kj/x04Al2ZMZ7qrQN54S4WCrB/mMi6mi3xfAZZ0taKrau5jWTTKRIa0wK9QufhhuSdKYLo3hacaa4BW0smvYqeAnj6xCIUY6XxijBZ+24v8EyTal9n4X3QPeL7M78p7CZZxz4vdPHQFjwri+Z4HodZ8AZ/yPWLVrRRFBtj1Oa4n5tAEvfhriKYXs07q1wU9QRQB0mEqRU3wVe2HXbQhF91gMF4S10/Glsjp7h5pu0H+G4sip9T9ajRTHIVmRgGe/kY0c35cGOq0fnW4aIWiLs+Mj3s0KSkEWamSkL1wMXV5kkluYRFwo9rBU4mdmrLCii4NgjCLfaluKSKcOuSiBXonPCtlr05YmBQH+sT5/cKXQvWluXdzzZzOKz4K2XHjluSxZ/l0lxjX6uNhpSjD6SPhTYxDfNQ2T7E4clv/HFwcIaoJSWYuCsBGCMrBnHMFVb9GRyVPwF0wVtRz+PLBPIAZ7+AgXSLIj6OKgzDwCyVbyE OXFvyiWv cSjIYuz/spREkAtnkM1sBR1r/MfA+/VwW3ScME087uVZChCQvG9HGxg03X059tkP5b9v4s6AMjlqkObO8/PkXuqaXarxxXh/GmEP2tIoYyxu7ucUgP8N2cBy+4ZamilZm2xB+09zeejDmlvQN62su810Dym17XVUBpyrl8+GgdgUrrvzFiEnZtnSNKNIE0EEntqNXqZ7tTmWDq0TCvumO0vkeeVqmCsxor15/IlU9dC6xHzl2rULwE8zhX6lb8VwxlDsfnZqTljKk+NQ= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000106, 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 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