[PATCH 05/29] drm/panfrost: dynamically allocate the drm-panfrost shrinker

2023-06-23 Thread Qi Zheng
In preparation for implementing lockless slab shrink, we need to dynamically allocate the drm-panfrost shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct panfrost_device. Signed-off-b

Re: [PATCH 24/29] mm: vmscan: make global slab shrink lockless

2023-06-23 Thread Qi Zheng
On 2023/6/22 23:12, Vlastimil Babka wrote: On 6/22/23 10:53, Qi Zheng wrote: The shrinker_rwsem is a global read-write lock in shrinkers subsystem, which protects most operations such as slab shrink, registration and unregistration of shrinkers, etc. This can easily cause problems in the

[PATCH 02/29] mm: vmscan: introduce some helpers for dynamically allocating shrinker

2023-06-23 Thread Qi Zheng
From: Qi Zheng Introduce some helpers for dynamically allocating shrinker instance, and their uses are as follows: 1. shrinker_alloc_and_init() Used to allocate and initialize a shrinker instance, the priv_data parameter is used to pass the pointer of the previously embedded structure of the

[PATCH 04/29] drm/msm: dynamically allocate the drm-msm_gem shrinker

2023-06-23 Thread Qi Zheng
From: Qi Zheng In preparation for implementing lockless slab shrink, we need to dynamically allocate the drm-msm_gem shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct msm_drm_pr

[PATCH 13/29] ext4: dynamically allocate the ext4-es shrinker

2023-06-23 Thread Qi Zheng
In preparation for implementing lockless slab shrink, we need to dynamically allocate the ext4-es shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct ext4_sb_info. Signed-off-by: Qi

[PATCH 00/29] use refcount+RCU method to implement lockless slab shrink

2023-06-23 Thread Qi Zheng
mpleted in 60.12s (1 min, 0.12 secs) We can see that the ops/s has hardly changed. This series is based on next-20230613. Comments and suggestions are welcome. Thanks, Qi. Qi Zheng (29): mm: shrinker: add shrinker::private_data field mm: vmscan: introduce some helpers for dynamically allo

[PATCH 00/29] use refcount+RCU method to implement lockless slab shrink

2023-06-23 Thread Qi Zheng
From: Qi Zheng Hi all, 1. Background = We used to implement the lockless slab shrink with SRCU [1], but then kernel test robot reported -88.8% regression in stress-ng.ramfs.ops_per_sec test case [2], so we reverted it [3]. This patch series aims to re-implement the lockless slab

[PATCH 13/29] ext4: dynamically allocate the ext4-es shrinker

2023-06-23 Thread Qi Zheng
From: Qi Zheng In preparation for implementing lockless slab shrink, we need to dynamically allocate the ext4-es shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct ext4_sb_info. Signe

[PATCH 18/29] xfs: dynamically allocate the xfs-inodegc shrinker

2023-06-23 Thread Qi Zheng
In preparation for implementing lockless slab shrink, we need to dynamically allocate the xfs-inodegc shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct xfs_mount. Signed-off-by: Qi

[PATCH 11/29] virtio_balloon: dynamically allocate the virtio-balloon shrinker

2023-06-23 Thread Qi Zheng
From: Qi Zheng In preparation for implementing lockless slab shrink, we need to dynamically allocate the virtio-balloon shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct virtio_ba

[PATCH 02/29] mm: vmscan: introduce some helpers for dynamically allocating shrinker

2023-06-23 Thread Qi Zheng
. 2. shrinker_free() Used to free the shrinker instance when the registration of shrinker fails. 3. unregister_and_free_shrinker() Used to unregister and free the shrinker instance, and the kfree() will be changed to kfree_rcu() later. Signed-off-by: Qi Zheng --- include/linux/shrinker.h | 12

[PATCH 24/29] mm: vmscan: make global slab shrink lockless

2023-06-23 Thread Qi Zheng
9.38938-1-zhengqi.a...@bytedance.com/ [2]. https://lore.kernel.org/lkml/202305230837.db2c233f-yujie@intel.com/ [3]. https://lore.kernel.org/all/20230609081518.3039120-1-qi.zh...@linux.dev/ [4]. https://lore.kernel.org/lkml/zijhou1d55d4h...@dread.disaster.area/ Signed-off-by: Qi Zheng --- incl

[PATCH 16/29] NFSD: dynamically allocate the nfsd-reply shrinker

2023-06-23 Thread Qi Zheng
In preparation for implementing lockless slab shrink, we need to dynamically allocate the nfsd-reply shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct nfsd_net. Signed-off-by: Qi

[PATCH 03/29] drm/i915: dynamically allocate the i915_gem_mm shrinker

2023-06-23 Thread Qi Zheng
ff-by: Qi Zheng --- drivers/gpu/drm/i915/gem/i915_gem_shrinker.c | 27 ++-- drivers/gpu/drm/i915/i915_drv.h | 3 ++- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_shrinker.c b/drivers/gpu/drm/i915/gem/i915_gem_shrin

[PATCH 08/29] md/raid5: dynamically allocate the md-raid5 shrinker

2023-06-23 Thread Qi Zheng
From: Qi Zheng In preparation for implementing lockless slab shrink, we need to dynamically allocate the md-raid5 shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct r5conf. Signed-o

[PATCH 25/29] mm: vmscan: make memcg slab shrink lockless

2023-06-23 Thread Qi Zheng
see that the first perf hotspot becomes shrink_slab, which is what we expect. Signed-off-by: Qi Zheng --- mm/vmscan.c | 58 + 1 file changed, 41 insertions(+), 17 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 767569698946..357a1f2

[PATCH 01/29] mm: shrinker: add shrinker::private_data field

2023-06-23 Thread Qi Zheng
From: Qi Zheng To prepare for the dynamic allocation of shrinker instances embedded in other structures, add a private_data field to struct shrinker, so that we can use shrinker::private_data to record and get the original embedded structure. Signed-off-by: Qi Zheng --- include/linux

[PATCH 17/29] xfs: dynamically allocate the xfs-buf shrinker

2023-06-23 Thread Qi Zheng
In preparation for implementing lockless slab shrink, we need to dynamically allocate the xfs-buf shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct xfs_buftarg. Signed-off-by: Qi

[PATCH 12/29] mbcache: dynamically allocate the mbcache shrinker

2023-06-23 Thread Qi Zheng
From: Qi Zheng In preparation for implementing lockless slab shrink, we need to dynamically allocate the mbcache shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct mb_cache. Signed-o

[PATCH 26/29] mm: shrinker: make count and scan in shrinker debugfs lockless

2023-06-23 Thread Qi Zheng
Like global and memcg slab shrink, also make count and scan operations in memory shrinker debugfs lockless. The debugfs_remove_recursive() will wait for debugfs_file_put() to return, so there is no need to call rcu_read_lock() before calling shrinker_try_get(). Signed-off-by: Qi Zheng --- mm

[PATCH 07/29] dm zoned: dynamically allocate the dm-zoned-meta shrinker

2023-06-23 Thread Qi Zheng
From: Qi Zheng In preparation for implementing lockless slab shrink, we need to dynamically allocate the dm-zoned-meta shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct dmz_met

[PATCH 09/29] bcache: dynamically allocate the md-bcache shrinker

2023-06-23 Thread Qi Zheng
From: Qi Zheng In preparation for implementing lockless slab shrink, we need to dynamically allocate the md-bcache shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct cache_set. Signe

[PATCH 08/29] md/raid5: dynamically allocate the md-raid5 shrinker

2023-06-23 Thread Qi Zheng
In preparation for implementing lockless slab shrink, we need to dynamically allocate the md-raid5 shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct r5conf. Signed-off-by: Qi

[PATCH 29/29] mm: shrinker: move shrinker-related code into a separate file

2023-06-23 Thread Qi Zheng
The mm/vmscan.c file is too large, so separate the shrinker-related code from it into a separate file. No functional changes. Signed-off-by: Qi Zheng --- include/linux/shrinker.h | 3 + mm/Makefile | 4 +- mm/shrinker.c| 750

[PATCH 06/29] dm: dynamically allocate the dm-bufio shrinker

2023-06-23 Thread Qi Zheng
From: Qi Zheng In preparation for implementing lockless slab shrink, we need to dynamically allocate the dm-bufio shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct dm_bufio_client. S

Re: [External] [PATCH 00/29] use refcount+RCU method to implement lockless slab shrink

2023-06-23 Thread Qi Zheng
This patch set failed to send due to the following reasons, please ignore. 4.7.1 Error: too many recipients from 49.7.199.65

[PATCH 01/29] mm: shrinker: add shrinker::private_data field

2023-06-23 Thread Qi Zheng
From: Qi Zheng To prepare for the dynamic allocation of shrinker instances embedded in other structures, add a private_data field to struct shrinker, so that we can use shrinker::private_data to record and get the original embedded structure. Signed-off-by: Qi Zheng --- include/linux

[PATCH 05/29] drm/panfrost: dynamically allocate the drm-panfrost shrinker

2023-06-23 Thread Qi Zheng
From: Qi Zheng In preparation for implementing lockless slab shrink, we need to dynamically allocate the drm-panfrost shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct panfrost_d

[PATCH 12/29] mbcache: dynamically allocate the mbcache shrinker

2023-06-23 Thread Qi Zheng
In preparation for implementing lockless slab shrink, we need to dynamically allocate the mbcache shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct mb_cache. Signed-off-by: Qi

[PATCH 11/29] virtio_balloon: dynamically allocate the virtio-balloon shrinker

2023-06-23 Thread Qi Zheng
In preparation for implementing lockless slab shrink, we need to dynamically allocate the virtio-balloon shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct virtio_balloon. Signed-off-b

[PATCH 23/29] mm: shrinker: add refcount and completion_wait fields

2023-06-23 Thread Qi Zheng
This commit introduces refcount and completion_wait fields to struct shrinker to manage the life cycle of shrinker instance. Just a preparation work for implementing the lockless slab shrink, no functional changes. Signed-off-by: Qi Zheng --- include/linux/shrinker.h | 11 +++ mm

[PATCH 02/29] mm: vmscan: introduce some helpers for dynamically allocating shrinker

2023-06-23 Thread Qi Zheng
From: Qi Zheng Introduce some helpers for dynamically allocating shrinker instance, and their uses are as follows: 1. shrinker_alloc_and_init() Used to allocate and initialize a shrinker instance, the priv_data parameter is used to pass the pointer of the previously embedded structure of the

[PATCH 15/29] NFSD: dynamically allocate the nfsd-client shrinker

2023-06-23 Thread Qi Zheng
In preparation for implementing lockless slab shrink, we need to dynamically allocate the nfsd-client shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct nfsd_net. Signed-off-by: Qi

Re: [PATCH 00/29] use refcount+RCU method to implement lockless slab shrink

2023-06-23 Thread Qi Zheng
Hi all, Well, this one was sent successfully. Since I always get the following error message, I deleted the original cc people and only kept the mailing lists. 4.7.1 Error: too many recipients from 49.7.199.173 Thanks, Qi

[PATCH 27/29] mm: vmscan: hold write lock to reparent shrinker nr_deferred

2023-06-23 Thread Qi Zheng
shrinker_rwsem to reparent. Signed-off-by: Qi Zheng --- mm/vmscan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 357a1f2ad690..0711b63e68d9 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -433,7 +433,7 @@ void reparent_shrinker_deferred(struct

[PATCH 07/29] dm zoned: dynamically allocate the dm-zoned-meta shrinker

2023-06-23 Thread Qi Zheng
In preparation for implementing lockless slab shrink, we need to dynamically allocate the dm-zoned-meta shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct dmz_metadata. Signed-off-b

[PATCH 21/29] fs: super: dynamically allocate the s_shrink

2023-06-23 Thread Qi Zheng
In preparation for implementing lockless slab shrink, we need to dynamically allocate the s_shrink, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct super_block. Signed-off-by: Qi Zheng --

[PATCH 04/29] drm/msm: dynamically allocate the drm-msm_gem shrinker

2023-06-23 Thread Qi Zheng
In preparation for implementing lockless slab shrink, we need to dynamically allocate the drm-msm_gem shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct msm_drm_private. Signed-off-b

[PATCH 03/29] drm/i915: dynamically allocate the i915_gem_mm shrinker

2023-06-23 Thread Qi Zheng
From: Qi Zheng In preparation for implementing lockless slab shrink, we need to dynamically allocate the i915_gem_mm shrinker, so that it can be freed asynchronously by using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct drm_i915_pr

[PATCH 28/29] mm: shrinkers: convert shrinker_rwsem to mutex

2023-06-23 Thread Qi Zheng
Now there are no readers of shrinker_rwsem, so we can simply replace it with mutex lock. Signed-off-by: Qi Zheng --- drivers/md/dm-cache-metadata.c | 2 +- drivers/md/dm-thin-metadata.c | 2 +- fs/super.c | 2 +- mm/shrinker_debug.c| 14 +++--- mm

[PATCH 19/29] xfs: dynamically allocate the xfs-qm shrinker

2023-06-23 Thread Qi Zheng
In preparation for implementing lockless slab shrink, we need to dynamically allocate the xfs-qm shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct xfs_quotainfo. Signed-off-by: Qi

[PATCH 22/29] drm/ttm: introduce pool_shrink_rwsem

2023-06-23 Thread Qi Zheng
update before freeing memory. So we introduce a new pool_shrink_rwsem to implement a private synchronize_shrinkers(), so as to achieve the same purpose. Signed-off-by: Qi Zheng --- drivers/gpu/drm/ttm/ttm_pool.c | 15 +++ include/linux/shrinker.h | 1 - mm/vmscan.c

[PATCH 00/29] use refcount+RCU method to implement lockless slab shrink

2023-06-23 Thread Qi Zheng
From: Qi Zheng Hi all, 1. Background = We used to implement the lockless slab shrink with SRCU [1], but then kernel test robot reported -88.8% regression in stress-ng.ramfs.ops_per_sec test case [2], so we reverted it [3]. This patch series aims to re-implement the lockless slab

Re: [PATCH 24/29] mm: vmscan: make global slab shrink lockless

2023-06-23 Thread Qi Zheng
On 2023/6/23 01:41, Alan Huang wrote: 2023年6月23日 上午12:42,Qi Zheng 写道: On 2023/6/22 23:12, Vlastimil Babka wrote: On 6/22/23 10:53, Qi Zheng wrote: The shrinker_rwsem is a global read-write lock in shrinkers subsystem, which protects most operations such as slab shrink, registration

[PATCH 10/29] vmw_balloon: dynamically allocate the vmw-balloon shrinker

2023-06-23 Thread Qi Zheng
From: Qi Zheng In preparation for implementing lockless slab shrink, we need to dynamically allocate the vmw-balloon shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct vmballoon. S

[PATCH 01/29] mm: shrinker: add shrinker::private_data field

2023-06-23 Thread Qi Zheng
To prepare for the dynamic allocation of shrinker instances embedded in other structures, add a private_data field to struct shrinker, so that we can use shrinker::private_data to record and get the original embedded structure. Signed-off-by: Qi Zheng --- include/linux/shrinker.h | 2 ++ 1 file

[PATCH 14/29] jbd2, ext4: dynamically allocate the jbd2-journal shrinker

2023-06-23 Thread Qi Zheng
In preparation for implementing lockless slab shrink, we need to dynamically allocate the jbd2-journal shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct journal_s. Signed-off-by: Qi

[PATCH 09/29] bcache: dynamically allocate the md-bcache shrinker

2023-06-23 Thread Qi Zheng
In preparation for implementing lockless slab shrink, we need to dynamically allocate the md-bcache shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct cache_set. Signed-off-by: Qi

[PATCH 06/29] dm: dynamically allocate the dm-bufio shrinker

2023-06-23 Thread Qi Zheng
In preparation for implementing lockless slab shrink, we need to dynamically allocate the dm-bufio shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct dm_bufio_client. Signed-off-by: Qi

[PATCH 20/29] zsmalloc: dynamically allocate the mm-zspool shrinker

2023-06-23 Thread Qi Zheng
In preparation for implementing lockless slab shrink, we need to dynamically allocate the mm-zspool shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct zs_pool. Signed-off-by: Qi

[PATCH 10/29] vmw_balloon: dynamically allocate the vmw-balloon shrinker

2023-06-23 Thread Qi Zheng
In preparation for implementing lockless slab shrink, we need to dynamically allocate the vmw-balloon shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct vmballoon. Signed-off-by: Qi

[PATCH 14/29] jbd2, ext4: dynamically allocate the jbd2-journal shrinker

2023-06-23 Thread Qi Zheng
From: Qi Zheng In preparation for implementing lockless slab shrink, we need to dynamically allocate the jbd2-journal shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct journal_s. S

Re: [PATCH 29/29] mm: shrinker: move shrinker-related code into a separate file

2023-06-24 Thread Qi Zheng
Hi Vlastimil, On 2023/6/22 22:53, Vlastimil Babka wrote: On 6/22/23 10:53, Qi Zheng wrote: The mm/vmscan.c file is too large, so separate the shrinker-related code from it into a separate file. No functional changes. Signed-off-by: Qi Zheng Maybe do this move as patch 01 so the further

Re: [PATCH 24/29] mm: vmscan: make global slab shrink lockless

2023-06-24 Thread Qi Zheng
On 2023/6/23 14:29, Dave Chinner wrote: On Thu, Jun 22, 2023 at 05:12:02PM +0200, Vlastimil Babka wrote: On 6/22/23 10:53, Qi Zheng wrote: @@ -1067,33 +1068,27 @@ static unsigned long shrink_slab(gfp_t gfp_mask, int nid, if (!mem_cgroup_disabled() && !mem_cgroup_is_ro

Re: [PATCH 02/29] mm: vmscan: introduce some helpers for dynamically allocating shrinker

2023-06-24 Thread Qi Zheng
Hi Dave, On 2023/6/23 14:12, Dave Chinner wrote: On Thu, Jun 22, 2023 at 04:53:08PM +0800, Qi Zheng wrote: Introduce some helpers for dynamically allocating shrinker instance, and their uses are as follows: 1. shrinker_alloc_and_init() Used to allocate and initialize a shrinker instance, the

Re: [PATCH 05/29] drm/panfrost: dynamically allocate the drm-panfrost shrinker

2023-06-24 Thread Qi Zheng
Hi Steven, The email you replied to was the failed version (due to the error below), so I copied your reply and replied to you on this successful version. (4.7.1 Error: too many recipients from 49.7.199.173) On 2023/6/23 18:01, Steven Price wrote: > On 22/06/2023 09:39, Qi Zheng wrote: >

Re: [PATCH 29/29] mm: shrinker: move shrinker-related code into a separate file

2023-06-24 Thread Qi Zheng
Hi Sergey, On 2023/6/23 13:25, Sergey Senozhatsky wrote: On (23/06/22 16:53), Qi Zheng wrote: +/* + * Remove one + */ +void unregister_shrinker(struct shrinker *shrinker) +{ + struct dentry *debugfs_entry; + int debugfs_id; + + if (!(shrinker->flags & SHRINKER_REG

Re: [External] Re: [PATCH 01/29] mm: shrinker: add shrinker::private_data field

2023-06-24 Thread Qi Zheng
Hi Vlastimil, On 2023/6/22 22:47, Vlastimil Babka wrote: On 6/22/23 10:53, Qi Zheng wrote: To prepare for the dynamic allocation of shrinker instances embedded in other structures, add a private_data field to struct shrinker, so that we can use shrinker::private_data to record and get the

Re: [PATCH 24/29] mm: vmscan: make global slab shrink lockless

2023-06-24 Thread Qi Zheng
Hi Dave, On 2023/6/24 06:19, Dave Chinner wrote: On Fri, Jun 23, 2023 at 09:10:57PM +0800, Qi Zheng wrote: On 2023/6/23 14:29, Dave Chinner wrote: On Thu, Jun 22, 2023 at 05:12:02PM +0200, Vlastimil Babka wrote: On 6/22/23 10:53, Qi Zheng wrote: Yes, I suggested the IDR route because radix

Re: [PATCH 15/29] NFSD: dynamically allocate the nfsd-client shrinker

2023-06-24 Thread Qi Zheng
Hi Chuck, On 2023/6/24 05:49, Chuck Lever wrote: On Thu, Jun 22, 2023 at 04:53:21PM +0800, Qi Zheng wrote: In preparation for implementing lockless slab shrink, we need to dynamically allocate the nfsd-client shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn&#

Re: [PATCH 24/29] mm: vmscan: make global slab shrink lockless

2023-06-24 Thread Qi Zheng
On 2023/6/24 19:08, Qi Zheng wrote: Hi Dave, On 2023/6/24 06:19, Dave Chinner wrote: On Fri, Jun 23, 2023 at 09:10:57PM +0800, Qi Zheng wrote: On 2023/6/23 14:29, Dave Chinner wrote: On Thu, Jun 22, 2023 at 05:12:02PM +0200, Vlastimil Babka wrote: On 6/22/23 10:53, Qi Zheng wrote: Yes

Re: [PATCH 24/29] mm: vmscan: make global slab shrink lockless

2023-07-03 Thread Qi Zheng
On 2023/7/4 00:39, Paul E. McKenney wrote: On Fri, Jun 23, 2023 at 04:29:39PM +1000, Dave Chinner wrote: On Thu, Jun 22, 2023 at 05:12:02PM +0200, Vlastimil Babka wrote: On 6/22/23 10:53, Qi Zheng wrote: @@ -1067,33 +1068,27 @@ static unsigned long shrink_slab(gfp_t gfp_mask, int nid

Re: [PATCH 24/29] mm: vmscan: make global slab shrink lockless

2023-07-03 Thread Qi Zheng
Hi Dave, On 2023/6/24 19:08, Qi Zheng wrote: Hi Dave, On 2023/6/24 06:19, Dave Chinner wrote: On Fri, Jun 23, 2023 at 09:10:57PM +0800, Qi Zheng wrote: On 2023/6/23 14:29, Dave Chinner wrote: On Thu, Jun 22, 2023 at 05:12:02PM +0200, Vlastimil Babka wrote: On 6/22/23 10:53, Qi Zheng wrote

[PATCH v2 00/47] use refcount+RCU method to implement lockless slab shrink

2023-07-24 Thread Qi Zheng
rink needs to modify the startup sequence (As I mentioned in https://lore.kernel.org/lkml/38b14080-4ce5-d300-8a0a-c630bca68...@bytedance.com/), I finally choose to process them separately.) - collect Acked-bys Qi Zheng (47): mm: vmscan: move shrinker-related code into a separate file

[PATCH v2 01/47] mm: vmscan: move shrinker-related code into a separate file

2023-07-24 Thread Qi Zheng
The mm/vmscan.c file is too large, so separate the shrinker-related code from it into a separate file. No functional changes. Signed-off-by: Qi Zheng --- include/linux/shrinker.h | 3 + mm/Makefile | 4 +- mm/shrinker.c| 707

[PATCH v2 02/47] mm: shrinker: remove redundant shrinker_rwsem in debugfs operations

2023-07-24 Thread Qi Zheng
: Qi Zheng --- mm/shrinker_debug.c | 14 -- 1 file changed, 14 deletions(-) diff --git a/mm/shrinker_debug.c b/mm/shrinker_debug.c index 3ab53fad8876..f1becfd45853 100644 --- a/mm/shrinker_debug.c +++ b/mm/shrinker_debug.c @@ -55,11 +55,6 @@ static int shrinker_debugfs_count_show

[PATCH v2 03/47] mm: shrinker: add infrastructure for dynamically allocating shrinker

2023-07-24 Thread Qi Zheng
shrinkers in the new setup. ``` Signed-off-by: Qi Zheng --- include/linux/shrinker.h | 6 +++ mm/shrinker.c| 113 +++ 2 files changed, 119 insertions(+) diff --git a/include/linux/shrinker.h b/include/linux/shrinker.h index 961cb84e51f5..296f5e163861

[PATCH v2 04/47] kvm: mmu: dynamically allocate the x86-mmu shrinker

2023-07-24 Thread Qi Zheng
Use new APIs to dynamically allocate the x86-mmu shrinker. Signed-off-by: Qi Zheng --- arch/x86/kvm/mmu/mmu.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c index ec169f5c7dce..ab405e0a8954 100644 --- a

[PATCH v2 05/47] binder: dynamically allocate the android-binder shrinker

2023-07-24 Thread Qi Zheng
Use new APIs to dynamically allocate the android-binder shrinker. Signed-off-by: Qi Zheng --- drivers/android/binder_alloc.c | 31 +++ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/drivers/android/binder_alloc.c b/drivers/android/binder_alloc.c

[PATCH v2 06/47] drm/ttm: dynamically allocate the drm-ttm_pool shrinker

2023-07-24 Thread Qi Zheng
Use new APIs to dynamically allocate the drm-ttm_pool shrinker. Signed-off-by: Qi Zheng --- drivers/gpu/drm/ttm/ttm_pool.c | 23 +++ 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_pool.c b/drivers/gpu/drm/ttm/ttm_pool.c index

[PATCH v2 07/47] xenbus/backend: dynamically allocate the xen-backend shrinker

2023-07-24 Thread Qi Zheng
Use new APIs to dynamically allocate the xen-backend shrinker. Signed-off-by: Qi Zheng --- drivers/xen/xenbus/xenbus_probe_backend.c | 17 +++-- 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/xen/xenbus/xenbus_probe_backend.c b/drivers/xen/xenbus

[PATCH v2 08/47] erofs: dynamically allocate the erofs-shrinker

2023-07-24 Thread Qi Zheng
Use new APIs to dynamically allocate the erofs-shrinker. Signed-off-by: Qi Zheng --- fs/erofs/utils.c | 20 +--- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/fs/erofs/utils.c b/fs/erofs/utils.c index cc6fb9e98899..389de06e1065 100644 --- a/fs/erofs/utils.c

[PATCH v2 09/47] f2fs: dynamically allocate the f2fs-shrinker

2023-07-24 Thread Qi Zheng
Use new APIs to dynamically allocate the f2fs-shrinker. Signed-off-by: Qi Zheng --- fs/f2fs/super.c | 32 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index ca31163da00a..8b08473db358 100644 --- a/fs/f2fs

[PATCH v2 10/47] gfs2: dynamically allocate the gfs2-glock shrinker

2023-07-24 Thread Qi Zheng
Use new APIs to dynamically allocate the gfs2-glock shrinker. Signed-off-by: Qi Zheng --- fs/gfs2/glock.c | 20 +++- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index 1438e7465e30..77da354667d9 100644 --- a/fs/gfs2/glock.c

[PATCH v2 11/47] gfs2: dynamically allocate the gfs2-qd shrinker

2023-07-24 Thread Qi Zheng
Use new APIs to dynamically allocate the gfs2-qd shrinker. Signed-off-by: Qi Zheng --- fs/gfs2/main.c | 6 +++--- fs/gfs2/quota.c | 26 -- fs/gfs2/quota.h | 3 ++- 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/fs/gfs2/main.c b/fs/gfs2/main.c index

[PATCH v2 12/47] NFSv4.2: dynamically allocate the nfs-xattr shrinkers

2023-07-24 Thread Qi Zheng
Use new APIs to dynamically allocate the nfs-xattr shrinkers. Signed-off-by: Qi Zheng --- fs/nfs/nfs42xattr.c | 87 +++-- 1 file changed, 44 insertions(+), 43 deletions(-) diff --git a/fs/nfs/nfs42xattr.c b/fs/nfs/nfs42xattr.c index 911f634ba3da

[PATCH v2 13/47] nfs: dynamically allocate the nfs-acl shrinker

2023-07-24 Thread Qi Zheng
Use new APIs to dynamically allocate the nfs-acl shrinker. Signed-off-by: Qi Zheng --- fs/nfs/super.c | 20 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/fs/nfs/super.c b/fs/nfs/super.c index 2284f749d892..a90b12593383 100644 --- a/fs/nfs/super.c +++ b/fs

[PATCH v2 14/47] nfsd: dynamically allocate the nfsd-filecache shrinker

2023-07-24 Thread Qi Zheng
Use new APIs to dynamically allocate the nfsd-filecache shrinker. Signed-off-by: Qi Zheng --- fs/nfsd/filecache.c | 22 -- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/fs/nfsd/filecache.c b/fs/nfsd/filecache.c index ee9c923192e0..50216768d408 100644 --- a

[PATCH v2 15/47] quota: dynamically allocate the dquota-cache shrinker

2023-07-24 Thread Qi Zheng
Use new APIs to dynamically allocate the dquota-cache shrinker. Signed-off-by: Qi Zheng --- fs/quota/dquot.c | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index e8232242dd34..6cb2d8911bc3 100644 --- a/fs/quota/dquot.c

[PATCH v2 16/47] ubifs: dynamically allocate the ubifs-slab shrinker

2023-07-24 Thread Qi Zheng
Use new APIs to dynamically allocate the ubifs-slab shrinker. Signed-off-by: Qi Zheng --- fs/ubifs/super.c | 22 -- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c index 32cb14759796..f2a3a58f7860 100644 --- a/fs/ubifs

[PATCH v2 17/47] rcu: dynamically allocate the rcu-lazy shrinker

2023-07-24 Thread Qi Zheng
Use new APIs to dynamically allocate the rcu-lazy shrinker. Signed-off-by: Qi Zheng --- kernel/rcu/tree_nocb.h | 19 +++ 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/kernel/rcu/tree_nocb.h b/kernel/rcu/tree_nocb.h index 43229d2b0c44..919f17561733 100644 --- a

[PATCH v2 18/47] rcu: dynamically allocate the rcu-kfree shrinker

2023-07-24 Thread Qi Zheng
Use new APIs to dynamically allocate the rcu-kfree shrinker. Signed-off-by: Qi Zheng --- kernel/rcu/tree.c | 21 + 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 1449cb69a0e0..d068ce3567fc 100644 --- a/kernel/rcu

[PATCH v2 19/47] mm: thp: dynamically allocate the thp-related shrinkers

2023-07-24 Thread Qi Zheng
Use new APIs to dynamically allocate the thp-zero and thp-deferred_split shrinkers. Signed-off-by: Qi Zheng --- mm/huge_memory.c | 69 +++- 1 file changed, 45 insertions(+), 24 deletions(-) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index

[PATCH v2 20/47] sunrpc: dynamically allocate the sunrpc_cred shrinker

2023-07-24 Thread Qi Zheng
Use new APIs to dynamically allocate the sunrpc_cred shrinker. Signed-off-by: Qi Zheng --- net/sunrpc/auth.c | 19 +++ 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/net/sunrpc/auth.c b/net/sunrpc/auth.c index 2f16f9d17966..74e40c8a512d 100644 --- a/net/sunrpc

[PATCH v2 21/47] mm: workingset: dynamically allocate the mm-shadow shrinker

2023-07-24 Thread Qi Zheng
Use new APIs to dynamically allocate the mm-shadow shrinker. Signed-off-by: Qi Zheng --- mm/workingset.c | 26 ++ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/mm/workingset.c b/mm/workingset.c index 4686ae363000..4bc85f739b13 100644 --- a/mm

[PATCH v2 22/47] drm/i915: dynamically allocate the i915_gem_mm shrinker

2023-07-24 Thread Qi Zheng
ff-by: Qi Zheng --- drivers/gpu/drm/i915/gem/i915_gem_shrinker.c | 30 +++- drivers/gpu/drm/i915/i915_drv.h | 2 +- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_shrinker.c b/drivers/gpu/drm/i915/gem/i915_gem_shrin

[PATCH v2 23/47] drm/msm: dynamically allocate the drm-msm_gem shrinker

2023-07-24 Thread Qi Zheng
ff-by: Qi Zheng --- drivers/gpu/drm/msm/msm_drv.c | 4 ++- drivers/gpu/drm/msm/msm_drv.h | 4 +-- drivers/gpu/drm/msm/msm_gem_shrinker.c | 36 -- 3 files changed, 28 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gp

[PATCH v2 24/47] drm/panfrost: dynamically allocate the drm-panfrost shrinker

2023-07-24 Thread Qi Zheng
ff-by: Qi Zheng --- drivers/gpu/drm/panfrost/panfrost_device.h| 2 +- drivers/gpu/drm/panfrost/panfrost_drv.c | 6 +++- drivers/gpu/drm/panfrost/panfrost_gem.h | 2 +- .../gpu/drm/panfrost/panfrost_gem_shrinker.c | 32 --- 4 files changed, 27 insertions(+

[PATCH v2 25/47] dm: dynamically allocate the dm-bufio shrinker

2023-07-24 Thread Qi Zheng
In preparation for implementing lockless slab shrink, use new APIs to dynamically allocate the dm-bufio shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct dm_bufio_client. Signed-off-b

[PATCH v2 26/47] dm zoned: dynamically allocate the dm-zoned-meta shrinker

2023-07-24 Thread Qi Zheng
ff-by: Qi Zheng --- drivers/md/dm-zoned-metadata.c | 28 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/drivers/md/dm-zoned-metadata.c b/drivers/md/dm-zoned-metadata.c index 9d3cca8e3dc9..657f274e4e84 100644 --- a/drivers/md/dm-zoned-metadata.c +++ b/dr

[PATCH v2 27/47] md/raid5: dynamically allocate the md-raid5 shrinker

2023-07-24 Thread Qi Zheng
In preparation for implementing lockless slab shrink, use new APIs to dynamically allocate the md-raid5 shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct r5conf. Signed-off-by: Qi

[PATCH v2 28/47] bcache: dynamically allocate the md-bcache shrinker

2023-07-24 Thread Qi Zheng
In preparation for implementing lockless slab shrink, use new APIs to dynamically allocate the md-bcache shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct cache_set. Signed-off-by: Qi

[PATCH v2 29/47] vmw_balloon: dynamically allocate the vmw-balloon shrinker

2023-07-24 Thread Qi Zheng
imply exit vmballoon_init() when registering the shrinker fails. So the shrinker_registered indication is redundant, just remove it. Signed-off-by: Qi Zheng --- drivers/misc/vmw_balloon.c | 38 -- 1 file changed, 12 insertions(+), 26 deletions(-) diff --git a/dr

[PATCH v2 30/47] virtio_balloon: dynamically allocate the virtio-balloon shrinker

2023-07-24 Thread Qi Zheng
ff-by: Qi Zheng --- drivers/virtio/virtio_balloon.c | 25 +++-- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c index 5b15936a5214..d773860c3b18 100644 --- a/drivers/virtio/virtio_balloon.c

[PATCH v2 31/47] mbcache: dynamically allocate the mbcache shrinker

2023-07-24 Thread Qi Zheng
In preparation for implementing lockless slab shrink, use new APIs to dynamically allocate the mbcache shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct mb_cache. Signed-off-by: Qi

[PATCH v2 32/47] ext4: dynamically allocate the ext4-es shrinker

2023-07-24 Thread Qi Zheng
In preparation for implementing lockless slab shrink, use new APIs to dynamically allocate the ext4-es shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct ext4_sb_info. Signed-off-b

[PATCH v2 33/47] jbd2, ext4: dynamically allocate the jbd2-journal shrinker

2023-07-24 Thread Qi Zheng
In preparation for implementing lockless slab shrink, use new APIs to dynamically allocate the jbd2-journal shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct journal_s. Signed-off-b

[PATCH v2 34/47] nfsd: dynamically allocate the nfsd-client shrinker

2023-07-24 Thread Qi Zheng
Lever Signed-off-by: Qi Zheng --- fs/nfsd/netns.h | 2 +- fs/nfsd/nfs4state.c | 20 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/fs/nfsd/netns.h b/fs/nfsd/netns.h index ec49b200b797..f669444d5336 100644 --- a/fs/nfsd/netns.h +++ b/fs/nfsd/netns.h @@ -

[PATCH v2 35/47] nfsd: dynamically allocate the nfsd-reply shrinker

2023-07-24 Thread Qi Zheng
Lever Signed-off-by: Qi Zheng --- fs/nfsd/netns.h| 2 +- fs/nfsd/nfscache.c | 31 --- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/fs/nfsd/netns.h b/fs/nfsd/netns.h index f669444d5336..ab303a8b77d5 100644 --- a/fs/nfsd/netns.h +++ b/fs/nfsd/ne

[PATCH v2 36/47] xfs: dynamically allocate the xfs-buf shrinker

2023-07-24 Thread Qi Zheng
In preparation for implementing lockless slab shrink, use new APIs to dynamically allocate the xfs-buf shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct xfs_buftarg. Signed-off-by: Qi

  1   2   3   >