Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3583236rdh; Mon, 27 Nov 2023 19:28:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IGwXv1MUav4MCzOMR7P/402k08big26eP9oXvJ6OP44vLZXZTrdo+yv9XVBpJQYbBSozUMJ X-Received: by 2002:a05:6820:809:b0:58d:a6ed:5601 with SMTP id bg9-20020a056820080900b0058da6ed5601mr2854189oob.1.1701142100459; Mon, 27 Nov 2023 19:28:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701142100; cv=none; d=google.com; s=arc-20160816; b=cJgNkq5Pdpm/9E0cyA1zEdKCc5wvhGbRPV2i3kqBje6kw9W4bfmEr+MzoeztmhEr4X FOrCsk0TR8L+giEysUOg66HTNy1OPEiFxIUXwg17GFIGndCWito4aRi7qqle/y7K0oII zSQLSAAsQsbrS3TKHpij77mUEFRrCXpjSpFnO99XKnHmcSc4rjGV0WAoNSxZxyGFLxzx ymrMSwJPpQR2Qq1oQeGway3ejfj2nyrvpHR+sePrWRPe7EoPyiUIcA6vac2c8NMeTqWg BACZK+iR5rYZO+G/qkVQ4Ou5CpfWnBtf3JYv+XoGnaor9UDm9ZTe8Dp1qMHkvSeWBTPt 5Bng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=ia5FEieqmPFOskYCTTUZA+gPEFuSUkjlm/7c2IG4/g8=; fh=RUK2cU99RL4pGnkCo3mz+fZMaprGjFR3rBgTQqzDW9Y=; b=GL6f4qwu1CuLiU3lFv8zRs871XatS6505rnUqaCvdweMbeCx/9etyG3oHOREKzOnaA jNeVvtQ59o+jTExtHS18ybIWQRtJf2hQQVvemb4ryfi1M7ThMpk5dYu7NaoxC+wP8KUP Zb6mxhC+Yl5tS8AVd3pXqdRZsW7i/IcQewbw29Auujs5oynpJDqarwNx564IIok5QxlB n51RKOMKVEVeeJ+QOhi2ilUX/hSJe6QNs6gRdjxC6RzMInyJu9imZp7I76U+SuVikWeH gSGUpDOgE1I4+zgeFvqJVnjuIkpIwKXTlVON3hkQ3o9BQENNl2/7EbVrALs+oxdhIJxN EX/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="ru/a1ZFY"; 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 h1-20020a63c001000000b005b96c2ab110si11069724pgg.131.2023.11.27.19.28.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 19:28:20 -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="ru/a1ZFY"; 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 1D602822F8DE; Mon, 27 Nov 2023 19:28:18 -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 S234572AbjK1D14 (ORCPT + 99 others); Mon, 27 Nov 2023 22:27:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229789AbjK1D1z (ORCPT ); Mon, 27 Nov 2023 22:27:55 -0500 Received: from out-188.mta0.migadu.com (out-188.mta0.migadu.com [91.218.175.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC516CE for ; Mon, 27 Nov 2023 19:27:58 -0800 (PST) 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-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, 27 Nov 2023 19:28:18 -0800 (PST) > 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.=