[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240905134130.1176443-1-chenridong@huawei.com>
Date: Thu, 5 Sep 2024 13:41:27 +0000
From: Chen Ridong <chenridong@...wei.com>
To: <tj@...nel.org>, <lizefan.x@...edance.com>, <hannes@...xchg.org>,
<longman@...hat.com>, <adityakali@...gle.com>, <sergeh@...nel.org>,
<mkoutny@...e.com>
CC: <cgroups@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<chenridong@...weicloud.com>
Subject: [PATCH v1 -next 0/3] Some optimizations about freezer
We optimized the freezer to reduce redundant loops. We add a selftest to
ensure our optimizations cause no harm, and we confirmed that the
performance can be improved.
We tested the following subtree: D, E, F and G each have n children.
A
/ \
B C
/ | \ \
D E F G
/ | \ \
1-n 1-n 1-n 0-n
Our test is to freeze A B C D E F G, and then unfreeze A B C D E F G.
We measured the elapsed time.
BEFORE(ns) AFTER(ns) SAVED(ns)
n=10 142679950 139666014 3,013,936
n=100 199832160 192773032 7,059,128
n=1000 488595100 414901570 73,693,530
As shown above, the larger the value of n, the more significant the time
savings can be. If tested with a deeper hierarchy, the difference could
become even more apparent.
Chen Ridong (3):
cgroup/freezer: Reduce redundant traversal for cgroup_freeze
cgroup/freezer: Reduce redundant propagation for
cgroup_propagate_frozen
cgroup/freezer: Add freeze selftest
include/linux/cgroup-defs.h | 2 +-
kernel/cgroup/freezer.c | 72 ++++++++----
.../testing/selftests/cgroup/test_freezer.sh | 111 ++++++++++++++++++
3 files changed, 160 insertions(+), 25 deletions(-)
create mode 100755 tools/testing/selftests/cgroup/test_freezer.sh
--
2.34.1
Powered by blists - more mailing lists