linux-stable/arch/x86
Roman Gushchin e33c267ab7 mm: shrinkers: provide shrinkers with names
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.

The expected format is:
    <subsystem>-<shrinker_type>[:<instance>]-<id>
For some shrinkers an instance can be encoded as (MAJOR:MINOR) pair.

After this change the shrinker debugfs directory looks like:
  $ cd /sys/kernel/debug/shrinker/
  $ ls
    dquota-cache-16     sb-devpts-28     sb-proc-47       sb-tmpfs-42
    mm-shadow-18        sb-devtmpfs-5    sb-proc-48       sb-tmpfs-43
    mm-zspool:zram0-34  sb-hugetlbfs-17  sb-pstore-31     sb-tmpfs-44
    rcu-kfree-0         sb-hugetlbfs-33  sb-rootfs-2      sb-tmpfs-49
    sb-aio-20           sb-iomem-12      sb-securityfs-6  sb-tracefs-13
    sb-anon_inodefs-15  sb-mqueue-21     sb-selinuxfs-22  sb-xfs:vda1-36
    sb-bdev-3           sb-nsfs-4        sb-sockfs-8      sb-zsmalloc-19
    sb-bpf-32           sb-pipefs-14     sb-sysfs-26      thp-deferred_split-10
    sb-btrfs:vda2-24    sb-proc-25       sb-tmpfs-1       thp-zero-9
    sb-cgroup2-30       sb-proc-39       sb-tmpfs-27      xfs-buf:vda1-37
    sb-configfs-23      sb-proc-41       sb-tmpfs-29      xfs-inodegc:vda1-38
    sb-dax-11           sb-proc-45       sb-tmpfs-35
    sb-debugfs-7        sb-proc-46       sb-tmpfs-40

[roman.gushchin@linux.dev: fix build warnings]
  Link: https://lkml.kernel.org/r/Yr+ZTnLb9lJk6fJO@castle
  Reported-by: kernel test robot <lkp@intel.com>
Link: https://lkml.kernel.org/r/20220601032227.4076670-4-roman.gushchin@linux.dev
Signed-off-by: Roman Gushchin <roman.gushchin@linux.dev>
Cc: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: Dave Chinner <dchinner@redhat.com>
Cc: Hillf Danton <hdanton@sina.com>
Cc: Kent Overstreet <kent.overstreet@gmail.com>
Cc: Muchun Song <songmuchun@bytedance.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2022-07-03 18:08:40 -07:00
..
boot Follow-up tweaks for the EFI changes in v5.19 2022-06-03 13:39:30 -07:00
coco x86/tdx: Handle load_unaligned_zeropad() page-cross to a shared page 2022-06-17 15:37:33 -07:00
configs x86/config: Make the x86 defconfigs a bit more usable 2022-03-27 20:58:35 +02:00
crypto crypto: x86 - eliminate anonymous module_init & module_exit 2022-04-08 16:13:31 +08:00
entry kernel-hardening updates for v5.19-rc1 2022-05-24 12:27:09 -07:00
events Two small perf updates: 2022-06-05 10:40:31 -07:00
hyperv x86/Hyper-V: Add SEV negotiate protocol support in Isolation VM 2022-06-15 18:27:40 +00:00
ia32 x86: Remove a.out support 2022-04-11 18:04:27 +02:00
include First batch of EFI fixes for v5.19 2022-06-21 12:20:11 -05:00
kernel X86 updates: 2022-06-19 09:58:28 -05:00
kvm mm: shrinkers: provide shrinkers with names 2022-07-03 18:08:40 -07:00
lib Not a lot of material this cycle. Many singleton patches against various 2022-05-27 11:22:03 -07:00
math-emu x86/32: Remove lazy GS macros 2022-04-14 14:09:43 +02:00
mm mm: avoid unnecessary page fault retires on shared memory types 2022-06-16 19:48:27 -07:00
net bpf, x86: Fix tail call count offset calculation on bpf2bpf call 2022-06-16 21:48:24 +02:00
pci x86/PCI: Revert "x86/PCI: Clip only host bridge windows for E820 regions" 2022-06-17 14:24:14 -05:00
platform arch/x86: replace cpumask_weight with cpumask_empty where appropriate 2022-06-03 06:52:57 -07:00
power x86/cpu: Load microcode during restore_processor_state() 2022-04-19 19:37:05 +02:00
purgatory
ras
realmode Intel Trust Domain Extensions 2022-05-23 17:51:12 -07:00
tools
um um: Fix out-of-bounds read in LDT setup 2022-05-27 09:03:41 +02:00
video
virt/vmx/tdx x86/tdx: Provide common base for SEAMCALL and TDCALL C wrappers 2022-04-07 08:27:50 -07:00
xen xen/virtio: Enable restricted memory access using Xen grant mappings 2022-06-06 16:07:30 +02:00
.gitignore
Kbuild
Kconfig virtio: replace arch_has_restricted_virtio_memory_access() 2022-06-06 08:22:01 +02:00
Kconfig.assembler
Kconfig.cpu
Kconfig.debug x86/Kconfig: Fix indentation of arch/x86/Kconfig.debug 2022-05-25 15:39:27 +02:00
Makefile Kbuild updates for v5.19 2022-05-26 12:09:50 -07:00
Makefile.um
Makefile_32.cpu