From: Alexander Pantyukhin <apantykhin@gmail.com>
To: akpm@linux-foundation.org
Cc: linux-kernel@vger.kernel.org, roman.gushchin@linux.dev,
Alexander Pantyukhin <apantykhin@gmail.com>
Subject: [PATCH] tools:cgroup:memcg_shrinker remove redundant import
Date: Sun, 8 Jan 2023 15:50:23 +0500 [thread overview]
Message-ID: <20230108105023.4289-1-apantykhin@gmail.com> (raw)
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.
Signed-off-by: Alexander Pantyukhin <apantykhin@gmail.com>
---
tools/cgroup/memcg_shrinker.py | 3 +--
1 file changed, 1 insertion(+), 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:
--
2.25.1
reply other threads:[~2023-01-08 10:50 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20230108105023.4289-1-apantykhin@gmail.com \
--to=apantykhin@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=roman.gushchin@linux.dev \
/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
all inboxes | Powered by JetHome®