linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fs: iomap: Replace bio_add_page with __bio_add_page in iomap_add_to_ioend
@ 2020-11-30  7:28 chenlei0x
  2020-11-30 17:22 ` Darrick J. Wong
  0 siblings, 1 reply; 2+ messages in thread
From: chenlei0x @ 2020-11-30  7:28 UTC (permalink / raw)
  To: hch, darrick.wong; +Cc: linux-xfs, linux-fsdevel, linux-kernel, Lei Chen

From: Lei Chen <lennychen@tencent.com>

iomap_add_to_ioend append page on wpc->ioend->io_bio. If io_bio is full,
iomap_chain_bio will allocate a new bio. So when bio_add_page is called,
pages is guaranteed to be appended into wpc->ioend->io_bio. So we do not
need to check if page can be merged. Thus it's a faster way to directly
call __bio_add_page.

Signed-off-by: Lei Chen <lennychen@tencent.com>
---
 fs/iomap/buffered-io.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
index 10cc797..7a0631a 100644
--- a/fs/iomap/buffered-io.c
+++ b/fs/iomap/buffered-io.c
@@ -1310,7 +1310,7 @@ static void iomap_writepage_end_bio(struct bio *bio)
 			wpc->ioend->io_bio =
 				iomap_chain_bio(wpc->ioend->io_bio);
 		}
-		bio_add_page(wpc->ioend->io_bio, page, len, poff);
+		__bio_add_page(wpc->ioend->io_bio, page, len, poff);
 	}
 
 	wpc->ioend->io_size += len;
-- 
1.8.3.1


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

* Re: [PATCH] fs: iomap: Replace bio_add_page with __bio_add_page in iomap_add_to_ioend
  2020-11-30  7:28 [PATCH] fs: iomap: Replace bio_add_page with __bio_add_page in iomap_add_to_ioend chenlei0x
@ 2020-11-30 17:22 ` Darrick J. Wong
  0 siblings, 0 replies; 2+ messages in thread
From: Darrick J. Wong @ 2020-11-30 17:22 UTC (permalink / raw)
  To: chenlei0x; +Cc: hch, linux-xfs, linux-fsdevel, linux-kernel, Lei Chen

On Mon, Nov 30, 2020 at 03:28:51PM +0800, chenlei0x@gmail.com wrote:
> From: Lei Chen <lennychen@tencent.com>
> 
> iomap_add_to_ioend append page on wpc->ioend->io_bio. If io_bio is full,
> iomap_chain_bio will allocate a new bio. So when bio_add_page is called,
> pages is guaranteed to be appended into wpc->ioend->io_bio. So we do not
> need to check if page can be merged. Thus it's a faster way to directly
> call __bio_add_page.

How much faster?

--D

> Signed-off-by: Lei Chen <lennychen@tencent.com>
> ---
>  fs/iomap/buffered-io.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
> index 10cc797..7a0631a 100644
> --- a/fs/iomap/buffered-io.c
> +++ b/fs/iomap/buffered-io.c
> @@ -1310,7 +1310,7 @@ static void iomap_writepage_end_bio(struct bio *bio)
>  			wpc->ioend->io_bio =
>  				iomap_chain_bio(wpc->ioend->io_bio);
>  		}
> -		bio_add_page(wpc->ioend->io_bio, page, len, poff);
> +		__bio_add_page(wpc->ioend->io_bio, page, len, poff);
>  	}
>  
>  	wpc->ioend->io_size += len;
> -- 
> 1.8.3.1
> 

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

end of thread, other threads:[~2020-11-30 17:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-30  7:28 [PATCH] fs: iomap: Replace bio_add_page with __bio_add_page in iomap_add_to_ioend chenlei0x
2020-11-30 17:22 ` Darrick J. Wong

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