diff mbox series

aio: inform block layer of how many requests we are submitting

Message ID 1642497464-1847-1-git-send-email-zhenggy@chinatelecom.cn (mailing list archive)
State New, archived
Headers show
Series aio: inform block layer of how many requests we are submitting | expand

Commit Message

GuoYong Zheng Jan. 18, 2022, 9:17 a.m. UTC
After commit 47c122e35d7e ("block: pre-allocate requests if plug is
started and is a batch"), block layer can make smarter request allocation
if it know how many requests it need to submit, so switch to use
blk_start_plug_nr_ios here to pass the number of requests we will submit.

Signed-off-by: GuoYong Zheng <zhenggy@chinatelecom.cn>
---
 fs/aio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Christoph Hellwig Jan. 20, 2022, 9:03 a.m. UTC | #1
On Tue, Jan 18, 2022 at 05:17:44PM +0800, GuoYong Zheng wrote:
> After commit 47c122e35d7e ("block: pre-allocate requests if plug is
> started and is a batch"), block layer can make smarter request allocation
> if it know how many requests it need to submit, so switch to use
> blk_start_plug_nr_ios here to pass the number of requests we will submit.

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>
diff mbox series

Patch

diff --git a/fs/aio.c b/fs/aio.c
index 4ceba13..7c4935e 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -2071,7 +2071,7 @@  static int io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb,
 		nr = ctx->nr_events;
 
 	if (nr > AIO_PLUG_THRESHOLD)
-		blk_start_plug(&plug);
+		blk_start_plug_nr_ios(&plug, nr);
 	for (i = 0; i < nr; i++) {
 		struct iocb __user *user_iocb;