linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] mm/swap_cgroup: remove global swap cgroup lock
@ 2024-12-02 18:41 Kairui Song
  2024-12-02 18:41 ` [PATCH 1/4] mm, memcontrol: avoid duplicated memcg enable check Kairui Song
                   ` (3 more replies)
  0 siblings, 4 replies; 31+ messages in thread
From: Kairui Song @ 2024-12-02 18:41 UTC (permalink / raw)
  To: linux-mm
  Cc: Andrew Morton, Chris Li, Hugh Dickins, Huang, Ying, Yosry Ahmed,
	Roman Gushchin, Shakeel Butt, Johannes Weiner, Barry Song,
	Michal Hocko, linux-kernel, Kairui Song

From: Kairui Song <kasong@tencent.com>

This series removes the global swap cgroup lock. The critical section of
this lock is minimal but it's still a bottle neck for mass parallel
swap workloads.

Improvement of this series is more significant after the si lock rework:
https://lore.kernel.org/linux-mm/20241022192451.38138-1-ryncsn@gmail.com/
But this series works very well on its own.

Testing using 64G brd and build with build kernel with make -j96 in 1.5G
memory cgroup using 4k folios showed below improvement (10 test run):

Before this series:
Sys time: 10730.08 (stdev 49.030728)
Real time: 171.03 (stdev 0.850355)

After this series:
Sys time: 9612.24 (stdev 66.310789), -10.42%
Real time: 159.78 (stdev 0.577193), -6.57%

With 64k folios and 2G memcg:
Before this series:
Sys time: 7626.77 (stdev 43.545517)
Real time: 136.22 (stdev 1.265544)

After this series:
Sys time: 6936.03 (stdev 39.996280), -9.06%
Real time: 129.65 (stdev 0.880039), -4.82%

Sequential swapout of 8G 4k zero folios (24 test run):
Before this series:
5461409.12 us (stdev 183957.827084)

After this commit:
5420447.26 us (stdev 196419.240317)

Kairui Song (4):
  mm, memcontrol: avoid duplicated memcg enable check
  mm/swap_cgroup: remove swap_cgroup_cmpxchg
  mm/swap_cgroup: simplify swap cgroup definitions
  mm, swap_cgroup: remove global swap cgroup lock

 include/linux/swap_cgroup.h |   2 -
 mm/memcontrol.c             |   2 +-
 mm/swap_cgroup.c            | 110 ++++++++++++++++--------------------
 3 files changed, 51 insertions(+), 63 deletions(-)

-- 
2.47.0



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

end of thread, other threads:[~2024-12-10  8:15 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-02 18:41 [PATCH 0/4] mm/swap_cgroup: remove global swap cgroup lock Kairui Song
2024-12-02 18:41 ` [PATCH 1/4] mm, memcontrol: avoid duplicated memcg enable check Kairui Song
2024-12-02 19:10   ` Yosry Ahmed
2024-12-03  8:25     ` Kairui Song
2024-12-03 18:28       ` Chris Li
2024-12-04 17:05       ` Shakeel Butt
2024-12-02 21:37   ` Shakeel Butt
2024-12-02 22:27   ` Roman Gushchin
2024-12-03  0:24   ` Barry Song
2024-12-03  2:03   ` kernel test robot
2024-12-03  5:42   ` kernel test robot
2024-12-02 18:41 ` [PATCH 2/4] mm/swap_cgroup: remove swap_cgroup_cmpxchg Kairui Song
2024-12-02 19:11   ` Yosry Ahmed
2024-12-02 21:38   ` Shakeel Butt
2024-12-02 22:28   ` Roman Gushchin
2024-12-03 18:29   ` Chris Li
2024-12-02 18:41 ` [PATCH 3/4] mm/swap_cgroup: simplify swap cgroup definitions Kairui Song
2024-12-02 19:25   ` Yosry Ahmed
2024-12-04 21:14     ` Chris Li
2024-12-10  8:15     ` Kairui Song
2024-12-02 22:34   ` Roman Gushchin
2024-12-02 18:41 ` [PATCH 4/4] mm, swap_cgroup: remove global swap cgroup lock Kairui Song
2024-12-02 19:28   ` Yosry Ahmed
2024-12-02 20:35     ` Yosry Ahmed
2024-12-03 18:20       ` Kairui Song
2024-12-03 19:17         ` Yosry Ahmed
2024-12-04 17:58           ` Kairui Song
2024-12-04 18:57             ` Yosry Ahmed
2024-12-02 19:37   ` Yosry Ahmed
2024-12-04 19:34   ` Chris Li
2024-12-10  7:05     ` Kairui Song

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox