All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/6] Split list_lru lock into per-cgroup scope
@ 2024-09-25 17:10 Kairui Song
  2024-09-25 17:10 ` [PATCH v2 1/6] mm/list_lru: don't pass unnecessary key parameters Kairui Song
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: Kairui Song @ 2024-09-25 17:10 UTC (permalink / raw)
  To: linux-mm
  Cc: Andrew Morton, Matthew Wilcox, Johannes Weiner, Roman Gushchin,
	Waiman Long, Shakeel Butt, Michal Hocko, Chengming Zhou, Qi Zheng,
	Muchun Song, Kairui Song

From: Kairui Song <kasong@tencent.com>

Currently, every list_lru has a per-node lock that protects adding,
deletion, isolation, and reparenting of all list_lru_one instances
belonging to this list_lru on this node. This lock contention is heavy
when multiple cgroups modify the same list_lru.

This can be alleviated by splitting the lock into per-cgroup scope.

To achieve this, this series reworked and optimized the reparenting
process step by step, making it possible to have a stable list_lru_one,
and making it possible to pin the list_lru_one. Then split the lock
into per-cgroup scope.

The result is ~15% performance gain for simple multi-cgroup tar test
of small files, and reduced LOC. See PATCH 5/6 for test details.

V1: https://lore.kernel.org/linux-mm/20240624175313.47329-1-ryncsn@gmail.com/
Updates from V1:
- Collect Review-by.
- Fix a race of initialization issue that may lead to mem leak [Muchun
  Song]
- Drop a unrelated and incorrect fix [Shakeel Butt]
- Use VM_WARN_ON instead of WARN_ON for several sanity checks.

Kairui Song (6):
  mm/list_lru: don't pass unnecessary key parameters
  mm/list_lru: don't export list_lru_add
  mm/list_lru: code clean up for reparenting
  mm/list_lru: simplify reparenting and initial allocation
  mm/list_lru: split the lock to per-cgroup scope
  mm/list_lru: Simplify the list_lru walk callback function

 drivers/android/binder_alloc.c |   8 +-
 drivers/android/binder_alloc.h |   2 +-
 fs/dcache.c                    |   4 +-
 fs/gfs2/quota.c                |   2 +-
 fs/inode.c                     |   5 +-
 fs/nfs/nfs42xattr.c            |   4 +-
 fs/nfsd/filecache.c            |   5 +-
 fs/xfs/xfs_buf.c               |   2 -
 fs/xfs/xfs_qm.c                |   6 +-
 include/linux/list_lru.h       |  26 ++-
 mm/list_lru.c                  | 382 ++++++++++++++++-----------------
 mm/memcontrol.c                |  10 +-
 mm/workingset.c                |  20 +-
 mm/zswap.c                     |  12 +-
 14 files changed, 240 insertions(+), 248 deletions(-)

-- 
2.46.1



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

end of thread, other threads:[~2024-10-28 13:22 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-25 17:10 [PATCH v2 0/6] Split list_lru lock into per-cgroup scope Kairui Song
2024-09-25 17:10 ` [PATCH v2 1/6] mm/list_lru: don't pass unnecessary key parameters Kairui Song
2024-09-26 14:31   ` Shakeel Butt
2024-09-25 17:10 ` [PATCH v2 2/6] mm/list_lru: don't export list_lru_add Kairui Song
2024-09-26 14:32   ` Shakeel Butt
2024-09-25 17:10 ` [PATCH v2 3/6] mm/list_lru: code clean up for reparenting Kairui Song
2024-09-26 14:34   ` Shakeel Butt
2024-09-25 17:10 ` [PATCH v2 4/6] mm/list_lru: simplify reparenting and initial allocation Kairui Song
2024-09-25 17:10 ` [PATCH v2 5/6] mm/list_lru: split the lock to per-cgroup scope Kairui Song
2024-10-25 21:13   ` Usama Arif
2024-10-27 17:26     ` Kairui Song
2024-10-28 13:22       ` Usama Arif
2024-09-25 17:10 ` [PATCH v2 6/6] mm/list_lru: Simplify the list_lru walk callback function Kairui Song

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.