diff options
author | Alexander Pantyukhin <apantykhin@gmail.com> | 2023-01-08 11:50:23 +0100 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2023-01-19 02:12:59 +0100 |
commit | d526643f155c431e8dfef643195f2d636d4e4bb5 (patch) | |
tree | 24ec3cdf399f6e5f166b1cfaa1c0a34d108b4940 /tools/cgroup | |
parent | mm/damon/sysfs-schemes: use strscpy() to instead of strncpy() (diff) | |
download | linux-d526643f155c431e8dfef643195f2d636d4e4bb5.tar.xz linux-d526643f155c431e8dfef643195f2d636d4e4bb5.zip |
tools:cgroup:memcg_shrinker remove redundant import
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/20230108105023.4289-1-apantykhin@gmail.com
Signed-off-by: Alexander Pantyukhin <apantykhin@gmail.com>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'tools/cgroup')
-rw-r--r-- | tools/cgroup/memcg_shrinker.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/tools/cgroup/memcg_shrinker.py b/tools/cgroup/memcg_shrinker.py index 706ab27666a4..e81c3017ada9 100644 --- a/tools/cgroup/memcg_shrinker.py +++ b/tools/cgroup/memcg_shrinker.py @@ -5,7 +5,6 @@ import os import argparse -import sys def scan_cgroups(cgroup_root): @@ -44,7 +43,7 @@ def main(): cgroups = scan_cgroups("/sys/fs/cgroup/") shrinkers = scan_shrinkers("/sys/kernel/debug/shrinker/") - shrinkers = sorted(shrinkers, reverse = True, key = lambda x: x[0]) + shrinkers.sort(reverse = True, key = lambda x: x[0]) n = 0 for s in shrinkers: |