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 2E504C433F5 for ; Tue, 24 May 2022 23:54:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8AE168D0003; Tue, 24 May 2022 19:54:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 85D088D0002; Tue, 24 May 2022 19:54:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 74A648D0003; Tue, 24 May 2022 19:54:43 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 65E0B8D0002 for ; Tue, 24 May 2022 19:54:43 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 2E91120CC7 for ; Tue, 24 May 2022 23:54:43 +0000 (UTC) X-FDA: 79502294046.25.D800897 Received: from out1.migadu.com (out1.migadu.com [91.121.223.63]) by imf29.hostedemail.com (Postfix) with ESMTP id A5C4712002D for ; Tue, 24 May 2022 23:54:31 +0000 (UTC) Date: Tue, 24 May 2022 16:54:29 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1653436480; 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=B3ex7fouBs2nWyDrjcuMtV8BsfokIFm1NkzfQJuKMiw=; b=VZNDt5rZcr47yLx7LWHhWAcblryVVE4AlHwuRKBn+DyOaoDECsV8BODUN+sYkXDXQkoqDQ ZNnzvGZ2U42Z5R4c//nltLM+Vw8OW0ykAJS6Bm0w9w1kZ3NajEjp3NrWByPhfBXxCamyms ONIwtgCxfWs/QJWpJrUXkd4pGf9tJcY= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Roman Gushchin To: Dave Chinner Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Kent Overstreet , Hillf Danton , Christophe JAILLET Subject: Re: [PATCH v3 3/6] mm: shrinkers: provide shrinkers with names Message-ID: References: <20220509183820.573666-1-roman.gushchin@linux.dev> <20220509183820.573666-4-roman.gushchin@linux.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: A5C4712002D X-Stat-Signature: kys7x4wdyrqrj7i76ouxj9u8po51dae5 X-Rspam-User: Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=VZNDt5rZ; spf=pass (imf29.hostedemail.com: domain of roman.gushchin@linux.dev designates 91.121.223.63 as permitted sender) smtp.mailfrom=roman.gushchin@linux.dev; dmarc=pass (policy=none) header.from=linux.dev X-HE-Tag: 1653436471-692534 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: On Mon, May 23, 2022 at 07:18:27PM -0700, Roman Gushchin wrote: > On Mon, May 23, 2022 at 08:13:41AM +1000, Dave Chinner wrote: > > On Mon, May 09, 2022 at 11:38:17AM -0700, Roman Gushchin wrote: > > > Currently shrinkers are anonymous objects. For debugging purposes they > > > can be identified by count/scan function names, but it's not always > > > useful: e.g. for superblock's shrinkers it's nice to have at least > > > an idea of to which superblock the shrinker belongs. > > > > > > This commit adds names to shrinkers. register_shrinker() and > > > prealloc_shrinker() functions are extended to take a format and > > > arguments to master a name. > > > > > > In some cases it's not possible to determine a good name at the time > > > when a shrinker is allocated. For such cases shrinker_debugfs_rename() > > > is provided. > > > > > > After this change the shrinker debugfs directory looks like: > > > $ cd /sys/kernel/debug/shrinker/ > > > $ ls > > > dqcache-16 sb-hugetlbfs-17 sb-rootfs-2 sb-tmpfs-50 > > > kfree_rcu-0 sb-hugetlbfs-33 sb-securityfs-6 sb-tracefs-13 > > > sb-aio-20 sb-iomem-12 sb-selinuxfs-22 sb-xfs:vda1-36 > > > sb-anon_inodefs-15 sb-mqueue-21 sb-sockfs-8 sb-zsmalloc-19 > > > sb-bdev-3 sb-nsfs-4 sb-sysfs-26 shadow-18 > > > sb-bpf-32 sb-pipefs-14 sb-tmpfs-1 thp_deferred_split-10 > > > sb-btrfs:vda2-24 sb-proc-25 sb-tmpfs-27 thp_zero-9 > > > sb-cgroup2-30 sb-proc-39 sb-tmpfs-29 xfs_buf-37 > > > sb-configfs-23 sb-proc-41 sb-tmpfs-35 xfs_inodegc-38 > > ^^^^^^^^^^^^^^ > > > > These XFS shrinkers are also per-block device like the superblock. > > They need to read like "sb-xfs:vda1-36". and even though it is not > > in this list, the xfs dquot shrinker will need this as well. > > Sure, will do in v4. Thanks! > > > > > > > > sb-dax-11 sb-proc-45 sb-tmpfs-40 zspool-34 > > > sb-debugfs-7 sb-proc-46 sb-tmpfs-42 > > > sb-devpts-28 sb-proc-47 sb-tmpfs-43 > > > sb-devtmpfs-5 sb-pstore-31 sb-tmpfs-44 > > > > The proc and tmpfs shrinkers have the same problem - what instance > > do they actually refer to? > > Any ideas on how to name/identify them? I've looked a bit into it and realized I've no good idea: I naively thought that procfs sb's have different pid namespaces, but it's not true anymore. So I've no idea how to identify them. The same applies to tmpfs instances, no simple id. If somebody has any ideas, I'd appreciate. If not, we can enhance it later. Thanks!