linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/4] mm/swap_cgroup: remove global swap cgroup lock
@ 2024-12-18 11:46 Kairui Song
  2024-12-18 11:46 ` [PATCH v3 1/4] mm, memcontrol: avoid duplicated memcg enable check Kairui Song
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Kairui Song @ 2024-12-18 11:46 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 very short but it's still a bottle neck for mass parallel
swap workloads.

Up to 10% performance gain for tmpfs build kernel test on a 48c96t
system under memory pressure, and no regression for other cases:

V2: https://lore.kernel.org/linux-mm/20241210092805.87281-1-ryncsn@gmail.com/
Updates since V2:
- Micro optimization for bit operations in patch 3 [Chris Li]
- Improve BUILD_BUG_ON to cover potential arch corner cases [Chris Li]
- Introduce patch 4, make the swap_cgroup tracking code more
   robust [Chris Li]

V1: https://lore.kernel.org/linux-mm/20241202184154.19321-1-ryncsn@gmail.com/
Updates since V1:
- Collect Review and Ack.
- Use bit shift instead of a mixed usage of short and atomic for
  emulating 2 byte xchg [Chris Li]
- Merge patch 3 into patch 4 for simplicity [Roman Gushchin].
- Drop call of mem_cgroup_disabled instead in patch 1, also fix bot
  build error [Yosry Ahmed]
- Wrap the access of the atomic_t map with helpers properly, so the
  emulation can be dropped to use native 2 byte xchg once available.

Kairui Song (4):
  mm, memcontrol: avoid duplicated memcg enable check
  mm/swap_cgroup: remove swap_cgroup_cmpxchg
  mm/swap_cgroup: remove global swap cgroup lock
  mm/swap_cgroup: decouple swap cgroup recording and clearing

 include/linux/swap_cgroup.h |  14 ++--
 mm/memcontrol.c             |  15 ++--
 mm/swap_cgroup.c            | 148 +++++++++++++++++++-----------------
 3 files changed, 93 insertions(+), 84 deletions(-)

-- 
2.47.1



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

end of thread, other threads:[~2024-12-27  2:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-18 11:46 [PATCH v3 0/4] mm/swap_cgroup: remove global swap cgroup lock Kairui Song
2024-12-18 11:46 ` [PATCH v3 1/4] mm, memcontrol: avoid duplicated memcg enable check Kairui Song
2024-12-22 13:33   ` Huang, Ying
2024-12-22 14:51     ` Kairui Song
2024-12-27  2:03       ` Huang, Ying
2024-12-18 11:46 ` [PATCH v3 2/4] mm/swap_cgroup: remove swap_cgroup_cmpxchg Kairui Song
2024-12-18 11:46 ` [PATCH v3 3/4] mm/swap_cgroup: remove global swap cgroup lock Kairui Song
2024-12-18 11:46 ` [PATCH v3 4/4] mm/swap_cgroup: decouple swap cgroup recording and clearing Kairui Song

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