Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Alexander Pantyukhin and committed by
Andrew Morton
d526643f b6f00c91

+1 -2
+1 -2
tools/cgroup/memcg_shrinker.py
··· 5 5 6 6 import os 7 7 import argparse 8 - import sys 9 8 10 9 11 10 def scan_cgroups(cgroup_root): ··· 43 44 44 45 cgroups = scan_cgroups("/sys/fs/cgroup/") 45 46 shrinkers = scan_shrinkers("/sys/kernel/debug/shrinker/") 46 - shrinkers = sorted(shrinkers, reverse = True, key = lambda x: x[0]) 47 + shrinkers.sort(reverse = True, key = lambda x: x[0]) 47 48 48 49 n = 0 49 50 for s in shrinkers: