Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2440191ioo; Sat, 28 May 2022 13:46:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxFcWEv8S6hfGrlHUjW2J4XsazZM84PrMklOvNkCSOkL6weBLmSIioDvwzuSojXr6p3KevO X-Received: by 2002:a17:902:bd05:b0:158:544d:6557 with SMTP id p5-20020a170902bd0500b00158544d6557mr49920401pls.70.1653770794001; Sat, 28 May 2022 13:46:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653770793; cv=none; d=google.com; s=arc-20160816; b=bx7WiA3j1ZpDE3Re7uDpSjnkU1PZxxTBTYOoZlJwaSdwg5BayJ/Gg7EAMX9snWhTlt zJFcZOd0ojJ8fQNhejgsYTVTN1awVJOroWI4Oh4W4gZ4tgjlBvWC6KpacKFUCiT+Bbfw MBTmSD12Muwhpz32EoSFX3aAJHRmHFphoXkBgClD3QUI6roAq68Mzu6q2iA97hje7EPn wHv5SBXGPOzbN/cRqLpAi3hjPvZz3DJJf9we6LrcyGTC1m8ri5bfAGa9VQXalxhFP42d HyDuan3AekXs41jiQk5XR8kUPSlRcmroSzmn0RlYryOYBUrCe4ELYlG1KRF9ax1Q/B69 kMRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:dkim-signature:date; bh=AaaAMzLpeI48jX20qadDEE94Y5QgilfKbSZgSl/Mg04=; b=SMtid5xshIbtkahKLWokaiNG52jxINOHU09mbEZeumEVaGxArFqXgf85CsDEf516y5 hZWKVbECBO0f92N0hx8lzoD2AqNIMmlrMSitPIizpUhLCGdLi90pTNvEHBvUSlX/zeeo Z5kMQZgp0FYGfoJlp8iheFpo1uaaunrLHjyEwhmw90t0V6Q7TX6r4yAu9tjKGcunjlje eBFMPSqCh973Ho/whRiEF2krzLJLTqGG4LXNJIcSdvGLjFuu7JQ+ox7aF7Si7PaPA7RB PemBAF88lGZ+NOJED1zYPJNG0H7xs5AktEQZ/MK9JpbKIjonwk5nTZB3fFEKQlyUYBdT ULMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=WgGWiCdD; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id h5-20020a170902b94500b0015838c0eedbsi9109473pls.506.2022.05.28.13.46.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 May 2022 13:46:33 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=WgGWiCdD; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CD2631C2048; Sat, 28 May 2022 12:46:16 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243648AbiE0SA3 (ORCPT + 99 others); Fri, 27 May 2022 14:00:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236195AbiE0SA0 (ORCPT ); Fri, 27 May 2022 14:00:26 -0400 Received: from out2.migadu.com (out2.migadu.com [IPv6:2001:41d0:2:aacc::]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3453550B12 for ; Fri, 27 May 2022 11:00:24 -0700 (PDT) Date: Fri, 27 May 2022 11:00:17 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1653674423; 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=AaaAMzLpeI48jX20qadDEE94Y5QgilfKbSZgSl/Mg04=; b=WgGWiCdDkR17PNNmWrPNLcWUAjlERKTL2FiPPNCewH8GcKY1d+hbVdm9ms+2QpSeBpMc0g ge7HpZJh3TJcC8qK66q1oOVlCFXgohOpE7nPzpF1akuVaUy7K4YL7zkq0k1FGeFxnADG0F lJlhCW/iDMNlWLI1Qu/vGjc395PNvyw= 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 , Muchun Song Subject: Re: [PATCH v4 3/6] mm: shrinkers: provide shrinkers with names Message-ID: References: <20220525202600.2910982-1-roman.gushchin@linux.dev> <20220525202600.2910982-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-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 27, 2022 at 07:30:34PM +1000, Dave Chinner wrote: > On Wed, May 25, 2022 at 01:25:57PM -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-49 > > 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-vda1-37 > > sb-configfs-23 sb-proc-41 sb-tmpfs-35 xfs_inodegc-vda1-38 > > sb-xfs:vda1-36 > xfs_buf-vda1-37 > xfs_inodegc-vda1-38 > > That's a parsing nightmare right there. Please use the same format > for everything. You have -:- for > superblock stuff, but _-- for the XFS > stuff. Make it consistent so we aren't reduced to pulling out our > hair trying to parse this in any useful way: > > sb-xfs:vda1-36 > xfs-buf:vda1-37 > xfs-inodegc:vda1-38 Ok, good point, will do in the next version. > > FWIW, how we are supposed to know what actually owns these: > > sb-tmpfs-1 > sb-tmpfs-27 > sb-tmpfs-29 > sb-tmpfs-35 > sb-tmpfs-49 > > tmpfs-27 might own all the memory - how do we link that back to a > mount point, container, user, workload, etc? I agree, but I've no good idea what to use as an id. We can't put the mount point, user, group etc together in the file name - it will be too lengthy (and mount namespaces are making it even more complicated). Maybe we can add a symlink to the mount point from within the directory? Do you have any ideas here? Thanks!