From: Roman Gushchin <roman.gushchin@linux.dev>
To: Dave Chinner <dchinner@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Kent Overstreet <kent.overstreet@gmail.com>,
Hillf Danton <hdanton@sina.com>,
Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
Muchun Song <songmuchun@bytedance.com>
Subject: Re: [PATCH v4 3/6] mm: shrinkers: provide shrinkers with names
Date: Fri, 27 May 2022 11:00:17 -0700 [thread overview]
Message-ID: <YpERsTsgjlGYEnDv@carbon> (raw)
In-Reply-To: <YpCaOmL2NfcLEAHi@rh>
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 <subsystem>-<type>:<instance>-<id> for
> superblock stuff, but <subsys>_<type>-<instance>-<id> 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!
next prev parent reply other threads:[~2022-05-27 18:00 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-25 20:25 [PATCH v4 0/6] mm: introduce shrinker debugfs interface Roman Gushchin
2022-05-25 20:25 ` [PATCH v4 1/6] mm: memcontrol: introduce mem_cgroup_ino() and mem_cgroup_get_from_ino() Roman Gushchin
2022-05-26 1:53 ` Muchun Song
2022-05-25 20:25 ` [PATCH v4 2/6] mm: shrinkers: introduce debugfs interface for memory shrinkers Roman Gushchin
2022-05-26 1:58 ` Muchun Song
2022-05-25 20:25 ` [PATCH v4 3/6] mm: shrinkers: provide shrinkers with names Roman Gushchin
2022-05-27 9:30 ` Dave Chinner
2022-05-27 18:00 ` Roman Gushchin [this message]
2022-05-25 20:25 ` [PATCH v4 4/6] mm: docs: document shrinker debugfs Roman Gushchin
2022-05-26 2:01 ` Muchun Song
2022-05-26 2:25 ` Muchun Song
2022-05-26 20:35 ` Roman Gushchin
2022-05-25 20:25 ` [PATCH v4 5/6] tools: add memcg_shrinker.py Roman Gushchin
2022-05-25 20:26 ` [PATCH v4 6/6] mm: shrinkers: add scan interface for shrinker debugfs Roman Gushchin
2022-05-26 3:46 ` Muchun Song
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YpERsTsgjlGYEnDv@carbon \
--to=roman.gushchin@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=christophe.jaillet@wanadoo.fr \
--cc=dchinner@redhat.com \
--cc=hdanton@sina.com \
--cc=kent.overstreet@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=songmuchun@bytedance.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).