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 02C30C4167B for ; Tue, 28 Nov 2023 03:28:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8516A6B0294; Mon, 27 Nov 2023 22:28:01 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 801686B0295; Mon, 27 Nov 2023 22:28:01 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6C9AB6B0298; Mon, 27 Nov 2023 22:28:01 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 58CCF6B0294 for ; Mon, 27 Nov 2023 22:28:01 -0500 (EST) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 1EB1E14017C for ; Tue, 28 Nov 2023 03:28:01 +0000 (UTC) X-FDA: 81505929162.23.5D0E743 Received: from out-189.mta0.migadu.com (out-189.mta0.migadu.com [91.218.175.189]) by imf08.hostedemail.com (Postfix) with ESMTP id 3D944160004 for ; Tue, 28 Nov 2023 03:27:58 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b="ru/a1ZFY"; spf=pass (imf08.hostedemail.com: domain of muchun.song@linux.dev designates 91.218.175.189 as permitted sender) smtp.mailfrom=muchun.song@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1701142079; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ia5FEieqmPFOskYCTTUZA+gPEFuSUkjlm/7c2IG4/g8=; b=h9JxZ2p65IYBYg/Yzbhg4JoRsoSwZUTYCola/FIh5w3XA+jzF8kgTeMbo/6HgKHT4TwxxD P3NCfrJtDHH8IDF68vYw83BZE0qNuUWAYYjL/Z01OKhWSZR+H0dvblSfSzKL9qlJuI2cwU Fel34I5vZi4mkomBdmztRkjjj/PfIHE= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1701142079; a=rsa-sha256; cv=none; b=X/s9tQs0C5sP28380QzwOpObP1d7v7hhyhqVXQgU66AV8N3h1dmQpyWCZw+QhN2EigrsMC Yi/LJReRbO6kMf8tg/dGKAGZYb1xYrPAnNpJHWSOxzcjpZYIDJDwfdSdg8sKOw0sEYiRQj 1nmUn3xedJu88zZEMPjxrtx7GThujzM= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b="ru/a1ZFY"; spf=pass (imf08.hostedemail.com: domain of muchun.song@linux.dev designates 91.218.175.189 as permitted sender) smtp.mailfrom=muchun.song@linux.dev; dmarc=pass (policy=none) header.from=linux.dev Content-Type: text/plain; charset=us-ascii DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1701142077; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ia5FEieqmPFOskYCTTUZA+gPEFuSUkjlm/7c2IG4/g8=; b=ru/a1ZFY8Bo3mvKKHLO28+D/W+sXLCDuOyha4vYpgUqppJEAJaj9npBy5qXa+vQOAE2wcW lQ67AtqX73AoNgjFSyP9hAo/Ht/TmAH+sHFoXKk9Iu0S8+DK0UjnNN/rRu6Wf/71UnCqxc MRyjfuwF2xANgfnaKRF/MdgRZKf/J+8= Mime-Version: 1.0 Subject: Re: [PATCH 2/7] mm: shrinker: Add a .to_text() method for shrinkers X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Muchun Song In-Reply-To: <20231125003009.tbaxuquny43uwei3@moria.home.lan> Date: Tue, 28 Nov 2023 11:27:11 +0800 Cc: Qi Zheng , Linux-MM , linux-kernel@vger.kernel.org, Andrew Morton , Roman Gushchin , Dave Chinner Content-Transfer-Encoding: quoted-printable Message-Id: <76A1EE85-B62C-49B3-889C-80F9A2A88040@linux.dev> References: <20231122232515.177833-1-kent.overstreet@linux.dev> <20231122232515.177833-3-kent.overstreet@linux.dev> <20231123212411.s6r5ekvkklvhwfra@moria.home.lan> <4caadff7-1df0-45cc-9d43-e616f9e4ddb3@bytedance.com> <20231125003009.tbaxuquny43uwei3@moria.home.lan> To: Kent Overstreet X-Migadu-Flow: FLOW_OUT X-Stat-Signature: k5dycpfo8rg8shqttwbcqeshw6skxnu3 X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 3D944160004 X-Rspam-User: X-HE-Tag: 1701142078-783129 X-HE-Meta: U2FsdGVkX1/cMF9ahVgbk+8IkVg7nCfnKYpGrgXkDc+JP/Lboe4LcsIVmJZ86tOjG5w2yinPpzyZUmmDqifjNgkQp1Yh5Y7OpAuCW7F3AModOKvebEAvo6TTGVfR4ASFGKQnwaRW8Cj3f7tsePz5DTR0KtH9sPCAoBO5kt8yCD66iQEkapBuG9QtFGbwxIgNyxGwQjmTSzw3SnZWtMpdqopb7gnt4r8qHFmKAcw/7raq/3T7bwV3mbBwPXD+PioaroY2kPWGGpTPT9oJtiDgGsEBoWKhUgszBEPrVA1cZv3/XQ6vdoDU2301r2x4xB0WeYmuAhEwc/9mjxFFIDfaSbFOeiwUfdU7GkCrAFcfFWeQbd0u+zSZiaNT77As4k+QcPACATE2OVrMenRHFHrhsaz3sdcm77tAfPDbME+ICmKP5K7cfPxMf7gBoVdtFLfoufetxDnzlkC71Ub2D/LPKoZuAW9FIcWosyqagJ48ZmJOo9yEr5su13bKl58bUBhM0ly/zzBz790dhGfAjcpaB/jfryCpoZZPsCMm/KhEoeiCJbgbiy8xQvzImF+4aOrGvOzrvSt9vMMtUnvmiQgYX3T5WAKqyCoAbaZMsqsJnalvpKDeSzn+GPFbPlf/V1oS3gwRT1XfE0XJLiy1FJqVjfdrjGTBw/yR35fxYNKoXhzwyCkZdjKybbnxgFX/0uxCpOeTNQfXbKHMdTXUWGs445f4iq1WYecUQNyAiv8l1mPri38TZJJYtC09OhyVbdT/bC0F7FBDe9nRe0ki1SF+/fLJ9jb1v/RF/BXG5mTQt8dZdt32daEN1zkk3Edro+jNkK85tnsvAyMPt4E8V9b/CmM/2Onkbz1cjz6VgsaJp+rHTYVF28aJPso+OXLT+HwzCiLL4fDU6g6QwHgTtR9qeX19hhovmncKcbrwHNS8CUHW2n5lu485ql8tSsyUukJ/9Wp1hvrS8MPp7X9NlsE AZnRJPiu e0jtvb24FuKFFM/16Cq7CSGwye0EfLrAWfvbwN2x4o49SYWPY/qCYTOtR/M48my6ouSYdKiXWnt/nSyD54SfOeLIdlts+xZcOl+3wLNC3A8gc6g06SlzO/q4moDx0yCPD3+ZsqSNf3aokiT/pxB9mvBQSYzeVx1LLu744 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 Nov 25, 2023, at 08:30, Kent Overstreet = wrote: >=20 > On Fri, Nov 24, 2023 at 11:08:11AM +0800, Qi Zheng wrote: >> Hi Kent, >>=20 >> On 2023/11/24 05:24, Kent Overstreet wrote: >>> On Thu, Nov 23, 2023 at 11:32:59AM +0800, Qi Zheng wrote: >>>>> + void (*to_text)(struct seq_buf *, struct shrinker *); >>>>=20 >>>> The "to_text" looks a little strange, how about naming it >>>> "stat_objects"? >>>=20 >>> The convention I've been using heavily in bcachefs is >>> typename_to_text(), or type.to_text(), for debug reports. The >>=20 >> OK. >>=20 >>> consistency is nice. >>=20 >> However, this is inconsistent with the name style of other >> shrinker callbacks. Please use the "objects" suffix. As for >> bcachefs's own callback function, you can use typename_to_text() >> to ensure consistency. >=20 > That would be inconsistent with introducing a convention to the wider > kernel. >=20 I don not think .to_text is a good name. I really do not know what it = means when I first look at this name. I knew you want to report the objects of shrinks, so why not use .report_objects or stat_objects proposed by Qi. Although .to_text is only used by bcachefs now, shrinker is a general = module which is not only serving the bcachefs itself. I think it should be = better to use a more straightforward name. Muchun, Thanks.=