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

2023-07-26 Thread Qi Zheng via Linux-f2fs-devel
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); v

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

2023-07-26 Thread Dave Chinner via Linux-f2fs-devel
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); > > > void shrinker_register(struct shr

Re: [f2fs-dev] [PATCH v6 7/7] btrfs: convert to multigrain timestamps

2023-07-26 Thread David Sterba
On Tue, Jul 25, 2023 at 10:58:20AM -0400, Jeff Layton wrote: > Enable multigrain timestamps, which should ensure that there is an > apparent change to the timestamp whenever it has been written after > being actively observed via getattr. > > Beyond enabling the FS_MGTIME flag, this patch eliminat

Re: [f2fs-dev] [PATCH v6 1/7] fs: pass the request_mask to generic_fillattr

2023-07-26 Thread Jeff Layton
On Wed, 2023-07-26 at 17:40 +0800, Joseph Qi wrote: > > On 7/25/23 10:58 PM, Jeff Layton wrote: > > generic_fillattr just fills in the entire stat struct indiscriminately > > today, copying data from the inode. There is at least one attribute > > (STATX_CHANGE_COOKIE) that can have side effects wh

Re: [f2fs-dev] [PATCH v6 3/7] tmpfs: bump the mtime/ctime/iversion when page becomes writeable

2023-07-26 Thread Jeff Layton
On Tue, 2023-07-25 at 18:39 -0700, Hugh Dickins wrote: > On Tue, 25 Jul 2023, Jeff Layton wrote: > > > Most filesystems that use the pagecache will update the mtime, ctime, > > and change attribute when a page becomes writeable. Add a page_mkwrite > > operation for tmpfs and just use it to bump th

Re: [f2fs-dev] [PATCH v6 1/7] fs: pass the request_mask to generic_fillattr

2023-07-26 Thread Joseph Qi
On 7/25/23 10:58 PM, Jeff Layton wrote: > generic_fillattr just fills in the entire stat struct indiscriminately > today, copying data from the inode. There is at least one attribute > (STATX_CHANGE_COOKIE) that can have side effects when it is reported, > and we're looking at adding more with t

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

2023-07-26 Thread Qi Zheng via Linux-f2fs-devel
On 2023/7/26 15:32, 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 md-bcache shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-si

Re: [f2fs-dev] [PATCH v2 43/47] mm: shrinker: add a secondary array for shrinker_info::{map, nr_deferred}

2023-07-26 Thread Muchun Song
> On Jul 24, 2023, at 17:43, 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, that is, allocate a new array, > and then copy the old

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

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

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

2023-07-26 Thread Qi Zheng via Linux-f2fs-devel
On 2023/7/26 15:13, Muchun Song wrote: On Jul 24, 2023, at 17:43, Qi Zheng wrote: 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/w

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

2023-07-26 Thread Qi Zheng via Linux-f2fs-devel
On 2023/7/26 15:10, Muchun Song wrote: On 2023/7/24 17:43, Qi Zheng wrote: 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 insertion

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

2023-07-26 Thread Qi Zheng via Linux-f2fs-devel
On 2023/7/26 15:04, Muchun Song wrote: On Jul 24, 2023, at 17:43, Qi Zheng wrote: 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

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

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

Re: [f2fs-dev] [PATCH v2 03/47] mm: shrinker: add infrastructure for dynamically allocating shrinker

2023-07-26 Thread Qi Zheng via Linux-f2fs-devel
Hi Dave, On 2023/7/26 15:26, Dave Chinner wrote: On Mon, Jul 24, 2023 at 05:43:10PM +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: [f2fs-dev] [PATCH v2 44/47] mm: shrinker: make global slab shrink lockless

2023-07-26 Thread Qi Zheng via Linux-f2fs-devel
Hi Dave, On 2023/7/26 16:08, Dave Chinner wrote: On Mon, Jul 24, 2023 at 05:43:51PM +0800, 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 easil

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

2023-07-26 Thread Dave Chinner via Linux-f2fs-devel
On Mon, Jul 24, 2023 at 05:43:51PM +0800, 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 > following cases. > >

Re: [f2fs-dev] [PATCH v2 42/47] drm/ttm: introduce pool_shrink_rwsem

2023-07-26 Thread Muchun Song
> On Jul 24, 2023, at 17:43, 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 shrink, > we can not use shrinker_rwsem or synchronize_rc

Re: [f2fs-dev] [PATCH v2 03/47] mm: shrinker: add infrastructure for dynamically allocating shrinker

2023-07-26 Thread Dave Chinner via Linux-f2fs-devel
On Mon, Jul 24, 2023 at 05:43:10PM +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) global shrinker instance statically defi

Re: [f2fs-dev] [PATCH v2 41/47] mm: shrinker: remove old APIs

2023-07-26 Thread Muchun Song
> On Jul 24, 2023, at 17:43, Qi Zheng wrote: > > Now no users are using the old APIs, just remove them. > > Signed-off-by: Qi Zheng Reviewed-by: Muchun Song ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://list

Re: [f2fs-dev] [PATCH v2 40/47] fs: super: dynamically allocate the s_shrink

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

Re: [f2fs-dev] [PATCH v2 39/47] zsmalloc: dynamically allocate the mm-zspool shrinker

2023-07-26 Thread Muchun Song
> On Jul 24, 2023, at 17:43, Qi Zheng wrote: > > 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 wh

Re: [f2fs-dev] [PATCH v2 38/47] xfs: dynamically allocate the xfs-qm shrinker

2023-07-26 Thread Muchun Song
> On Jul 24, 2023, at 17:43, 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

Re: [f2fs-dev] [PATCH v2 37/47] xfs: dynamically allocate the xfs-inodegc shrinker

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

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

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

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

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

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

2023-07-26 Thread Muchun Song
> On Jul 24, 2023, at 17:43, 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

Re: [f2fs-dev] [PATCH v2 31/47] mbcache: dynamically allocate the mbcache shrinker

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

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

2023-07-26 Thread Muchun Song
> On Jul 24, 2023, at 17:43, Qi Zheng wrote: > > 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 secti

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

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

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

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

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

2023-07-26 Thread Muchun Song
> On Jul 24, 2023, at 17:43, 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 whe

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

2023-07-26 Thread Muchun Song
> On Jul 24, 2023, at 17:43, 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 sectio

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

2023-07-26 Thread Muchun Song
> On Jul 24, 2023, at 17:43, 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 whe

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

2023-07-26 Thread Muchun Song
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 read-side critical section when releasing the

Re: [f2fs-dev] [PATCH v2 22/47] drm/i915: dynamically allocate the i915_gem_mm shrinker

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

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

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

Re: [f2fs-dev] [PATCH v2 20/47] sunrpc: dynamically allocate the sunrpc_cred shrinker

2023-07-26 Thread Muchun Song
> On Jul 24, 2023, at 17:43, Qi Zheng wrote: > > Use new APIs to dynamically allocate the sunrpc_cred shrinker. > > Signed-off-by: Qi Zheng Reviewed-by: Muchun Song ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net http

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

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

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

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

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

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

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

2023-07-26 Thread Muchun Song
> On Jul 24, 2023, at 17:43, Qi Zheng wrote: > > Use new APIs to dynamically allocate the ubifs-slab shrinker. > > Signed-off-by: Qi Zheng Reviewed-by: Muchun Song ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https

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

2023-07-26 Thread Muchun Song
> On Jul 24, 2023, at 17:43, Qi Zheng wrote: > > Use new APIs to dynamically allocate the dquota-cache shrinker. > > Signed-off-by: Qi Zheng Reviewed-by: Muchun Song ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net htt

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

2023-07-26 Thread Muchun Song
> On Jul 24, 2023, at 17:43, Qi Zheng wrote: > > Use new APIs to dynamically allocate the nfsd-filecache shrinker. > > Signed-off-by: Qi Zheng Reviewed-by: Muchun Song ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net h