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

2023-07-27 Thread Dave Chinner via Linux-f2fs-devel
On Thu, Jul 27, 2023 at 07:20:46PM +0900, 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; > >>> +   

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

2023-07-27 Thread Damien Le Moal
On 7/28/23 07:59, Dave Chinner wrote: > On Thu, Jul 27, 2023 at 07:20:46PM +0900, 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_object

Re: [f2fs-dev] [PATCH v4 0/7] Support negative dentries on case-insensitive ext4 and f2fs

2023-07-27 Thread Theodore Ts'o
On Thu, Jul 27, 2023 at 02:39:55PM -0400, Gabriel Krisman Bertazi wrote: > > Also, Christian, I notice one of the five VFS patches in the series > > has your Reviewed-by tag, but not the others? Is that because you > > haven't had a chance to make a final determination on those patches, > > or you

Re: [f2fs-dev] [PATCH v4 0/7] Support negative dentries on case-insensitive ext4 and f2fs

2023-07-27 Thread Gabriel Krisman Bertazi
"Theodore Ts'o" writes: > On Thu, Jul 27, 2023 at 01:28:36PM -0400, Gabriel Krisman Bertazi wrote: >> This is the v4 of the negative dentry support on case-insensitive >> directories. It doesn't have any functional changes from v1. It applies >> Eric's comments to bring the flags check closet to

Re: [f2fs-dev] [PATCH v4 0/7] Support negative dentries on case-insensitive ext4 and f2fs

2023-07-27 Thread Theodore Ts'o
On Thu, Jul 27, 2023 at 01:28:36PM -0400, Gabriel Krisman Bertazi wrote: > This is the v4 of the negative dentry support on case-insensitive > directories. It doesn't have any functional changes from v1. It applies > Eric's comments to bring the flags check closet together, improve the > documenta

[f2fs-dev] [PATCH v4 3/7] libfs: Validate negative dentries in case-insensitive directories

2023-07-27 Thread Gabriel Krisman Bertazi
From: Gabriel Krisman Bertazi Introduce a dentry revalidation helper to be used by case-insensitive filesystems to check if it is safe to reuse a negative dentry. A negative dentry is safe to be reused on a case-insensitive lookup if it was created during a case-insensitive lookup and this is no

[f2fs-dev] [PATCH v4 4/7] libfs: Chain encryption checks after case-insensitive revalidation

2023-07-27 Thread Gabriel Krisman Bertazi
From: Gabriel Krisman Bertazi Support encrypted dentries in generic_ci_d_revalidate by chaining fscrypt_d_revalidate at the tail of the d_revalidate. This allows filesystem to just call generic_ci_d_revalidate and let it handle any case-insensitive dentry (encrypted or not). Signed-off-by: Gabr

[f2fs-dev] [PATCH v4 6/7] ext4: Enable negative dentries on case-insensitive lookup

2023-07-27 Thread Gabriel Krisman Bertazi
From: Gabriel Krisman Bertazi Instead of invalidating negative dentries during case-insensitive lookups, mark them as such and let them be added to the dcache. d_ci_revalidate is able to properly filter them out if necessary based on the dentry casefold flag. Signed-off-by: Gabriel Krisman Berta

[f2fs-dev] [PATCH v4 2/7] fs: Add DCACHE_CASEFOLDED_NAME flag

2023-07-27 Thread Gabriel Krisman Bertazi
From: Gabriel Krisman Bertazi This flag marks a negative or positive dentry as being created after a case-insensitive lookup operation. It is useful to differentiate dentries this way to detect whether the negative dentry can be trusted during a case-insensitive lookup. Reviewed-by: Theodore Ts

[f2fs-dev] [PATCH v4 0/7] Support negative dentries on case-insensitive ext4 and f2fs

2023-07-27 Thread Gabriel Krisman Bertazi
Hi, This is the v4 of the negative dentry support on case-insensitive directories. It doesn't have any functional changes from v1. It applies Eric's comments to bring the flags check closet together, improve the documentation and improve comments in the code. I also relooked at the locks to ensu

[f2fs-dev] [PATCH v4 5/7] libfs: Merge encrypted_ci_dentry_ops and ci_dentry_ops

2023-07-27 Thread Gabriel Krisman Bertazi
From: Gabriel Krisman Bertazi Now that casefold needs d_revalidate and calls fscrypt_d_revalidate itself, generic_encrypt_ci_dentry_ops and generic_ci_dentry_ops are now equivalent. Merge them together and simplify the setup code. Signed-off-by: Gabriel Krisman Bertazi --- changes since v2:

[f2fs-dev] [PATCH v4 1/7] fs: Expose name under lookup to d_revalidate hook

2023-07-27 Thread Gabriel Krisman Bertazi
From: Gabriel Krisman Bertazi Negative dentries support on case-insensitive ext4/f2fs will require access to the name under lookup to ensure it matches the dentry. This adds an optional new flavor of cached dentry revalidation hook to expose this extra parameter. I'm fine with extending d_reval

[f2fs-dev] [PATCH v4 7/7] f2fs: Enable negative dentries on case-insensitive lookup

2023-07-27 Thread Gabriel Krisman Bertazi
From: Gabriel Krisman Bertazi Instead of invalidating negative dentries during case-insensitive lookups, mark them as such and let them be added to the dcache. d_ci_revalidate is able to properly filter them out if necessary based on the dentry casefold flag. Signed-off-by: Gabriel Krisman Berta

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

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
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->seeks = DEFAULT_SEEKS; +  

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

2023-07-27 Thread Damien Le Moal
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->seeks = DEFAULT_SEEKS; >>> +    zmd->mblk_shrinker->priv

Re: [f2fs-dev] [PATCH v3 40/49] xfs: dynamically allocate the xfs-qm shrinker

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
On 2023/7/27 16:04, Qi Zheng wrote: 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 struc

Re: [f2fs-dev] [PATCH v3 34/49] ext4: dynamically allocate the ext4-es shrinker

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
On 2023/7/27 16:04, Qi Zheng wrote: 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 stru

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

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
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 releasing the str

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

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
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 releasing the str

Re: [f2fs-dev] [PATCH v3 22/49] sunrpc: dynamically allocate the sunrpc_cred shrinker

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
On 2023/7/27 16:04, Qi Zheng wrote: Use new APIs to dynamically allocate the sunrpc_cred shrinker. Signed-off-by: Qi Zheng Reviewed-by: Muchun Song --- net/sunrpc/auth.c | 19 +++ 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/net/sunrpc/auth.c b/net/sunrp

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

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
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

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

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
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 ind

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

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
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 for RCU r

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

2023-07-27 Thread Damien Le Moal
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 for RCU > read-side critical section when releasing t

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

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
Like global slab shrink, this commit also uses refcount+RCU method to make memcg slab shrink lockless. Use the following script to do slab shrink stress test: ``` DIR="/root/shrinker/memcg/mnt" do_create() { mkdir -p /sys/fs/cgroup/memory/test echo 4G > /sys/fs/cgroup/memory/test/memory

[f2fs-dev] [PATCH v3 49/49] mm: shrinker: convert shrinker_rwsem to mutex

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
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|

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

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
For now, reparent_shrinker_deferred() is the only holder of read lock of shrinker_rwsem. And it already holds the global cgroup_mutex, so it will not be called in parallel. Therefore, in order to convert shrinker_rwsem to shrinker_mutex later, here we change to hold the write lock of shrinker_rwse

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

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
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 following cases. 1) When the memory pressure is high and there are many filesystems

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

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
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, that is, allocate a new array, and then copy the old array to the new array, and finally free the old array by R

[f2fs-dev] [PATCH v3 44/49] drm/ttm: introduce pool_shrink_rwsem

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
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 shrink, we can not use shrinker_rwsem or synchronize_rcu() to guarantee that all shrinker invocations have seen an up

[f2fs-dev] [PATCH v3 43/49] mm: shrinker: remove old APIs

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
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/inclu

[f2fs-dev] [PATCH v3 42/49] fs: super: dynamically allocate the s_shrink

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
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 Zheng Reviewe

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

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
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 Zheng R

[f2fs-dev] [PATCH v3 40/49] xfs: dynamically allocate the xfs-qm shrinker

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
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-by: Qi Zheng

[f2fs-dev] [PATCH v3 39/49] xfs: dynamically allocate the xfs-inodegc shrinker

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
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-by: Qi Zhen

[f2fs-dev] [PATCH v3 38/49] xfs: dynamically allocate the xfs-buf shrinker

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
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 Zheng

[f2fs-dev] [PATCH v3 37/49] nfsd: dynamically allocate the nfsd-reply shrinker

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
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 Zheng

[f2fs-dev] [PATCH v3 36/49] nfsd: dynamically allocate the nfsd-client shrinker

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
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-by: Qi Zheng

[f2fs-dev] [PATCH v3 35/49] jbd2, ext4: dynamically allocate the jbd2-journal shrinker

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
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-by: Qi Zhe

[f2fs-dev] [PATCH v3 34/49] ext4: dynamically allocate the ext4-es shrinker

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
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-by: Qi Zheng

[f2fs-dev] [PATCH v3 33/49] mbcache: dynamically allocate the mbcache shrinker

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
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 Zheng Re

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

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

[f2fs-dev] [PATCH v3 30/49] bcache: dynamically allocate the md-bcache shrinker

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
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 Zheng

[f2fs-dev] [PATCH v3 31/49] vmw_balloon: dynamically allocate the vmw-balloon shrinker

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
In preparation for implementing lockless slab shrink, use new APIs 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. And we can simply exit

[f2fs-dev] [PATCH v3 29/49] md/raid5: dynamically allocate the md-raid5 shrinker

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
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 Zheng Rev

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

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
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 for RCU read-side critical section when releasing the struct dmz_metadata. Signed-off-by: Qi

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

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
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-by: Qi Z

[f2fs-dev] [PATCH v3 26/49] drm/panfrost: dynamically allocate the drm-panfrost shrinker

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

[f2fs-dev] [PATCH v3 25/49] drm/msm: dynamically allocate the drm-msm_gem shrinker

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
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 read-side critical section when releasing the struct msm_drm_private. Signed-off-by: Q

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

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
In preparation for implementing lockless slab shrink, use new APIs to dynamically allocate the i915_gem_mm 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 drm_i915_private. Signed-off-by:

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

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
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/workingset

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

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
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 e37150

[f2fs-dev] [PATCH v3 22/49] sunrpc: dynamically allocate the sunrpc_cred shrinker

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
Use new APIs to dynamically allocate the sunrpc_cred shrinker. Signed-off-by: Qi Zheng Reviewed-by: Muchun Song --- 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..6b898b1be6f5 1

[f2fs-dev] [PATCH v3 20/49] rcu: dynamically allocate the rcu-kfree shrinker

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
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 cb1caefa8bd0..6d2f82f79c65 100644 --- a/kernel/rcu/tr

[f2fs-dev] [PATCH v3 19/49] rcu: dynamically allocate the rcu-lazy shrinker

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
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/k

[f2fs-dev] [PATCH v3 18/49] ubifs: dynamically allocate the ubifs-slab shrinker

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
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 1

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

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
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 1006

[f2fs-dev] [PATCH v3 16/49] nfsd: dynamically allocate the nfsd-filecache shrinker

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
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..8

[f2fs-dev] [PATCH v3 15/49] nfs: dynamically allocate the nfs-acl shrinker

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
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 index 2284f749d892..072d82e1be06 100644 --- a/

[f2fs-dev] [PATCH v3 14/49] NFSv4.2: dynamically allocate the nfs-xattr shrinkers

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
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 in

[f2fs-dev] [PATCH v3 13/49] gfs2: dynamically allocate the gfs2-qd shrinker

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
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 af

[f2fs-dev] [PATCH v3 12/49] gfs2: dynamically allocate the gfs2-glock shrinker

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
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

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

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
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 1

[f2fs-dev] [PATCH v3 10/49] erofs: dynamically allocate the erofs-shrinker

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
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 --

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

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
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/driv

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

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
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/t

[f2fs-dev] [PATCH v3 07/49] binder: dynamically allocate the android-binder shrinker

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
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 index

[f2fs-dev] [PATCH v3 06/49] kvm: mmu: dynamically allocate the x86-mmu shrinker

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
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 ec169f5c7dce..15fc

[f2fs-dev] [PATCH v3 05/49] mm: shrinker: add infrastructure for dynamically allocating shrinker

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
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) global shrinker instance statically defined in the kernel modules, such as mmu_shrinker in x86. c) shrinker

[f2fs-dev] [PATCH v3 03/49] mm: vmscan: move shrinker-related code into a separate file

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
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 ---

[f2fs-dev] [PATCH v3 04/49] mm: shrinker: remove redundant shrinker_rwsem in debugfs operations

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
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 shrinker_debugfs_scan_write()), so there is no need to hold shrinker_rwsem during debugfs operations. Signed-off-by:

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

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
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 | 19 ---

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

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
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 shrink using the re

[f2fs-dev] [PATCH v3 01/49] binder: fix memory leak in binder_init()

2023-07-27 Thread Qi Zheng via Linux-f2fs-devel
In binder_init(), the destruction of binder_alloc_shrinker_init() is not performed in the wrong path, which will cause memory leaks. So this commit introduces binder_alloc_shrinker_exit() and calls it in the wrong path to fix that. Fixes: f2517eb76f1f ("android: binder: Add global lru shrinker to