linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fs/buffer: using __bio_add_page in submit_bh_wbc()
@ 2023-05-30  3:32 gouhao
  2023-05-30  3:39 ` Matthew Wilcox
  0 siblings, 1 reply; 3+ messages in thread
From: gouhao @ 2023-05-30  3:32 UTC (permalink / raw)
  To: viro, brauner, axboe; +Cc: linux-fsdevel, linux-block, linux-kernel

From: Gou Hao <gouhao@uniontech.com>

In submit_bh_wbc(), bio is newly allocated, so it
does not need any merging logic.

And using bio_add_page here will execute 'bio_flagged(
bio, BIO_CLONED)' and 'bio_full' twice, which is unnecessary.

Signed-off-by: Gou Hao <gouhao@uniontech.com>
---
 fs/buffer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/buffer.c b/fs/buffer.c
index a7fc561758b1..5abc26d8399d 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -2760,7 +2760,7 @@ static void submit_bh_wbc(blk_opf_t opf, struct buffer_head *bh,
 
 	bio->bi_iter.bi_sector = bh->b_blocknr * (bh->b_size >> 9);
 
-	bio_add_page(bio, bh->b_page, bh->b_size, bh_offset(bh));
+	__bio_add_page(bio, bh->b_page, bh->b_size, bh_offset(bh));
 	BUG_ON(bio->bi_iter.bi_size != bh->b_size);
 
 	bio->bi_end_io = end_bio_bh_io_sync;
-- 
2.20.1


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

* Re: [PATCH] fs/buffer: using __bio_add_page in submit_bh_wbc()
  2023-05-30  3:32 [PATCH] fs/buffer: using __bio_add_page in submit_bh_wbc() gouhao
@ 2023-05-30  3:39 ` Matthew Wilcox
  2023-05-30  3:52   ` Gou Hao
  0 siblings, 1 reply; 3+ messages in thread
From: Matthew Wilcox @ 2023-05-30  3:39 UTC (permalink / raw)
  To: gouhao; +Cc: viro, brauner, axboe, linux-fsdevel, linux-block, linux-kernel

On Tue, May 30, 2023 at 11:32:39AM +0800, gouhao@uniontech.com wrote:
> From: Gou Hao <gouhao@uniontech.com>
> 
> In submit_bh_wbc(), bio is newly allocated, so it
> does not need any merging logic.
> 
> And using bio_add_page here will execute 'bio_flagged(
> bio, BIO_CLONED)' and 'bio_full' twice, which is unnecessary.

https://lore.kernel.org/linux-fsdevel/20230502101934.24901-5-johannes.thumshirn@wdc.com/

You could send some Reviewed-by: tags to that patch series.

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

* Re: [PATCH] fs/buffer: using __bio_add_page in submit_bh_wbc()
  2023-05-30  3:39 ` Matthew Wilcox
@ 2023-05-30  3:52   ` Gou Hao
  0 siblings, 0 replies; 3+ messages in thread
From: Gou Hao @ 2023-05-30  3:52 UTC (permalink / raw)
  To: Matthew Wilcox
  Cc: viro, brauner, axboe, linux-fsdevel, linux-block, linux-kernel



在 2023/5/30 11:39, Matthew Wilcox 写道:
> On Tue, May 30, 2023 at 11:32:39AM +0800, gouhao@uniontech.com wrote:
>> From: Gou Hao <gouhao@uniontech.com>
>>
>> In submit_bh_wbc(), bio is newly allocated, so it
>> does not need any merging logic.
>>
>> And using bio_add_page here will execute 'bio_flagged(
>> bio, BIO_CLONED)' and 'bio_full' twice, which is unnecessary.
> https://lore.kernel.org/linux-fsdevel/20230502101934.24901-5-johannes.thumshirn@wdc.com/
>
> You could send some Reviewed-by: tags to that patch series.
>
Ok, I didn't notice this patchset, thank you for your review.

-- 
thanks,
Gou Hao


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

end of thread, other threads:[~2023-05-30  3:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-30  3:32 [PATCH] fs/buffer: using __bio_add_page in submit_bh_wbc() gouhao
2023-05-30  3:39 ` Matthew Wilcox
2023-05-30  3:52   ` Gou Hao

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).