mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v1 -next 0/3] Some optimizations about freezer
@ 2024-09-05 13:41 Chen Ridong
  2024-09-05 13:41 ` [PATCH v1 -next 1/3] cgroup/freezer: Reduce redundant traversal for cgroup_freeze Chen Ridong
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Chen Ridong @ 2024-09-05 13:41 UTC (permalink / raw)
  To: tj, lizefan.x, hannes, longman, adityakali, sergeh, mkoutny
  Cc: cgroups, linux-kernel, chenridong

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


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2024-09-10 11:33 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-05 13:41 [PATCH v1 -next 0/3] Some optimizations about freezer Chen Ridong
2024-09-05 13:41 ` [PATCH v1 -next 1/3] cgroup/freezer: Reduce redundant traversal for cgroup_freeze Chen Ridong
2024-09-09 19:01   ` Michal Koutný
2024-09-10  2:39     ` Chen Ridong
2024-09-05 13:41 ` [PATCH v1 -next 2/3] cgroup/freezer: Reduce redundant propagation for cgroup_propagate_frozen Chen Ridong
2024-09-09 19:02   ` Michal Koutný
2024-09-10  3:08     ` Chen Ridong
2024-09-10 11:33       ` Michal Koutný
2024-09-05 13:41 ` [PATCH v1 -next 3/3] cgroup/freezer: Add freeze selftest Chen Ridong
2024-09-09 19:03   ` Michal Koutný
2024-09-10  3:09     ` Chen Ridong
2024-09-09 19:04 ` [PATCH v1 -next 0/3] Some optimizations about freezer Michal Koutný
2024-09-10  3:16   ` Chen Ridong

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®