linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] fuse/mm: remove BDI_CAP_WRITEBACK_ACCT
@ 2025-07-07 23:46 Joanne Koong
  2025-07-07 23:46 ` [PATCH v2 1/2] fuse: use default writeback accounting Joanne Koong
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Joanne Koong @ 2025-07-07 23:46 UTC (permalink / raw)
  To: miklos; +Cc: linux-fsdevel, david, willy, linux-mm

With the changes in commit 0c58a97f919c ("fuse: remove tmp folio for
writebacks and internal rb tree") which removed using temp folios for dirty
page writeback, fuse can now use the default writeback accounting instead of
doing its own accounting. This allows us to get rid of BDI_CAP_WRITEBACK_ACCT
altogether.


Changelog
---------
v1: https://lore.kernel.org/linux-fsdevel/20250703164556.1576674-1-joannelkoong@gmail.com/
v1 -> v2:
* Get rid of unused variable declarations (kernel test robot)
* Add David's acked-by


Joanne Koong (2):
  fuse: use default writeback accounting
  mm: remove BDI_CAP_WRITEBACK_ACCT

 fs/fuse/file.c              |  9 +-------
 fs/fuse/inode.c             |  2 --
 include/linux/backing-dev.h | 14 +-----------
 mm/backing-dev.c            |  2 +-
 mm/page-writeback.c         | 43 ++++++++++++++++---------------------
 5 files changed, 21 insertions(+), 49 deletions(-)

-- 
2.47.1



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

* [PATCH v2 1/2] fuse: use default writeback accounting
  2025-07-07 23:46 [PATCH v2 0/2] fuse/mm: remove BDI_CAP_WRITEBACK_ACCT Joanne Koong
@ 2025-07-07 23:46 ` Joanne Koong
  2025-07-09 11:06   ` Bernd Schubert
  2025-07-07 23:46 ` [PATCH v2 2/2] mm: remove BDI_CAP_WRITEBACK_ACCT Joanne Koong
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 10+ messages in thread
From: Joanne Koong @ 2025-07-07 23:46 UTC (permalink / raw)
  To: miklos; +Cc: linux-fsdevel, david, willy, linux-mm

commit 0c58a97f919c ("fuse: remove tmp folio for writebacks and internal
rb tree") removed temp folios for dirty page writeback. Consequently,
fuse can now use the default writeback accounting.

With switching fuse to use default writeback accounting, there are some
added benefits. This updates wb->writeback_inodes tracking as well now
and updates writeback throughput estimates after writeback completion.

This commit also removes inc_wb_stat() and dec_wb_stat(). These have no
callers anymore now that fuse does not call them.

Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
---
 fs/fuse/file.c              |  9 +--------
 fs/fuse/inode.c             |  2 --
 include/linux/backing-dev.h | 10 ----------
 3 files changed, 1 insertion(+), 20 deletions(-)

diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index adc4aa6810f5..e53331c851eb 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -1784,19 +1784,15 @@ static void fuse_writepage_finish(struct fuse_writepage_args *wpa)
 	struct fuse_args_pages *ap = &wpa->ia.ap;
 	struct inode *inode = wpa->inode;
 	struct fuse_inode *fi = get_fuse_inode(inode);
-	struct backing_dev_info *bdi = inode_to_bdi(inode);
 	int i;
 
-	for (i = 0; i < ap->num_folios; i++) {
+	for (i = 0; i < ap->num_folios; i++)
 		/*
 		 * Benchmarks showed that ending writeback within the
 		 * scope of the fi->lock alleviates xarray lock
 		 * contention and noticeably improves performance.
 		 */
 		folio_end_writeback(ap->folios[i]);
-		dec_wb_stat(&bdi->wb, WB_WRITEBACK);
-		wb_writeout_inc(&bdi->wb);
-	}
 
 	wake_up(&fi->page_waitq);
 }
@@ -1982,14 +1978,11 @@ static void fuse_writepage_add_to_bucket(struct fuse_conn *fc,
 static void fuse_writepage_args_page_fill(struct fuse_writepage_args *wpa, struct folio *folio,
 					  uint32_t folio_index)
 {
-	struct inode *inode = folio->mapping->host;
 	struct fuse_args_pages *ap = &wpa->ia.ap;
 
 	ap->folios[folio_index] = folio;
 	ap->descs[folio_index].offset = 0;
 	ap->descs[folio_index].length = folio_size(folio);
-
-	inc_wb_stat(&inode_to_bdi(inode)->wb, WB_WRITEBACK);
 }
 
 static struct fuse_writepage_args *fuse_writepage_args_setup(struct folio *folio,
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index bfe8d8af46f3..a6c064eb7d08 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -1557,8 +1557,6 @@ static int fuse_bdi_init(struct fuse_conn *fc, struct super_block *sb)
 	if (err)
 		return err;
 
-	/* fuse does it's own writeback accounting */
-	sb->s_bdi->capabilities &= ~BDI_CAP_WRITEBACK_ACCT;
 	sb->s_bdi->capabilities |= BDI_CAP_STRICTLIMIT;
 
 	/*
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h
index e721148c95d0..9a1e895dd5df 100644
--- a/include/linux/backing-dev.h
+++ b/include/linux/backing-dev.h
@@ -66,16 +66,6 @@ static inline void wb_stat_mod(struct bdi_writeback *wb,
 	percpu_counter_add_batch(&wb->stat[item], amount, WB_STAT_BATCH);
 }
 
-static inline void inc_wb_stat(struct bdi_writeback *wb, enum wb_stat_item item)
-{
-	wb_stat_mod(wb, item, 1);
-}
-
-static inline void dec_wb_stat(struct bdi_writeback *wb, enum wb_stat_item item)
-{
-	wb_stat_mod(wb, item, -1);
-}
-
 static inline s64 wb_stat(struct bdi_writeback *wb, enum wb_stat_item item)
 {
 	return percpu_counter_read_positive(&wb->stat[item]);
-- 
2.47.1



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

* [PATCH v2 2/2] mm: remove BDI_CAP_WRITEBACK_ACCT
  2025-07-07 23:46 [PATCH v2 0/2] fuse/mm: remove BDI_CAP_WRITEBACK_ACCT Joanne Koong
  2025-07-07 23:46 ` [PATCH v2 1/2] fuse: use default writeback accounting Joanne Koong
@ 2025-07-07 23:46 ` Joanne Koong
       [not found]   ` <CGME20250822110133eucas1p2378459d1e802c718ef6028efc06625dc@eucas1p2.samsung.com>
  2025-08-01 20:44 ` [PATCH v2 0/2] fuse/mm: " Joanne Koong
  2025-08-18 12:28 ` Miklos Szeredi
  3 siblings, 1 reply; 10+ messages in thread
From: Joanne Koong @ 2025-07-07 23:46 UTC (permalink / raw)
  To: miklos; +Cc: linux-fsdevel, david, willy, linux-mm

There are no users of BDI_CAP_WRITEBACK_ACCT now that fuse doesn't do
its own writeback accounting. This commit removes
BDI_CAP_WRITEBACK_ACCT.

Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
Acked-by: David Hildenbrand <david@redhat.com>
---
 include/linux/backing-dev.h |  4 +---
 mm/backing-dev.c            |  2 +-
 mm/page-writeback.c         | 43 ++++++++++++++++---------------------
 3 files changed, 20 insertions(+), 29 deletions(-)

diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h
index 9a1e895dd5df..3e64f14739dd 100644
--- a/include/linux/backing-dev.h
+++ b/include/linux/backing-dev.h
@@ -108,12 +108,10 @@ int bdi_set_strict_limit(struct backing_dev_info *bdi, unsigned int strict_limit
  *
  * BDI_CAP_WRITEBACK:		Supports dirty page writeback, and dirty pages
  *				should contribute to accounting
- * BDI_CAP_WRITEBACK_ACCT:	Automatically account writeback pages
  * BDI_CAP_STRICTLIMIT:		Keep number of dirty pages below bdi threshold
  */
 #define BDI_CAP_WRITEBACK		(1 << 0)
-#define BDI_CAP_WRITEBACK_ACCT		(1 << 1)
-#define BDI_CAP_STRICTLIMIT		(1 << 2)
+#define BDI_CAP_STRICTLIMIT		(1 << 1)
 
 extern struct backing_dev_info noop_backing_dev_info;
 
diff --git a/mm/backing-dev.c b/mm/backing-dev.c
index 783904d8c5ef..35f11e75e30e 100644
--- a/mm/backing-dev.c
+++ b/mm/backing-dev.c
@@ -1026,7 +1026,7 @@ struct backing_dev_info *bdi_alloc(int node_id)
 		kfree(bdi);
 		return NULL;
 	}
-	bdi->capabilities = BDI_CAP_WRITEBACK | BDI_CAP_WRITEBACK_ACCT;
+	bdi->capabilities = BDI_CAP_WRITEBACK;
 	bdi->ra_pages = VM_READAHEAD_PAGES;
 	bdi->io_pages = VM_READAHEAD_PAGES;
 	timer_setup(&bdi->laptop_mode_wb_timer, laptop_mode_timer_fn, 0);
diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index 72b0ff0d4bae..11f9a909e8de 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -3016,26 +3016,22 @@ bool __folio_end_writeback(struct folio *folio)
 
 	if (mapping && mapping_use_writeback_tags(mapping)) {
 		struct inode *inode = mapping->host;
-		struct backing_dev_info *bdi = inode_to_bdi(inode);
+		struct bdi_writeback *wb = inode_to_wb(inode);
 		unsigned long flags;
 
 		xa_lock_irqsave(&mapping->i_pages, flags);
 		ret = folio_xor_flags_has_waiters(folio, 1 << PG_writeback);
 		__xa_clear_mark(&mapping->i_pages, folio_index(folio),
 					PAGECACHE_TAG_WRITEBACK);
-		if (bdi->capabilities & BDI_CAP_WRITEBACK_ACCT) {
-			struct bdi_writeback *wb = inode_to_wb(inode);
 
-			wb_stat_mod(wb, WB_WRITEBACK, -nr);
-			__wb_writeout_add(wb, nr);
-			if (!mapping_tagged(mapping, PAGECACHE_TAG_WRITEBACK))
-				wb_inode_writeback_end(wb);
+		wb_stat_mod(wb, WB_WRITEBACK, -nr);
+		__wb_writeout_add(wb, nr);
+		if (!mapping_tagged(mapping, PAGECACHE_TAG_WRITEBACK)) {
+			wb_inode_writeback_end(wb);
+			if (mapping->host)
+				sb_clear_inode_writeback(mapping->host);
 		}
 
-		if (mapping->host && !mapping_tagged(mapping,
-						     PAGECACHE_TAG_WRITEBACK))
-			sb_clear_inode_writeback(mapping->host);
-
 		xa_unlock_irqrestore(&mapping->i_pages, flags);
 	} else {
 		ret = folio_xor_flags_has_waiters(folio, 1 << PG_writeback);
@@ -3060,7 +3056,7 @@ void __folio_start_writeback(struct folio *folio, bool keep_write)
 	if (mapping && mapping_use_writeback_tags(mapping)) {
 		XA_STATE(xas, &mapping->i_pages, folio_index(folio));
 		struct inode *inode = mapping->host;
-		struct backing_dev_info *bdi = inode_to_bdi(inode);
+		struct bdi_writeback *wb = inode_to_wb(inode);
 		unsigned long flags;
 		bool on_wblist;
 
@@ -3071,21 +3067,18 @@ void __folio_start_writeback(struct folio *folio, bool keep_write)
 		on_wblist = mapping_tagged(mapping, PAGECACHE_TAG_WRITEBACK);
 
 		xas_set_mark(&xas, PAGECACHE_TAG_WRITEBACK);
-		if (bdi->capabilities & BDI_CAP_WRITEBACK_ACCT) {
-			struct bdi_writeback *wb = inode_to_wb(inode);
-
-			wb_stat_mod(wb, WB_WRITEBACK, nr);
-			if (!on_wblist)
-				wb_inode_writeback_start(wb);
+		wb_stat_mod(wb, WB_WRITEBACK, nr);
+		if (!on_wblist) {
+			wb_inode_writeback_start(wb);
+			/*
+			 * We can come through here when swapping anonymous
+			 * folios, so we don't necessarily have an inode to
+			 * track for sync.
+			 */
+			if (mapping->host)
+				sb_mark_inode_writeback(mapping->host);
 		}
 
-		/*
-		 * We can come through here when swapping anonymous
-		 * folios, so we don't necessarily have an inode to
-		 * track for sync.
-		 */
-		if (mapping->host && !on_wblist)
-			sb_mark_inode_writeback(mapping->host);
 		if (!folio_test_dirty(folio))
 			xas_clear_mark(&xas, PAGECACHE_TAG_DIRTY);
 		if (!keep_write)
-- 
2.47.1



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

* Re: [PATCH v2 1/2] fuse: use default writeback accounting
  2025-07-07 23:46 ` [PATCH v2 1/2] fuse: use default writeback accounting Joanne Koong
@ 2025-07-09 11:06   ` Bernd Schubert
  2025-07-11 11:58     ` David Hildenbrand
  0 siblings, 1 reply; 10+ messages in thread
From: Bernd Schubert @ 2025-07-09 11:06 UTC (permalink / raw)
  To: Joanne Koong, miklos; +Cc: linux-fsdevel, david, willy, linux-mm



On 7/8/25 01:46, Joanne Koong wrote:
> commit 0c58a97f919c ("fuse: remove tmp folio for writebacks and internal
> rb tree") removed temp folios for dirty page writeback. Consequently,
> fuse can now use the default writeback accounting.
> 
> With switching fuse to use default writeback accounting, there are some
> added benefits. This updates wb->writeback_inodes tracking as well now
> and updates writeback throughput estimates after writeback completion.
> 
> This commit also removes inc_wb_stat() and dec_wb_stat(). These have no
> callers anymore now that fuse does not call them.
> 
> Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
> ---
>  fs/fuse/file.c              |  9 +--------
>  fs/fuse/inode.c             |  2 --
>  include/linux/backing-dev.h | 10 ----------
>  3 files changed, 1 insertion(+), 20 deletions(-)
> 
> diff --git a/fs/fuse/file.c b/fs/fuse/file.c
> index adc4aa6810f5..e53331c851eb 100644
> --- a/fs/fuse/file.c
> +++ b/fs/fuse/file.c
> @@ -1784,19 +1784,15 @@ static void fuse_writepage_finish(struct fuse_writepage_args *wpa)
>  	struct fuse_args_pages *ap = &wpa->ia.ap;
>  	struct inode *inode = wpa->inode;
>  	struct fuse_inode *fi = get_fuse_inode(inode);
> -	struct backing_dev_info *bdi = inode_to_bdi(inode);
>  	int i;
>  
> -	for (i = 0; i < ap->num_folios; i++) {
> +	for (i = 0; i < ap->num_folios; i++)
>  		/*
>  		 * Benchmarks showed that ending writeback within the
>  		 * scope of the fi->lock alleviates xarray lock
>  		 * contention and noticeably improves performance.
>  		 */
>  		folio_end_writeback(ap->folios[i]);
> -		dec_wb_stat(&bdi->wb, WB_WRITEBACK);
> -		wb_writeout_inc(&bdi->wb);
> -	}

Probably, just my own style, personally I keep the braces when there are
comments.

>  
>  	wake_up(&fi->page_waitq);
>  }
> @@ -1982,14 +1978,11 @@ static void fuse_writepage_add_to_bucket(struct fuse_conn *fc,
>  static void fuse_writepage_args_page_fill(struct fuse_writepage_args *wpa, struct folio *folio,
>  					  uint32_t folio_index)
>  {
> -	struct inode *inode = folio->mapping->host;
>  	struct fuse_args_pages *ap = &wpa->ia.ap;
>  
>  	ap->folios[folio_index] = folio;
>  	ap->descs[folio_index].offset = 0;
>  	ap->descs[folio_index].length = folio_size(folio);
> -
> -	inc_wb_stat(&inode_to_bdi(inode)->wb, WB_WRITEBACK);
>  }
>  
>  static struct fuse_writepage_args *fuse_writepage_args_setup(struct folio *folio,
> diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
> index bfe8d8af46f3..a6c064eb7d08 100644
> --- a/fs/fuse/inode.c
> +++ b/fs/fuse/inode.c
> @@ -1557,8 +1557,6 @@ static int fuse_bdi_init(struct fuse_conn *fc, struct super_block *sb)
>  	if (err)
>  		return err;
>  
> -	/* fuse does it's own writeback accounting */
> -	sb->s_bdi->capabilities &= ~BDI_CAP_WRITEBACK_ACCT;
>  	sb->s_bdi->capabilities |= BDI_CAP_STRICTLIMIT;
>  
>  	/*
> diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h
> index e721148c95d0..9a1e895dd5df 100644
> --- a/include/linux/backing-dev.h
> +++ b/include/linux/backing-dev.h
> @@ -66,16 +66,6 @@ static inline void wb_stat_mod(struct bdi_writeback *wb,
>  	percpu_counter_add_batch(&wb->stat[item], amount, WB_STAT_BATCH);
>  }
>  
> -static inline void inc_wb_stat(struct bdi_writeback *wb, enum wb_stat_item item)
> -{
> -	wb_stat_mod(wb, item, 1);
> -}
> -
> -static inline void dec_wb_stat(struct bdi_writeback *wb, enum wb_stat_item item)
> -{
> -	wb_stat_mod(wb, item, -1);
> -}
> -
>  static inline s64 wb_stat(struct bdi_writeback *wb, enum wb_stat_item item)
>  {
>  	return percpu_counter_read_positive(&wb->stat[item]);


Reviewed-by: Bernd Schubert <bschubert@ddn.com>


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

* Re: [PATCH v2 1/2] fuse: use default writeback accounting
  2025-07-09 11:06   ` Bernd Schubert
@ 2025-07-11 11:58     ` David Hildenbrand
  0 siblings, 0 replies; 10+ messages in thread
From: David Hildenbrand @ 2025-07-11 11:58 UTC (permalink / raw)
  To: Bernd Schubert, Joanne Koong, miklos; +Cc: linux-fsdevel, willy, linux-mm

On 09.07.25 13:06, Bernd Schubert wrote:
> 
> 
> On 7/8/25 01:46, Joanne Koong wrote:
>> commit 0c58a97f919c ("fuse: remove tmp folio for writebacks and internal
>> rb tree") removed temp folios for dirty page writeback. Consequently,
>> fuse can now use the default writeback accounting.
>>
>> With switching fuse to use default writeback accounting, there are some
>> added benefits. This updates wb->writeback_inodes tracking as well now
>> and updates writeback throughput estimates after writeback completion.
>>
>> This commit also removes inc_wb_stat() and dec_wb_stat(). These have no
>> callers anymore now that fuse does not call them.
>>
>> Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
>> ---
>>   fs/fuse/file.c              |  9 +--------
>>   fs/fuse/inode.c             |  2 --
>>   include/linux/backing-dev.h | 10 ----------
>>   3 files changed, 1 insertion(+), 20 deletions(-)
>>
>> diff --git a/fs/fuse/file.c b/fs/fuse/file.c
>> index adc4aa6810f5..e53331c851eb 100644
>> --- a/fs/fuse/file.c
>> +++ b/fs/fuse/file.c
>> @@ -1784,19 +1784,15 @@ static void fuse_writepage_finish(struct fuse_writepage_args *wpa)
>>   	struct fuse_args_pages *ap = &wpa->ia.ap;
>>   	struct inode *inode = wpa->inode;
>>   	struct fuse_inode *fi = get_fuse_inode(inode);
>> -	struct backing_dev_info *bdi = inode_to_bdi(inode);
>>   	int i;
>>   
>> -	for (i = 0; i < ap->num_folios; i++) {
>> +	for (i = 0; i < ap->num_folios; i++)
>>   		/*
>>   		 * Benchmarks showed that ending writeback within the
>>   		 * scope of the fi->lock alleviates xarray lock
>>   		 * contention and noticeably improves performance.
>>   		 */
>>   		folio_end_writeback(ap->folios[i]);
>> -		dec_wb_stat(&bdi->wb, WB_WRITEBACK);
>> -		wb_writeout_inc(&bdi->wb);
>> -	}
> 
> Probably, just my own style, personally I keep the braces when there are
> comments.

Yeah, sometimes it can aid readability. I tend to keep them on 
multi-line comments IIRC.

Reviewed-by: David Hildenbrand <david@redhat.com>

-- 
Cheers,

David / dhildenb



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

* Re: [PATCH v2 0/2] fuse/mm: remove BDI_CAP_WRITEBACK_ACCT
  2025-07-07 23:46 [PATCH v2 0/2] fuse/mm: remove BDI_CAP_WRITEBACK_ACCT Joanne Koong
  2025-07-07 23:46 ` [PATCH v2 1/2] fuse: use default writeback accounting Joanne Koong
  2025-07-07 23:46 ` [PATCH v2 2/2] mm: remove BDI_CAP_WRITEBACK_ACCT Joanne Koong
@ 2025-08-01 20:44 ` Joanne Koong
  2025-08-18 12:28 ` Miklos Szeredi
  3 siblings, 0 replies; 10+ messages in thread
From: Joanne Koong @ 2025-08-01 20:44 UTC (permalink / raw)
  To: miklos; +Cc: linux-fsdevel, david, willy, linux-mm

On Mon, Jul 7, 2025 at 4:46 PM Joanne Koong <joannelkoong@gmail.com> wrote:
>
> With the changes in commit 0c58a97f919c ("fuse: remove tmp folio for
> writebacks and internal rb tree") which removed using temp folios for dirty
> page writeback, fuse can now use the default writeback accounting instead of
> doing its own accounting. This allows us to get rid of BDI_CAP_WRITEBACK_ACCT
> altogether.
>
>
> Changelog
> ---------
> v1: https://lore.kernel.org/linux-fsdevel/20250703164556.1576674-1-joannelkoong@gmail.com/
> v1 -> v2:
> * Get rid of unused variable declarations (kernel test robot)
> * Add David's acked-by
>
>
> Joanne Koong (2):
>   fuse: use default writeback accounting
>   mm: remove BDI_CAP_WRITEBACK_ACCT
>
>  fs/fuse/file.c              |  9 +-------
>  fs/fuse/inode.c             |  2 --
>  include/linux/backing-dev.h | 14 +-----------
>  mm/backing-dev.c            |  2 +-
>  mm/page-writeback.c         | 43 ++++++++++++++++---------------------
>  5 files changed, 21 insertions(+), 49 deletions(-)
>

Hi Miklos,

Do you find this patchset acceptable for the fuse tree?

Thanks,
Joanne
> --
> 2.47.1
>


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

* Re: [PATCH v2 0/2] fuse/mm: remove BDI_CAP_WRITEBACK_ACCT
  2025-07-07 23:46 [PATCH v2 0/2] fuse/mm: remove BDI_CAP_WRITEBACK_ACCT Joanne Koong
                   ` (2 preceding siblings ...)
  2025-08-01 20:44 ` [PATCH v2 0/2] fuse/mm: " Joanne Koong
@ 2025-08-18 12:28 ` Miklos Szeredi
  3 siblings, 0 replies; 10+ messages in thread
From: Miklos Szeredi @ 2025-08-18 12:28 UTC (permalink / raw)
  To: Joanne Koong; +Cc: linux-fsdevel, david, willy, linux-mm

On Tue, 8 Jul 2025 at 01:46, Joanne Koong <joannelkoong@gmail.com> wrote:
>
> With the changes in commit 0c58a97f919c ("fuse: remove tmp folio for
> writebacks and internal rb tree") which removed using temp folios for dirty
> page writeback, fuse can now use the default writeback accounting instead of
> doing its own accounting. This allows us to get rid of BDI_CAP_WRITEBACK_ACCT
> altogether.

Applied, thanks.

Miklos


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

* Re: [PATCH v2 2/2] mm: remove BDI_CAP_WRITEBACK_ACCT
       [not found]   ` <CGME20250822110133eucas1p2378459d1e802c718ef6028efc06625dc@eucas1p2.samsung.com>
@ 2025-08-22 11:01     ` Marek Szyprowski
       [not found]       ` <CGME20250822214238eucas1p16934a3c0a9575e6044b61e11f3635af0@eucas1p1.samsung.com>
  0 siblings, 1 reply; 10+ messages in thread
From: Marek Szyprowski @ 2025-08-22 11:01 UTC (permalink / raw)
  To: Joanne Koong, miklos; +Cc: linux-fsdevel, david, willy, linux-mm

On 08.07.2025 01:46, Joanne Koong wrote:
> There are no users of BDI_CAP_WRITEBACK_ACCT now that fuse doesn't do
> its own writeback accounting. This commit removes
> BDI_CAP_WRITEBACK_ACCT.
>
> Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
> Acked-by: David Hildenbrand <david@redhat.com>

This patch landed recently in linux-next as commit 167f21a81a9c ("mm: 
remove BDI_CAP_WRITEBACK_ACCT"). In my tests I found that it triggers 
the ./include/linux/backing-dev.h:239 warning. Reverting $subject on top 
of current linux-next fixes/hides this issue. Here is a detailed log:

------------[ cut here ]------------
WARNING: ./include/linux/backing-dev.h:239 at 
__folio_start_writeback+0x25a/0x26a, CPU#1: swapper/0/1
Modules linked in:
CPU: 1 UID: 0 PID: 1 Comm: swapper/0 Not tainted 
6.17.0-rc2-next-20250822 #10852 NONE
Hardware name: StarFive VisionFive 2 v1.2A (DT)
epc : __folio_start_writeback+0x25a/0x26a
  ra : __folio_start_writeback+0x258/0x26a

[<ffffffff80202222>] __folio_start_writeback+0x25a/0x26a
[<ffffffff802f3260>] __block_write_full_folio+0x124/0x39c
[<ffffffff802f4b6e>] block_write_full_folio+0x8a/0xbc
[<ffffffff804dbf42>] blkdev_writepages+0x3e/0x8a
[<ffffffff802030fa>] do_writepages+0x78/0x11a
[<ffffffff801f2e0e>] filemap_fdatawrite_wbc+0x4a/0x62
[<ffffffff801f6d66>] __filemap_fdatawrite_range+0x52/0x78
[<ffffffff801f6fdc>] filemap_write_and_wait_range+0x40/0x68
[<ffffffff804dacae>] set_blocksize+0xd8/0x152
[<ffffffff804dae18>] sb_min_blocksize+0x44/0xce
[<ffffffff803a0c7a>] ext4_fill_super+0x182/0x2914
[<ffffffff802a72e6>] get_tree_bdev_flags+0xf0/0x168
[<ffffffff802a736c>] get_tree_bdev+0xe/0x16
[<ffffffff8039a09e>] ext4_get_tree+0x14/0x1c
[<ffffffff802a5062>] vfs_get_tree+0x1a/0xa4
[<ffffffff802d17d4>] path_mount+0x23a/0x8ae
[<ffffffff80c20cd4>] init_mount+0x4e/0x86
[<ffffffff80c01622>] do_mount_root+0xe0/0x166
[<ffffffff80c01814>] mount_root_generic+0x11e/0x2d6
[<ffffffff80c02746>] initrd_load+0xf8/0x2b6
[<ffffffff80c01d38>] prepare_namespace+0x150/0x258
[<ffffffff80c01310>] kernel_init_freeable+0x2f2/0x316
[<ffffffff80b6d896>] kernel_init+0x1e/0x13a
[<ffffffff80012288>] ret_from_fork_kernel+0x14/0x208
[<ffffffff80b79392>] ret_from_fork_kernel_asm+0x16/0x18
irq event stamp: 159263
hardirqs last  enabled at (159263): [<ffffffff805e7e4a>] 
percpu_counter_add_batch+0xa6/0xda
hardirqs last disabled at (159262): [<ffffffff805e7e40>] 
percpu_counter_add_batch+0x9c/0xda
softirqs last  enabled at (159248): [<ffffffff8002e972>] 
handle_softirqs+0x3ca/0x462
softirqs last disabled at (159241): [<ffffffff8002eb72>] 
__irq_exit_rcu+0xe2/0x10c
---[ end trace 0000000000000000 ]---


> ---
>   include/linux/backing-dev.h |  4 +---
>   mm/backing-dev.c            |  2 +-
>   mm/page-writeback.c         | 43 ++++++++++++++++---------------------
>   3 files changed, 20 insertions(+), 29 deletions(-)
>
> diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h
> index 9a1e895dd5df..3e64f14739dd 100644
> --- a/include/linux/backing-dev.h
> +++ b/include/linux/backing-dev.h
> @@ -108,12 +108,10 @@ int bdi_set_strict_limit(struct backing_dev_info *bdi, unsigned int strict_limit
>    *
>    * BDI_CAP_WRITEBACK:		Supports dirty page writeback, and dirty pages
>    *				should contribute to accounting
> - * BDI_CAP_WRITEBACK_ACCT:	Automatically account writeback pages
>    * BDI_CAP_STRICTLIMIT:		Keep number of dirty pages below bdi threshold
>    */
>   #define BDI_CAP_WRITEBACK		(1 << 0)
> -#define BDI_CAP_WRITEBACK_ACCT		(1 << 1)
> -#define BDI_CAP_STRICTLIMIT		(1 << 2)
> +#define BDI_CAP_STRICTLIMIT		(1 << 1)
>   
>   extern struct backing_dev_info noop_backing_dev_info;
>   
> diff --git a/mm/backing-dev.c b/mm/backing-dev.c
> index 783904d8c5ef..35f11e75e30e 100644
> --- a/mm/backing-dev.c
> +++ b/mm/backing-dev.c
> @@ -1026,7 +1026,7 @@ struct backing_dev_info *bdi_alloc(int node_id)
>   		kfree(bdi);
>   		return NULL;
>   	}
> -	bdi->capabilities = BDI_CAP_WRITEBACK | BDI_CAP_WRITEBACK_ACCT;
> +	bdi->capabilities = BDI_CAP_WRITEBACK;
>   	bdi->ra_pages = VM_READAHEAD_PAGES;
>   	bdi->io_pages = VM_READAHEAD_PAGES;
>   	timer_setup(&bdi->laptop_mode_wb_timer, laptop_mode_timer_fn, 0);
> diff --git a/mm/page-writeback.c b/mm/page-writeback.c
> index 72b0ff0d4bae..11f9a909e8de 100644
> --- a/mm/page-writeback.c
> +++ b/mm/page-writeback.c
> @@ -3016,26 +3016,22 @@ bool __folio_end_writeback(struct folio *folio)
>   
>   	if (mapping && mapping_use_writeback_tags(mapping)) {
>   		struct inode *inode = mapping->host;
> -		struct backing_dev_info *bdi = inode_to_bdi(inode);
> +		struct bdi_writeback *wb = inode_to_wb(inode);
>   		unsigned long flags;
>   
>   		xa_lock_irqsave(&mapping->i_pages, flags);
>   		ret = folio_xor_flags_has_waiters(folio, 1 << PG_writeback);
>   		__xa_clear_mark(&mapping->i_pages, folio_index(folio),
>   					PAGECACHE_TAG_WRITEBACK);
> -		if (bdi->capabilities & BDI_CAP_WRITEBACK_ACCT) {
> -			struct bdi_writeback *wb = inode_to_wb(inode);
>   
> -			wb_stat_mod(wb, WB_WRITEBACK, -nr);
> -			__wb_writeout_add(wb, nr);
> -			if (!mapping_tagged(mapping, PAGECACHE_TAG_WRITEBACK))
> -				wb_inode_writeback_end(wb);
> +		wb_stat_mod(wb, WB_WRITEBACK, -nr);
> +		__wb_writeout_add(wb, nr);
> +		if (!mapping_tagged(mapping, PAGECACHE_TAG_WRITEBACK)) {
> +			wb_inode_writeback_end(wb);
> +			if (mapping->host)
> +				sb_clear_inode_writeback(mapping->host);
>   		}
>   
> -		if (mapping->host && !mapping_tagged(mapping,
> -						     PAGECACHE_TAG_WRITEBACK))
> -			sb_clear_inode_writeback(mapping->host);
> -
>   		xa_unlock_irqrestore(&mapping->i_pages, flags);
>   	} else {
>   		ret = folio_xor_flags_has_waiters(folio, 1 << PG_writeback);
> @@ -3060,7 +3056,7 @@ void __folio_start_writeback(struct folio *folio, bool keep_write)
>   	if (mapping && mapping_use_writeback_tags(mapping)) {
>   		XA_STATE(xas, &mapping->i_pages, folio_index(folio));
>   		struct inode *inode = mapping->host;
> -		struct backing_dev_info *bdi = inode_to_bdi(inode);
> +		struct bdi_writeback *wb = inode_to_wb(inode);
>   		unsigned long flags;
>   		bool on_wblist;
>   
> @@ -3071,21 +3067,18 @@ void __folio_start_writeback(struct folio *folio, bool keep_write)
>   		on_wblist = mapping_tagged(mapping, PAGECACHE_TAG_WRITEBACK);
>   
>   		xas_set_mark(&xas, PAGECACHE_TAG_WRITEBACK);
> -		if (bdi->capabilities & BDI_CAP_WRITEBACK_ACCT) {
> -			struct bdi_writeback *wb = inode_to_wb(inode);
> -
> -			wb_stat_mod(wb, WB_WRITEBACK, nr);
> -			if (!on_wblist)
> -				wb_inode_writeback_start(wb);
> +		wb_stat_mod(wb, WB_WRITEBACK, nr);
> +		if (!on_wblist) {
> +			wb_inode_writeback_start(wb);
> +			/*
> +			 * We can come through here when swapping anonymous
> +			 * folios, so we don't necessarily have an inode to
> +			 * track for sync.
> +			 */
> +			if (mapping->host)
> +				sb_mark_inode_writeback(mapping->host);
>   		}
>   
> -		/*
> -		 * We can come through here when swapping anonymous
> -		 * folios, so we don't necessarily have an inode to
> -		 * track for sync.
> -		 */
> -		if (mapping->host && !on_wblist)
> -			sb_mark_inode_writeback(mapping->host);
>   		if (!folio_test_dirty(folio))
>   			xas_clear_mark(&xas, PAGECACHE_TAG_DIRTY);
>   		if (!keep_write)

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland



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

* Re: [PATCH v2 2/2] mm: remove BDI_CAP_WRITEBACK_ACCT
       [not found]       ` <CGME20250822214238eucas1p16934a3c0a9575e6044b61e11f3635af0@eucas1p1.samsung.com>
@ 2025-08-22 21:42         ` Marek Szyprowski
  2025-08-22 23:20           ` Joanne Koong
  0 siblings, 1 reply; 10+ messages in thread
From: Marek Szyprowski @ 2025-08-22 21:42 UTC (permalink / raw)
  To: Joanne Koong, miklos; +Cc: linux-fsdevel, david, willy, linux-mm

On 22.08.2025 13:01, Marek Szyprowski wrote:
> On 08.07.2025 01:46, Joanne Koong wrote:
>> There are no users of BDI_CAP_WRITEBACK_ACCT now that fuse doesn't do
>> its own writeback accounting. This commit removes
>> BDI_CAP_WRITEBACK_ACCT.
>>
>> Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
>> Acked-by: David Hildenbrand <david@redhat.com>
>
> This patch landed recently in linux-next as commit 167f21a81a9c ("mm: 
> remove BDI_CAP_WRITEBACK_ACCT"). In my tests I found that it triggers 
> the ./include/linux/backing-dev.h:239 warning. Reverting $subject on 
> top of current linux-next fixes/hides this issue. Here is a detailed log:
>
> ------------[ cut here ]------------
> WARNING: ./include/linux/backing-dev.h:239 at 
> __folio_start_writeback+0x25a/0x26a, CPU#1: swapper/0/1
> Modules linked in:
> CPU: 1 UID: 0 PID: 1 Comm: swapper/0 Not tainted 
> 6.17.0-rc2-next-20250822 #10852 NONE
> Hardware name: StarFive VisionFive 2 v1.2A (DT)
> epc : __folio_start_writeback+0x25a/0x26a
>  ra : __folio_start_writeback+0x258/0x26a
>
> [<ffffffff80202222>] __folio_start_writeback+0x25a/0x26a
> [<ffffffff802f3260>] __block_write_full_folio+0x124/0x39c
> [<ffffffff802f4b6e>] block_write_full_folio+0x8a/0xbc
> [<ffffffff804dbf42>] blkdev_writepages+0x3e/0x8a
> [<ffffffff802030fa>] do_writepages+0x78/0x11a
> [<ffffffff801f2e0e>] filemap_fdatawrite_wbc+0x4a/0x62
> [<ffffffff801f6d66>] __filemap_fdatawrite_range+0x52/0x78
> [<ffffffff801f6fdc>] filemap_write_and_wait_range+0x40/0x68
> [<ffffffff804dacae>] set_blocksize+0xd8/0x152
> [<ffffffff804dae18>] sb_min_blocksize+0x44/0xce
> [<ffffffff803a0c7a>] ext4_fill_super+0x182/0x2914
> [<ffffffff802a72e6>] get_tree_bdev_flags+0xf0/0x168
> [<ffffffff802a736c>] get_tree_bdev+0xe/0x16
> [<ffffffff8039a09e>] ext4_get_tree+0x14/0x1c
> [<ffffffff802a5062>] vfs_get_tree+0x1a/0xa4
> [<ffffffff802d17d4>] path_mount+0x23a/0x8ae
> [<ffffffff80c20cd4>] init_mount+0x4e/0x86
> [<ffffffff80c01622>] do_mount_root+0xe0/0x166
> [<ffffffff80c01814>] mount_root_generic+0x11e/0x2d6
> [<ffffffff80c02746>] initrd_load+0xf8/0x2b6
> [<ffffffff80c01d38>] prepare_namespace+0x150/0x258
> [<ffffffff80c01310>] kernel_init_freeable+0x2f2/0x316
> [<ffffffff80b6d896>] kernel_init+0x1e/0x13a
> [<ffffffff80012288>] ret_from_fork_kernel+0x14/0x208
> [<ffffffff80b79392>] ret_from_fork_kernel_asm+0x16/0x18
> irq event stamp: 159263
> hardirqs last  enabled at (159263): [<ffffffff805e7e4a>] 
> percpu_counter_add_batch+0xa6/0xda
> hardirqs last disabled at (159262): [<ffffffff805e7e40>] 
> percpu_counter_add_batch+0x9c/0xda
> softirqs last  enabled at (159248): [<ffffffff8002e972>] 
> handle_softirqs+0x3ca/0x462
> softirqs last disabled at (159241): [<ffffffff8002eb72>] 
> __irq_exit_rcu+0xe2/0x10c
> ---[ end trace 0000000000000000 ]---

I've played a bit with the code modified by the $subject patch and it 
looks that the following change fixes the issue, although I didn't 
analyze exactly where struct bdi_writeback is being modified:

diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index 99e80bdb3084..3887ac2e6475 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -2984,7 +2984,7 @@ bool __folio_end_writeback(struct folio *folio)

         if (mapping && mapping_use_writeback_tags(mapping)) {
                 struct inode *inode = mapping->host;
-               struct bdi_writeback *wb = inode_to_wb(inode);
+               struct bdi_writeback *wb;
                 unsigned long flags;

                 xa_lock_irqsave(&mapping->i_pages, flags);
@@ -2992,6 +2992,7 @@ bool __folio_end_writeback(struct folio *folio)
                 __xa_clear_mark(&mapping->i_pages, folio_index(folio),
                                         PAGECACHE_TAG_WRITEBACK);

+               wb = inode_to_wb(inode);
                 wb_stat_mod(wb, WB_WRITEBACK, -nr);
                 __wb_writeout_add(wb, nr);
                 if (!mapping_tagged(mapping, PAGECACHE_TAG_WRITEBACK)) {
@@ -3024,7 +3025,7 @@ void __folio_start_writeback(struct folio *folio, 
bool keep_write)
         if (mapping && mapping_use_writeback_tags(mapping)) {
                 XA_STATE(xas, &mapping->i_pages, folio_index(folio));
                 struct inode *inode = mapping->host;
-               struct bdi_writeback *wb = inode_to_wb(inode);
+               struct bdi_writeback *wb;
                 unsigned long flags;
                 bool on_wblist;

@@ -3035,6 +3036,7 @@ void __folio_start_writeback(struct folio *folio, 
bool keep_write)
                 on_wblist = mapping_tagged(mapping, 
PAGECACHE_TAG_WRITEBACK);

                 xas_set_mark(&xas, PAGECACHE_TAG_WRITEBACK);
+               wb = inode_to_wb(inode);
                 wb_stat_mod(wb, WB_WRITEBACK, nr);
                 if (!on_wblist) {
                         wb_inode_writeback_start(wb);


> ...

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland



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

* Re: [PATCH v2 2/2] mm: remove BDI_CAP_WRITEBACK_ACCT
  2025-08-22 21:42         ` Marek Szyprowski
@ 2025-08-22 23:20           ` Joanne Koong
  0 siblings, 0 replies; 10+ messages in thread
From: Joanne Koong @ 2025-08-22 23:20 UTC (permalink / raw)
  To: Marek Szyprowski; +Cc: miklos, linux-fsdevel, david, willy, linux-mm

On Fri, Aug 22, 2025 at 2:42 PM Marek Szyprowski
<m.szyprowski@samsung.com> wrote:
>
> On 22.08.2025 13:01, Marek Szyprowski wrote:
> > On 08.07.2025 01:46, Joanne Koong wrote:
> >> There are no users of BDI_CAP_WRITEBACK_ACCT now that fuse doesn't do
> >> its own writeback accounting. This commit removes
> >> BDI_CAP_WRITEBACK_ACCT.
> >>
> >> Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
> >> Acked-by: David Hildenbrand <david@redhat.com>
> >
> > This patch landed recently in linux-next as commit 167f21a81a9c ("mm:
> > remove BDI_CAP_WRITEBACK_ACCT"). In my tests I found that it triggers
> > the ./include/linux/backing-dev.h:239 warning. Reverting $subject on
> > top of current linux-next fixes/hides this issue. Here is a detailed log:
> >
> > ------------[ cut here ]------------
> > WARNING: ./include/linux/backing-dev.h:239 at
> > __folio_start_writeback+0x25a/0x26a, CPU#1: swapper/0/1
> > Modules linked in:
> > CPU: 1 UID: 0 PID: 1 Comm: swapper/0 Not tainted
> > 6.17.0-rc2-next-20250822 #10852 NONE
> > Hardware name: StarFive VisionFive 2 v1.2A (DT)
> > epc : __folio_start_writeback+0x25a/0x26a
> >  ra : __folio_start_writeback+0x258/0x26a
> >
> > [<ffffffff80202222>] __folio_start_writeback+0x25a/0x26a
> > [<ffffffff802f3260>] __block_write_full_folio+0x124/0x39c
> > [<ffffffff802f4b6e>] block_write_full_folio+0x8a/0xbc
> > [<ffffffff804dbf42>] blkdev_writepages+0x3e/0x8a
> > [<ffffffff802030fa>] do_writepages+0x78/0x11a
> > [<ffffffff801f2e0e>] filemap_fdatawrite_wbc+0x4a/0x62
> > [<ffffffff801f6d66>] __filemap_fdatawrite_range+0x52/0x78
> > [<ffffffff801f6fdc>] filemap_write_and_wait_range+0x40/0x68
> > [<ffffffff804dacae>] set_blocksize+0xd8/0x152
> > [<ffffffff804dae18>] sb_min_blocksize+0x44/0xce
> > [<ffffffff803a0c7a>] ext4_fill_super+0x182/0x2914
> > [<ffffffff802a72e6>] get_tree_bdev_flags+0xf0/0x168
> > [<ffffffff802a736c>] get_tree_bdev+0xe/0x16
> > [<ffffffff8039a09e>] ext4_get_tree+0x14/0x1c
> > [<ffffffff802a5062>] vfs_get_tree+0x1a/0xa4
> > [<ffffffff802d17d4>] path_mount+0x23a/0x8ae
> > [<ffffffff80c20cd4>] init_mount+0x4e/0x86
> > [<ffffffff80c01622>] do_mount_root+0xe0/0x166
> > [<ffffffff80c01814>] mount_root_generic+0x11e/0x2d6
> > [<ffffffff80c02746>] initrd_load+0xf8/0x2b6
> > [<ffffffff80c01d38>] prepare_namespace+0x150/0x258
> > [<ffffffff80c01310>] kernel_init_freeable+0x2f2/0x316
> > [<ffffffff80b6d896>] kernel_init+0x1e/0x13a
> > [<ffffffff80012288>] ret_from_fork_kernel+0x14/0x208
> > [<ffffffff80b79392>] ret_from_fork_kernel_asm+0x16/0x18
> > irq event stamp: 159263
> > hardirqs last  enabled at (159263): [<ffffffff805e7e4a>]
> > percpu_counter_add_batch+0xa6/0xda
> > hardirqs last disabled at (159262): [<ffffffff805e7e40>]
> > percpu_counter_add_batch+0x9c/0xda
> > softirqs last  enabled at (159248): [<ffffffff8002e972>]
> > handle_softirqs+0x3ca/0x462
> > softirqs last disabled at (159241): [<ffffffff8002eb72>]
> > __irq_exit_rcu+0xe2/0x10c
> > ---[ end trace 0000000000000000 ]---
>
> I've played a bit with the code modified by the $subject patch and it
> looks that the following change fixes the issue, although I didn't
> analyze exactly where struct bdi_writeback is being modified:

Hi Marek,

Thank you for the report and analysis.

The comment in the warning you linked to
(./include/linux/backing-dev.h:239) says:
"The caller [of inode_to_wb()] must be holding either @inode->i_lock,
the i_pages lock, or the associated wb's list_lock". (This was added
in commit aaa2cacf8184 "writeback: add lockdep annotation to
inode_to_wb()").

The original code before my change set "wb = inode_to_wb(inode);" only
after the inode->i_mapping->i_pages.xa_lock was held, so your patch
below which reverts it back to this behavior, fixes the lockdep
warning. That looks correct to me. Thanks for the fix.


>
> diff --git a/mm/page-writeback.c b/mm/page-writeback.c
> index 99e80bdb3084..3887ac2e6475 100644
> --- a/mm/page-writeback.c
> +++ b/mm/page-writeback.c
> @@ -2984,7 +2984,7 @@ bool __folio_end_writeback(struct folio *folio)
>
>          if (mapping && mapping_use_writeback_tags(mapping)) {
>                  struct inode *inode = mapping->host;
> -               struct bdi_writeback *wb = inode_to_wb(inode);
> +               struct bdi_writeback *wb;
>                  unsigned long flags;
>
>                  xa_lock_irqsave(&mapping->i_pages, flags);
> @@ -2992,6 +2992,7 @@ bool __folio_end_writeback(struct folio *folio)
>                  __xa_clear_mark(&mapping->i_pages, folio_index(folio),
>                                          PAGECACHE_TAG_WRITEBACK);
>
> +               wb = inode_to_wb(inode);
>                  wb_stat_mod(wb, WB_WRITEBACK, -nr);
>                  __wb_writeout_add(wb, nr);
>                  if (!mapping_tagged(mapping, PAGECACHE_TAG_WRITEBACK)) {
> @@ -3024,7 +3025,7 @@ void __folio_start_writeback(struct folio *folio,
> bool keep_write)
>          if (mapping && mapping_use_writeback_tags(mapping)) {
>                  XA_STATE(xas, &mapping->i_pages, folio_index(folio));
>                  struct inode *inode = mapping->host;
> -               struct bdi_writeback *wb = inode_to_wb(inode);
> +               struct bdi_writeback *wb;
>                  unsigned long flags;
>                  bool on_wblist;
>
> @@ -3035,6 +3036,7 @@ void __folio_start_writeback(struct folio *folio,
> bool keep_write)
>                  on_wblist = mapping_tagged(mapping,
> PAGECACHE_TAG_WRITEBACK);
>
>                  xas_set_mark(&xas, PAGECACHE_TAG_WRITEBACK);
> +               wb = inode_to_wb(inode);
>                  wb_stat_mod(wb, WB_WRITEBACK, nr);
>                  if (!on_wblist) {
>                          wb_inode_writeback_start(wb);
>
>
> > ...
>
> Best regards
> --
> Marek Szyprowski, PhD
> Samsung R&D Institute Poland
>


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

end of thread, other threads:[~2025-08-22 23:20 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-07 23:46 [PATCH v2 0/2] fuse/mm: remove BDI_CAP_WRITEBACK_ACCT Joanne Koong
2025-07-07 23:46 ` [PATCH v2 1/2] fuse: use default writeback accounting Joanne Koong
2025-07-09 11:06   ` Bernd Schubert
2025-07-11 11:58     ` David Hildenbrand
2025-07-07 23:46 ` [PATCH v2 2/2] mm: remove BDI_CAP_WRITEBACK_ACCT Joanne Koong
     [not found]   ` <CGME20250822110133eucas1p2378459d1e802c718ef6028efc06625dc@eucas1p2.samsung.com>
2025-08-22 11:01     ` Marek Szyprowski
     [not found]       ` <CGME20250822214238eucas1p16934a3c0a9575e6044b61e11f3635af0@eucas1p1.samsung.com>
2025-08-22 21:42         ` Marek Szyprowski
2025-08-22 23:20           ` Joanne Koong
2025-08-01 20:44 ` [PATCH v2 0/2] fuse/mm: " Joanne Koong
2025-08-18 12:28 ` Miklos Szeredi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).