[dm-devel] [PATCH v6 24/45] dm zoned: dynamically allocate the dm-zoned-meta shrinker

2023-09-11 Thread Qi Zheng
In preparation for implementing lockless slab shrink, use new APIs to dynamically allocate the dm-zoned-meta shrinker, so that it can be freed asynchronously via RCU. Then it doesn't need to wait for RCU read-side critical section when releasing the struct dmz_metadata. Signed-off-by: Qi

[dm-devel] [PATCH v6 23/45] dm: dynamically allocate the dm-bufio shrinker

2023-09-11 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 via 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

[dm-devel] [PATCH v5 24/45] dm zoned: dynamically allocate the dm-zoned-meta shrinker

2023-08-23 Thread Qi Zheng
In preparation for implementing lockless slab shrink, use new APIs to dynamically allocate the dm-zoned-meta shrinker, so that it can be freed asynchronously via RCU. Then it doesn't need to wait for RCU read-side critical section when releasing the struct dmz_metadata. Signed-off-by: Qi

[dm-devel] [PATCH v5 23/45] dm: dynamically allocate the dm-bufio shrinker

2023-08-23 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 via 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

Re: [dm-devel] [PATCH v4 43/48] drm/ttm: introduce pool_shrink_rwsem

2023-08-22 Thread Qi Zheng
Hi Daniel, On 2023/8/22 21:56, Daniel Vetter wrote: On Mon, Aug 07, 2023 at 07:09:31PM +0800, Qi Zheng wrote: Currently, the synchronize_shrinkers() is only used by TTM pool. It only requires that no shrinkers run in parallel. After we use RCU+refcount method to implement the lockless slab

Re: [dm-devel] [PATCH v4 01/48] mm: move some shrinker-related function declarations to mm/internal.h

2023-08-15 Thread Qi Zheng
On 2023/8/15 16:36, Muchun Song wrote: On Aug 7, 2023, at 19:08, Qi Zheng wrote: The following functions are only used inside the mm subsystem, so it's better to move their declarations to the mm/internal.h file. 1. shrinker_debugfs_add() 2. shrinker_debugfs_detac

Re: [dm-devel] [PATCH v4 45/48] mm: shrinker: make global slab shrink lockless

2023-08-08 Thread Qi Zheng
Hi Dave, On 2023/8/8 10:24, Dave Chinner wrote: On Mon, Aug 07, 2023 at 07:09:33PM +0800, Qi Zheng wrote: diff --git a/include/linux/shrinker.h b/include/linux/shrinker.h index eb342994675a..f06225f18531 100644 --- a/include/linux/shrinker.h +++ b/include/linux/shrinker.h @@ -4,6 +4,8

Re: [dm-devel] [PATCH v4 46/48] mm: shrinker: make memcg slab shrink lockless

2023-08-08 Thread Qi Zheng
Hi Dave, On 2023/8/8 10:44, Dave Chinner wrote: On Mon, Aug 07, 2023 at 07:09:34PM +0800, Qi Zheng wrote: Like global slab shrink, this commit also uses refcount+RCU method to make memcg slab shrink lockless. This patch does random code cleanups amongst the actual RCU changes. Can you please

[dm-devel] [PATCH v4 48/48] mm: shrinker: convert shrinker_rwsem to mutex

2023-08-07 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 +- fs/super.c | 2 +- mm/shrinker.c | 28 ++-- mm/shrinker_debug.c

[dm-devel] [PATCH v4 42/48] mm: shrinker: remove old APIs

2023-08-07 Thread Qi Zheng
Now no users are using the old APIs, just remove them. Signed-off-by: Qi Zheng Reviewed-by: Muchun Song --- include/linux/shrinker.h | 7 -- mm/shrinker.c| 143 --- 2 files changed, 150 deletions(-) diff --git a/include/linux/shrinker.h b

[dm-devel] [PATCH v4 07/48] drm/ttm: dynamically allocate the drm-ttm_pool shrinker

2023-08-07 Thread Qi Zheng
Use new APIs to dynamically allocate the drm-ttm_pool shrinker. Signed-off-by: Qi Zheng Reviewed-by: Muchun Song --- 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

[dm-devel] [PATCH v4 46/48] mm: shrinker: make memcg slab shrink lockless

2023-08-07 Thread Qi Zheng
ink_slab, which is what we expect. Signed-off-by: Qi Zheng --- mm/shrinker.c | 80 ++- 1 file changed, 54 insertions(+), 26 deletions(-) diff --git a/mm/shrinker.c b/mm/shrinker.c index d318f5621862..fee6f62904fb 100644 --- a/mm/shrinker.c +++ b/mm/shrin

[dm-devel] [PATCH v4 47/48] mm: shrinker: hold write lock to reparent shrinker nr_deferred

2023-08-07 Thread Qi Zheng
shrinker_rwsem to reparent. Signed-off-by: Qi Zheng --- mm/shrinker.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/shrinker.c b/mm/shrinker.c index fee6f62904fb..a12dede5d21f 100644 --- a/mm/shrinker.c +++ b/mm/shrinker.c @@ -299,7 +299,7 @@ void reparent_shrinker_deferred

[dm-devel] [PATCH v4 43/48] drm/ttm: introduce pool_shrink_rwsem

2023-08-07 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 Reviewed-by: Muchun Song --- drivers/gpu/drm/ttm/ttm_pool.c | 15 +++ include/linux/shrinker.h | 2

[dm-devel] [PATCH v4 35/48] nfsd: dynamically allocate the nfsd-client shrinker

2023-08-07 Thread Qi Zheng
In preparation for implementing lockless slab shrink, use new APIs 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-b

[dm-devel] [PATCH v4 16/48] quota: dynamically allocate the dquota-cache shrinker

2023-08-07 Thread Qi Zheng
Use new APIs to dynamically allocate the dquota-cache shrinker. Signed-off-by: Qi Zheng Reviewed-by: Muchun Song --- fs/quota/dquot.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index 9e72bfe8bbad..c303cffdf433

[dm-devel] [PATCH v4 40/48] zsmalloc: dynamically allocate the mm-zspool shrinker

2023-08-07 Thread Qi Zheng
In preparation for implementing lockless slab shrink, use new APIs 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

[dm-devel] [PATCH v4 15/48] nfsd: dynamically allocate the nfsd-filecache shrinker

2023-08-07 Thread Qi Zheng
Use new APIs to dynamically allocate the nfsd-filecache shrinker. Signed-off-by: Qi Zheng Reviewed-by: Muchun Song --- fs/nfsd/filecache.c | 23 +-- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/fs/nfsd/filecache.c b/fs/nfsd/filecache.c index ee9c923192e0

[dm-devel] [PATCH v4 29/48] bcache: dynamically allocate the md-bcache shrinker

2023-08-07 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

[dm-devel] [PATCH v4 17/48] ubifs: dynamically allocate the ubifs-slab shrinker

2023-08-07 Thread Qi Zheng
Use new APIs to dynamically allocate the ubifs-slab shrinker. Signed-off-by: Qi Zheng Reviewed-by: Muchun Song --- 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 b08fb28d16b5..c690782388a8

[dm-devel] [PATCH v4 20/48] mm: thp: dynamically allocate the thp-related shrinkers

2023-08-07 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

[dm-devel] [PATCH v4 27/48] dm zoned: dynamically allocate the dm-zoned-meta shrinker

2023-08-07 Thread Qi Zheng
ff-by: Qi Zheng Reviewed-by: Muchun Song --- drivers/md/dm-zoned-metadata.c | 29 + 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/drivers/md/dm-zoned-metadata.c b/drivers/md/dm-zoned-metadata.c index 9d3cca8e3dc9..bbb0e69a7908 100644 --- a/drivers/md/dm-

[dm-devel] [PATCH v4 32/48] mbcache: dynamically allocate the mbcache shrinker

2023-08-07 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

[dm-devel] [PATCH v4 03/48] mm: shrinker: remove redundant shrinker_rwsem in debugfs operations

2023-08-07 Thread Qi Zheng
: Qi Zheng Reviewed-by: Muchun Song --- mm/shrinker_debug.c | 16 +--- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/mm/shrinker_debug.c b/mm/shrinker_debug.c index 3ab53fad8876..61702bdc1af4 100644 --- a/mm/shrinker_debug.c +++ b/mm/shrinker_debug.c @@ -49,17 +49,12

[dm-devel] [PATCH v4 02/48] mm: vmscan: move shrinker-related code into a separate file

2023-08-07 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 --- mm/Makefile | 4 +- mm/internal.h | 2 + mm/shrinker.c | 709 ++ mm/vmscan.c | 701

[dm-devel] [PATCH v4 44/48] mm: shrinker: add a secondary array for shrinker_info::{map, nr_deferred}

2023-08-07 Thread Qi Zheng
we only need to copy this secondary array every time the size is resized. Then even if we get the old secondary array under the RCU lock, the found map and nr_deferred are also true, so no data is lost. [1]. https://lore.kernel.org/all/20220228122126.37293-13-songmuc...@bytedance.com/ Signed-off

[dm-devel] [PATCH v4 10/48] f2fs: dynamically allocate the f2fs-shrinker

2023-08-07 Thread Qi Zheng
Use new APIs to dynamically allocate the f2fs-shrinker. Signed-off-by: Qi Zheng Reviewed-by: Muchun Song --- 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 aa1f9a3a8037..9092310582aa

[dm-devel] [PATCH v4 45/48] mm: shrinker: make global slab shrink lockless

2023-08-07 Thread Qi Zheng
0-1-qi.zh...@linux.dev/ [5]. https://lore.kernel.org/lkml/zijhou1d55d4h...@dread.disaster.area/ Signed-off-by: Qi Zheng --- include/linux/shrinker.h | 17 ++ mm/shrinker.c| 70 +--- 2 files changed, 68 insertions(+), 19 deletions(-) diff --git

[dm-devel] [PATCH v4 06/48] binder: dynamically allocate the android-binder shrinker

2023-08-07 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

[dm-devel] [PATCH v4 04/48] mm: shrinker: add infrastructure for dynamically allocating shrinker

2023-08-07 Thread Qi Zheng
modules using the old API and will no longer work with a kernel using lockless slab shrinkers. They need to break (both at the source and binary levels) to stop bad things from happening due to using unconverted shrinkers in the new setup. ``` Signed-off-by: Qi Zheng --- include/linux/shrinker.h

[dm-devel] [PATCH v4 25/48] drm/panfrost: dynamically allocate the drm-panfrost shrinker

2023-08-07 Thread Qi Zheng
ff-by: Qi Zheng Reviewed-by: Steven Price --- 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 | 30 +++ 4 files ch

[dm-devel] [PATCH v4 41/48] fs: super: dynamically allocate the s_shrink

2023-08-07 Thread Qi Zheng
In preparation for implementing lockless slab shrink, use new APIs 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

[dm-devel] [PATCH v4 21/48] sunrpc: dynamically allocate the sunrpc_cred shrinker

2023-08-07 Thread Qi Zheng
Use new APIs to dynamically allocate the sunrpc_cred shrinker. Signed-off-by: Qi Zheng Reviewed-by: Muchun Song --- net/sunrpc/auth.c | 21 + 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/net/sunrpc/auth.c b/net/sunrpc/auth.c index 2f16f9d17966

[dm-devel] [PATCH v4 24/48] drm/msm: dynamically allocate the drm-msm_gem shrinker

2023-08-07 Thread Qi Zheng
ff-by: Qi Zheng Reviewed-by: Muchun Song --- drivers/gpu/drm/msm/msm_drv.c | 4 ++- drivers/gpu/drm/msm/msm_drv.h | 4 +-- drivers/gpu/drm/msm/msm_gem_shrinker.c | 34 -- 3 files changed, 26 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/dr

[dm-devel] [PATCH v4 37/48] xfs: dynamically allocate the xfs-buf shrinker

2023-08-07 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

[dm-devel] [PATCH v4 22/48] mm: workingset: dynamically allocate the mm-shadow shrinker

2023-08-07 Thread Qi Zheng
Use new APIs to dynamically allocate the mm-shadow shrinker. Signed-off-by: Qi Zheng --- mm/workingset.c | 27 ++- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/mm/workingset.c b/mm/workingset.c index da58a26d0d4d..3c53138903a7 100644 --- a/mm

[dm-devel] [PATCH v4 11/48] gfs2: dynamically allocate the gfs2-glock shrinker

2023-08-07 Thread Qi Zheng
Use new APIs to dynamically allocate the gfs2-glock shrinker. Signed-off-by: Qi Zheng Reviewed-by: Muchun Song --- 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..8d582ba7514f 100644

[dm-devel] [PATCH v4 18/48] rcu: dynamically allocate the rcu-lazy shrinker

2023-08-07 Thread Qi Zheng
Use new APIs to dynamically allocate the rcu-lazy shrinker. Signed-off-by: Qi Zheng --- kernel/rcu/tree_nocb.h | 20 +++- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/kernel/rcu/tree_nocb.h b/kernel/rcu/tree_nocb.h index 5598212d1f27..e1c59c33738a 100644 --- a

[dm-devel] [PATCH v4 05/48] kvm: mmu: dynamically allocate the x86-mmu shrinker

2023-08-07 Thread Qi Zheng
Use new APIs to dynamically allocate the x86-mmu shrinker. Signed-off-by: Qi Zheng Reviewed-by: Muchun Song --- 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 9e4cd8b4a202

[dm-devel] [PATCH v4 19/48] rcu: dynamically allocate the rcu-kfree shrinker

2023-08-07 Thread Qi Zheng
Use new APIs to dynamically allocate the rcu-kfree shrinker. Signed-off-by: Qi Zheng --- kernel/rcu/tree.c | 22 +- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 7c79480bfaa0..3b20fc46c514 100644 --- a/kernel/rcu

[dm-devel] [PATCH v4 00/48] use refcount+RCU method to implement lockless slab shrink

2023-08-07 Thread Qi Zheng
d memcg slab shrink 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 (48): mm: move some shrinker-related function declar

[dm-devel] [PATCH v4 30/48] vmw_balloon: dynamically allocate the vmw-balloon shrinker

2023-08-07 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 Reviewed-by: Muchun Song --- drivers/misc/vmw_balloon.c | 38 -- 1 file changed, 12 insertions(+), 26 dele

Re: [dm-devel] [PATCH v4 44/48] mm: shrinker: add a secondary array for shrinker_info::{map, nr_deferred}

2023-08-07 Thread Qi Zheng
Hi Dave, On 2023/8/8 10:12, Dave Chinner wrote: On Mon, Aug 07, 2023 at 07:09:32PM +0800, Qi Zheng wrote: Currently, we maintain two linear arrays per node per memcg, which are shrinker_info::map and shrinker_info::nr_deferred. And we need to resize them when the shrinker_nr_max is exceeded

[dm-devel] [PATCH v4 31/48] virtio_balloon: dynamically allocate the virtio-balloon shrinker

2023-08-07 Thread Qi Zheng
ff-by: Qi Zheng Reviewed-by: Muchun Song --- 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..82e6087073a9 100644 --- a/drivers/v

[dm-devel] [PATCH v4 23/48] drm/i915: dynamically allocate the i915_gem_mm shrinker

2023-08-07 Thread Qi Zheng
ff-by: Qi Zheng Reviewed-by: Muchun Song --- 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/gp

[dm-devel] [PATCH v4 38/48] xfs: dynamically allocate the xfs-inodegc shrinker

2023-08-07 Thread Qi Zheng
In preparation for implementing lockless slab shrink, use new APIs 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-b

[dm-devel] [PATCH v4 33/48] ext4: dynamically allocate the ext4-es shrinker

2023-08-07 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

[dm-devel] [PATCH v4 36/48] nfsd: dynamically allocate the nfsd-reply shrinker

2023-08-07 Thread Qi Zheng
In preparation for implementing lockless slab shrink, use new APIs 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

[dm-devel] [PATCH v4 28/48] md/raid5: dynamically allocate the md-raid5 shrinker

2023-08-07 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

[dm-devel] [PATCH v4 34/48] jbd2, ext4: dynamically allocate the jbd2-journal shrinker

2023-08-07 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

[dm-devel] [PATCH v4 26/48] dm: dynamically allocate the dm-bufio shrinker

2023-08-07 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

[dm-devel] [PATCH v4 13/48] NFSv4.2: dynamically allocate the nfs-xattr shrinkers

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

[dm-devel] [PATCH v4 12/48] gfs2: dynamically allocate the gfs2-qd shrinker

2023-08-07 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

[dm-devel] [PATCH v4 01/48] mm: move some shrinker-related function declarations to mm/internal.h

2023-08-07 Thread Qi Zheng
The following functions are only used inside the mm subsystem, so it's better to move their declarations to the mm/internal.h file. 1. shrinker_debugfs_add() 2. shrinker_debugfs_detach() 3. shrinker_debugfs_remove() Signed-off-by: Qi Zheng --- include/linux/shrinker.h

[dm-devel] [PATCH v4 09/48] erofs: dynamically allocate the erofs-shrinker

2023-08-07 Thread Qi Zheng
Use new APIs to dynamically allocate the erofs-shrinker. Signed-off-by: Qi Zheng Reviewed-by: Muchun Song --- 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..6e1a828e6ca3 100644

[dm-devel] [PATCH v4 08/48] xenbus/backend: dynamically allocate the xen-backend shrinker

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

[dm-devel] [PATCH v4 14/48] nfs: dynamically allocate the nfs-acl shrinker

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

[dm-devel] [PATCH v4 39/48] xfs: dynamically allocate the xfs-qm shrinker

2023-08-07 Thread Qi Zheng
In preparation for implementing lockless slab shrink, use new APIs 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-b

Re: [dm-devel] [PATCH v3 05/49] mm: shrinker: add infrastructure for dynamically allocating shrinker

2023-07-30 Thread Qi Zheng
Hi Simon, On 2023/7/28 20:17, Simon Horman wrote: On Thu, Jul 27, 2023 at 04:04:18PM +0800, Qi Zheng wrote: Currently, the shrinker instances can be divided into the following three types: a) global shrinker instance statically defined in the kernel, such as workingset_shadow_shrinker. b

Re: [dm-devel] [PATCH v3 04/49] mm: shrinker: remove redundant shrinker_rwsem in debugfs operations

2023-07-30 Thread Qi Zheng
Hi Simon, On 2023/7/28 16:13, Simon Horman wrote: On Thu, Jul 27, 2023 at 04:04:17PM +0800, Qi Zheng wrote: The debugfs_remove_recursive() will wait for debugfs_file_put() to return, so the shrinker will not be freed when doing debugfs operations (such as shrinker_debugfs_count_show() and

[dm-devel] [PATCH v3 41/49] zsmalloc: dynamically allocate the mm-zspool shrinker

2023-07-27 Thread Qi Zheng
In preparation for implementing lockless slab shrink, use new APIs 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

Re: [dm-devel] [PATCH v3 16/49] nfsd: dynamically allocate the nfsd-filecache shrinker

2023-07-27 Thread Qi Zheng
On 2023/7/27 16:04, Qi Zheng wrote: Use new APIs to dynamically allocate the nfsd-filecache shrinker. Signed-off-by: Qi Zheng Reviewed-by: Muchun Song --- fs/nfsd/filecache.c | 22 -- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/fs/nfsd/filecache.c

[dm-devel] [PATCH v3 47/49] mm: shrinker: make memcg slab shrink lockless

2023-07-27 Thread Qi Zheng
ink_slab, which is what we expect. Signed-off-by: Qi Zheng --- mm/shrinker.c | 80 ++- 1 file changed, 54 insertions(+), 26 deletions(-) diff --git a/mm/shrinker.c b/mm/shrinker.c index d318f5621862..fee6f62904fb 100644 --- a/mm/shrinker.c +++ b/mm/shrin

[dm-devel] [PATCH v3 37/49] nfsd: dynamically allocate the nfsd-reply shrinker

2023-07-27 Thread Qi Zheng
In preparation for implementing lockless slab shrink, use new APIs 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

[dm-devel] [PATCH v3 32/49] virtio_balloon: dynamically allocate the virtio-balloon shrinker

2023-07-27 Thread Qi Zheng
ff-by: Qi Zheng Reviewed-by: Muchun Song --- 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..82e6087073a9 100644 --- a/drivers/v

[dm-devel] [PATCH v3 33/49] mbcache: dynamically allocate the mbcache shrinker

2023-07-27 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

[dm-devel] [PATCH v3 46/49] mm: shrinker: make global slab shrink lockless

2023-07-27 Thread Qi Zheng
0-1-qi.zh...@linux.dev/ [5]. https://lore.kernel.org/lkml/zijhou1d55d4h...@dread.disaster.area/ Signed-off-by: Qi Zheng --- include/linux/shrinker.h | 17 ++ mm/shrinker.c| 70 +--- 2 files changed, 68 insertions(+), 19 deletions(-) diff --git

[dm-devel] [PATCH v3 40/49] xfs: dynamically allocate the xfs-qm shrinker

2023-07-27 Thread Qi Zheng
In preparation for implementing lockless slab shrink, use new APIs 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-b

Re: [dm-devel] [PATCH v3 29/49] md/raid5: dynamically allocate the md-raid5 shrinker

2023-07-27 Thread Qi Zheng
On 2023/7/27 16:04, Qi Zheng wrote: 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 releasin

[dm-devel] [PATCH v3 27/49] dm: dynamically allocate the dm-bufio shrinker

2023-07-27 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

[dm-devel] [PATCH v3 48/49] mm: shrinker: hold write lock to reparent shrinker nr_deferred

2023-07-27 Thread Qi Zheng
shrinker_rwsem to reparent. Signed-off-by: Qi Zheng --- mm/shrinker.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/shrinker.c b/mm/shrinker.c index fee6f62904fb..a12dede5d21f 100644 --- a/mm/shrinker.c +++ b/mm/shrinker.c @@ -299,7 +299,7 @@ void reparent_shrinker_deferred

[dm-devel] [PATCH v3 45/49] mm: shrinker: add a secondary array for shrinker_info::{map, nr_deferred}

2023-07-27 Thread Qi Zheng
we only need to copy this secondary array every time the size is resized. Then even if we get the old secondary array under the RCU lock, the found map and nr_deferred are also true, so no data is lost. [1]. https://lore.kernel.org/all/20220228122126.37293-13-songmuc...@bytedance.com/ Signed-off

[dm-devel] [PATCH v3 30/49] bcache: dynamically allocate the md-bcache shrinker

2023-07-27 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

[dm-devel] [PATCH v3 00/49] use refcount+RCU method to implement lockless slab shrink

2023-07-27 Thread Qi Zheng
y 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 (49): binder: fix memory leak in binder_init() mm: move some shrinker-related function declarati

[dm-devel] [PATCH v3 17/49] quota: dynamically allocate the dquota-cache shrinker

2023-07-27 Thread Qi Zheng
Use new APIs to dynamically allocate the dquota-cache shrinker. Signed-off-by: Qi Zheng Reviewed-by: Muchun Song --- fs/quota/dquot.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index e8232242dd34..8883e6992f7c

[dm-devel] [PATCH v3 34/49] ext4: dynamically allocate the ext4-es shrinker

2023-07-27 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

[dm-devel] [PATCH v3 38/49] xfs: dynamically allocate the xfs-buf shrinker

2023-07-27 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

[dm-devel] [PATCH v3 11/49] f2fs: dynamically allocate the f2fs-shrinker

2023-07-27 Thread Qi Zheng
Use new APIs to dynamically allocate the f2fs-shrinker. Signed-off-by: Qi Zheng Reviewed-by: Muchun Song --- 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 a123f1378d57..9200b67aa745

[dm-devel] [PATCH v3 43/49] mm: shrinker: remove old APIs

2023-07-27 Thread Qi Zheng
Now no users are using the old APIs, just remove them. Signed-off-by: Qi Zheng Reviewed-by: Muchun Song --- include/linux/shrinker.h | 7 -- mm/shrinker.c| 143 --- 2 files changed, 150 deletions(-) diff --git a/include/linux/shrinker.h b

Re: [dm-devel] [PATCH v3 28/49] dm zoned: dynamically allocate the dm-zoned-meta shrinker

2023-07-27 Thread Qi Zheng
Hi, On 2023/7/27 16:30, Damien Le Moal wrote: On 7/27/23 17:04, Qi Zheng wrote: In preparation for implementing lockless slab shrink, use new APIs 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 fo

[dm-devel] [PATCH v3 24/49] drm/i915: dynamically allocate the i915_gem_mm shrinker

2023-07-27 Thread Qi Zheng
ff-by: Qi Zheng Reviewed-by: Muchun Song --- 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/gp

[dm-devel] [PATCH v3 29/49] md/raid5: dynamically allocate the md-raid5 shrinker

2023-07-27 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

[dm-devel] [PATCH v3 23/49] mm: workingset: dynamically allocate the mm-shadow shrinker

2023-07-27 Thread Qi Zheng
Use new APIs to dynamically allocate the mm-shadow shrinker. Signed-off-by: Qi Zheng --- mm/workingset.c | 27 ++- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/mm/workingset.c b/mm/workingset.c index da58a26d0d4d..3c53138903a7 100644 --- a/mm

[dm-devel] [PATCH v3 18/49] ubifs: dynamically allocate the ubifs-slab shrinker

2023-07-27 Thread Qi Zheng
Use new APIs to dynamically allocate the ubifs-slab shrinker. Signed-off-by: Qi Zheng Reviewed-by: Muchun Song --- 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 b08fb28d16b5..c690782388a8

[dm-devel] [PATCH v3 08/49] drm/ttm: dynamically allocate the drm-ttm_pool shrinker

2023-07-27 Thread Qi Zheng
Use new APIs to dynamically allocate the drm-ttm_pool shrinker. Signed-off-by: Qi Zheng Reviewed-by: Muchun Song --- 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

Re: [dm-devel] [PATCH v3 28/49] dm zoned: dynamically allocate the dm-zoned-meta shrinker

2023-07-27 Thread Qi Zheng
On 2023/7/27 18:20, Damien Le Moal wrote: On 7/27/23 17:55, Qi Zheng wrote:   goto err;   }   +    zmd->mblk_shrinker->count_objects = dmz_mblock_shrinker_count; +    zmd->mblk_shrinker->scan_objects = dmz_mblock_shrinker_scan; +    zmd->mblk_shrinker->see

Re: [dm-devel] [PATCH v3 15/49] nfs: dynamically allocate the nfs-acl shrinker

2023-07-27 Thread Qi Zheng
On 2023/7/27 16:04, Qi Zheng wrote: Use new APIs to dynamically allocate the nfs-acl shrinker. Signed-off-by: Qi Zheng Reviewed-by: Muchun Song --- fs/nfs/super.c | 20 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/fs/nfs/super.c b/fs/nfs/super.c

[dm-devel] [PATCH v3 16/49] nfsd: dynamically allocate the nfsd-filecache shrinker

2023-07-27 Thread Qi Zheng
Use new APIs to dynamically allocate the nfsd-filecache shrinker. Signed-off-by: Qi Zheng Reviewed-by: Muchun Song --- 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

[dm-devel] [PATCH v3 49/49] mm: shrinker: convert shrinker_rwsem to mutex

2023-07-27 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 +- fs/super.c | 2 +- mm/shrinker.c | 28 ++-- mm/shrinker_debug.c

[dm-devel] [PATCH v3 09/49] xenbus/backend: dynamically allocate the xen-backend shrinker

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

[dm-devel] [PATCH v3 39/49] xfs: dynamically allocate the xfs-inodegc shrinker

2023-07-27 Thread Qi Zheng
In preparation for implementing lockless slab shrink, use new APIs 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-b

[dm-devel] [PATCH v3 12/49] gfs2: dynamically allocate the gfs2-glock shrinker

2023-07-27 Thread Qi Zheng
Use new APIs to dynamically allocate the gfs2-glock shrinker. Signed-off-by: Qi Zheng Reviewed-by: Muchun Song --- 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..8d582ba7514f 100644

[dm-devel] [PATCH v3 07/49] binder: dynamically allocate the android-binder shrinker

2023-07-27 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

Re: [dm-devel] [PATCH v3 27/49] dm: dynamically allocate the dm-bufio shrinker

2023-07-27 Thread Qi Zheng
On 2023/7/27 16:04, Qi Zheng wrote: 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 releasin

[dm-devel] [PATCH v3 02/49] mm: move some shrinker-related function declarations to mm/internal.h

2023-07-27 Thread Qi Zheng
The following functions are only used inside the mm subsystem, so it's better to move their declarations to the mm/internal.h file. 1. shrinker_debugfs_add() 2. shrinker_debugfs_detach() 3. shrinker_debugfs_remove() Signed-off-by: Qi Zheng --- include/linux/shrinker.h

[dm-devel] [PATCH v3 28/49] dm zoned: dynamically allocate the dm-zoned-meta shrinker

2023-07-27 Thread Qi Zheng
ff-by: Qi Zheng Reviewed-by: Muchun Song --- 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..0bcb26a43578 100644 --- a/drivers/md/dm-

[dm-devel] [PATCH v3 21/49] mm: thp: dynamically allocate the thp-related shrinkers

2023-07-27 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

Re: [dm-devel] [PATCH v2 44/47] mm: shrinker: make global slab shrink lockless

2023-07-26 Thread Qi Zheng
Hi Dave, On 2023/7/27 07:09, Dave Chinner wrote: On Wed, Jul 26, 2023 at 05:14:09PM +0800, Qi Zheng wrote: On 2023/7/26 16:08, Dave Chinner wrote: On Mon, Jul 24, 2023 at 05:43:51PM +0800, Qi Zheng wrote: @@ -122,6 +126,13 @@ void shrinker_free_non_registered(struct shrinker *shrinker

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

2023-07-26 Thread Qi Zheng
On 2023/7/26 14:49, Muchun Song wrote: On 2023/7/24 17:43, Qi Zheng wrote: 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

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

2023-07-26 Thread Qi Zheng
On 2023/7/26 15:24, Muchun Song wrote: On 2023/7/24 17:43, Qi Zheng wrote: In preparation for implementing lockless slab shrink, use new APIs 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

  1   2   3   >