Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2390555ioo; Sat, 28 May 2022 12:08:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzhOprq0XFx/Zl+xK9QwF5U+pQQMRUhQBmaez0bzy/BO3sFb8yq1caL7r1JFBnsPM+FKY7T X-Received: by 2002:a63:8141:0:b0:3fa:aa7e:844d with SMTP id t62-20020a638141000000b003faaa7e844dmr20858837pgd.252.1653764929950; Sat, 28 May 2022 12:08:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653764929; cv=none; d=google.com; s=arc-20160816; b=B7VwRP5oDwPRoWgFTaCJETqQhK7FZa5MKuG8cO5MCHbSnBQHsiTat6nGcdjqgdpP1t vzE3qcesPmL3F0FcTRfjks/rJphMvrtgBJnnNaWSx7b6kQa93Ub8xdFp1V1YH+Dyz8s0 r3s3RcDK1W3b6caWd7H+tDK/A9RNQgOUbRRt4AHiqJoC9h6VsGqLCbg39/RCBLcM2W/j GCim0GqY5ciVl11/kQJzScdJvRKtULRylwGQ3REbtSfAu6Ky+9wzVLWMaNSWdr5Na3vv YAq4dIN8jGvXPp4FdxekNh0+xUSYIXk4eu4lbCc+MoLT3qlsSqqymxmutgTTs/d1g0rk hm3w== 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:date:dkim-signature; bh=ps73Vyt4yN+27PJzPF0JTccmiXVswx7yZqJIriLMxWk=; b=wmYWt8Z/69g1Wg94vsgAh6hbsN41EYx16Rm94evw2sGjKFIOnM2JgE3FrD5Ngk8RGr sAJ6B7RSS9+Z+nqzctjkrhDM5ghhccbBhQOLAKAgJMQz+oyl7KiwG5cigueCnKJB5OtZ kTHsQZ/IjvKUcZ6W161+p4OouCf5S9P15JUI2T2f44CCLERJS2YZ+4je7BjchIyxJCIM XU/PIK2CTdzwXS0nchUy3P1/EhPgGlCH/ZWRix2l+i26NEcTXgI3d2Q85mfjqHJeiQ/4 ove1uqp8G8NhRxd2Gn4ki/7Xgyn59YyPbSi3OyBBbFW2oikzF1upmO5ImLf0ZLJ8BtnO Y3IQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CHS10T2A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id p1-20020a63c141000000b003fbe543bd44si1830535pgi.170.2022.05.28.12.08.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 May 2022 12:08:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CHS10T2A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 729A621E01; Sat, 28 May 2022 11:46:59 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350555AbiE0Jas (ORCPT + 99 others); Fri, 27 May 2022 05:30:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350230AbiE0Jar (ORCPT ); Fri, 27 May 2022 05:30:47 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 00B8266AE2 for ; Fri, 27 May 2022 02:30:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1653643845; 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=ps73Vyt4yN+27PJzPF0JTccmiXVswx7yZqJIriLMxWk=; b=CHS10T2AEDPne/HtUkhr8Rd8UUBrX/xjMG8SXL3rxe8rIgiESMnWcVodxyANIj1qlND0DH DbAE3OGA04f8IRhWHZxKM1VkFiVQCWg3SLCC4YGRDjDergxPkD1poXMyUlbP/G7rTRiWvG AR47g3RoXjJIfBtovA68lxTYmyqMCVk= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-456-iCDgyNaKOam64PAuHzOeKw-1; Fri, 27 May 2022 05:30:41 -0400 X-MC-Unique: iCDgyNaKOam64PAuHzOeKw-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7F80B1D32375; Fri, 27 May 2022 09:30:40 +0000 (UTC) Received: from rh (vpn2-54-35.bne.redhat.com [10.64.54.35]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CF8E0492C3B; Fri, 27 May 2022 09:30:39 +0000 (UTC) Received: from localhost ([::1] helo=rh) by rh with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nuWIm-00CFqS-4E; Fri, 27 May 2022 19:30:36 +1000 Date: Fri, 27 May 2022 19:30:34 +1000 From: Dave Chinner To: Roman Gushchin 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: <20220525202600.2910982-4-roman.gushchin@linux.dev> X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, 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=unavailable 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 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 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? Cheers, Dave. -- Dave Chinner dchinner@redhat.com