Skip to content

mm/swap_cgroup: remove global swap cgroup lock

Kairui Song linux-mm lkml 3 versions – Applied

Status from this message: [merged mm-stable] mm-swap_cgroup-decouple-swap-cgroup-recording-and-clearing.patch removed from -mm tree

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest4 patches 3 repliesApplied 4/4
  2. v23 patches 4 repliesSuperseded
  3. v14 patches 24 repliesSuperseded

Patches in v3 All 4 applied

#Subject and filesSizeRepliesApplied
1/4mm, memcontrol: avoid duplicated memcg enable checkmm/memcontrol.c+1 -13 repliesApplied
2/4mm/swap_cgroup: remove swap_cgroup_cmpxchginclude/linux/swap_cgroup.h mm/swap_cgroup.c+0 -310 repliesApplied
3/4mm/swap_cgroup: remove global swap cgroup lockmm/swap_cgroup.c+49 -280 repliesApplied
4/4mm/swap_cgroup: decouple swap cgroup recording and clearinginclude/linux/swap_cgroup.h mm/memcontrol.c mm/swap_cgroup.c+55 -360 repliesApplied

Reviews trailers per patch

3 of 4 patches have a Reviewed-by or Acked-by.

PatchYosry AhmedRoman GushchinShakeel ButtChris Li
1/4R-b R-b A-b A-b
2/4R-b R-b A-b A-b
3/4R-b
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v3 thread

Cover letter [PATCH v3 0/4] mm/swap_cgroup: remove global swap cgroup lock

From: Kairui Song <[email protected]>

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/[email protected]/
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/[email protected]/
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(-)
Signature · 1 line
2.47.1