mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: zhenggy <zhenggy@chinatelecom.cn>
To: bcrl@kvack.org, viro@zeniv.linux.org.uk, ebiggers@kernel.org,
	axboe@kernel.dk
Cc: linux-aio@kvack.org, linux-fsdevel@vger.kernel.org,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH] aio: inform block layer of how many requests we are submitting
Date: Tue, 8 Feb 2022 17:47:17 +0800	[thread overview]
Message-ID: <8e0186ed-04bb-7bb8-ff09-581a7b9fdf03@chinatelecom.cn> (raw)

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

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;

-- 
1.8.3.1


             reply	other threads:[~2022-02-08 11:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-08  9:47 zhenggy [this message]
2022-02-09  6:49 ` Christoph Hellwig
  -- strict thread matches above, loose matches on Subject: below --
2022-01-18  9:17 GuoYong Zheng
2022-01-20  9:03 ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8e0186ed-04bb-7bb8-ff09-581a7b9fdf03@chinatelecom.cn \
    --to=zhenggy@chinatelecom.cn \
    --cc=axboe@kernel.dk \
    --cc=bcrl@kvack.org \
    --cc=ebiggers@kernel.org \
    --cc=linux-aio@kvack.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®