aboutsummaryrefslogtreecommitdiff
path: root/tools/cgroup/memcg_shrinker.py
AgeCommit message (Collapse)AuthorFilesLines
2023-01-18tools:cgroup:memcg_shrinker remove redundant importAlexander Pantyukhin1-2/+1
Remove redundant import of the sys module. Also use the sort function instead of sorted. It sorts the direct array without create the new one in memory. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Alexander Pantyukhin <[email protected]> Cc: Roman Gushchin <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
2022-07-03tools: add memcg_shrinker.pyRoman Gushchin1-0/+71
Add a simple tool which prints a sorted list of shrinker lists in the following format: (number of objects, shrinker name, cgroup). Example: $ ./memcg_shrinker.py -n 10 2090 sb-sysfs-26 /sys/fs/cgroup/system.slice 1809 sb-sysfs-26 /sys/fs/cgroup/system.slice/systemd-udevd.service 1044 sb-btrfs:vda2-24 /sys/fs/cgroup/system.slice/system-dbus\x2d:1.3\... 861 sb-btrfs:vda2-24 /sys/fs/cgroup/system.slice/system-dbus\x2d:1.3\... 804 sb-btrfs:vda2-24 /sys/fs/cgroup/system.slice 643 sb-btrfs:vda2-24 /sys/fs/cgroup/system.slice/firewalld.service 616 sb-cgroup2-30 /sys/fs/cgroup/init.scope 275 sb-sysfs-26 / 238 sb-proc-25 /sys/fs/cgroup/system.slice/systemd-journald.service 225 sb-proc-25 /sys/fs/cgroup/system.slice/abrtd.service Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Roman Gushchin <[email protected]> Cc: Christophe JAILLET <[email protected]> Cc: Dave Chinner <[email protected]> Cc: Hillf Danton <[email protected]> Cc: Kent Overstreet <[email protected]> Cc: Muchun Song <[email protected]> Signed-off-by: Andrew Morton <[email protected]>