linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@redhat.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
	Ming Lei <ming.lei@redhat.com>
Subject: [RFC PATCH 8/8] loop: use backing dio at default
Date: Mon, 25 Oct 2021 17:44:37 +0800	[thread overview]
Message-ID: <20211025094437.2837701-9-ming.lei@redhat.com> (raw)
In-Reply-To: <20211025094437.2837701-1-ming.lei@redhat.com>

We have supported to fallback to buffered IO in case dio failure. Also
in reality, most of or quite a lot of IOs(such as FS IO) are actually aligned,
even though loop's logical block size isn't matched with backing
queue's.

So enable direct io at default.

Signed-off-by: Ming Lei <ming.lei@redhat.com>
---
 drivers/block/loop.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index e42c0e3601ac..df057dca7512 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -2285,13 +2285,8 @@ static int loop_add(int i)
 
 	blk_queue_max_hw_sectors(lo->lo_queue, BLK_DEF_MAX_SECTORS);
 
-	/*
-	 * By default, we do buffer IO, so it doesn't make sense to enable
-	 * merge because the I/O submitted to backing file is handled page by
-	 * page. For directio mode, merge does help to dispatch bigger request
-	 * to underlayer disk. We will enable merge once directio is enabled.
-	 */
-	blk_queue_flag_set(QUEUE_FLAG_NOMERGES, lo->lo_queue);
+	/* use backing dio at default */
+	lo->lo_flags |= LO_FLAGS_DIRECT_IO;
 
 	/*
 	 * Disable partition scanning by default. The in-kernel partition
-- 
2.31.1


      parent reply	other threads:[~2021-10-25  9:47 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-25  9:44 [PATCH 0/8] loop: improve dio on backing file Ming Lei
2021-10-25  9:44 ` [PATCH 1/8] loop: move flush_dcache_page to ->complete of request Ming Lei
2021-10-26  7:21   ` Christoph Hellwig
2021-10-25  9:44 ` [PATCH 2/8] loop: remove always true check Ming Lei
2021-10-26  7:31   ` Christoph Hellwig
2021-10-25  9:44 ` [PATCH 3/8] loop: add one helper for submitting IO on backing file Ming Lei
2021-10-25  9:44 ` [PATCH 4/8] loop: cover simple read/write via lo_rw_aio() Ming Lei
2021-10-26  7:35   ` Christoph Hellwig
2021-10-25  9:44 ` [PATCH 5/8] loop: fallback to buffered IO in case of dio submission Ming Lei
2021-10-26  7:36   ` Christoph Hellwig
2021-10-25  9:44 ` [PATCH 6/8] loop: relax loop dio use condition Ming Lei
2021-10-26  7:37   ` Christoph Hellwig
2021-10-27  0:20   ` kernel test robot
2021-10-25  9:44 ` [PATCH 7/8] loop: remove lo->use_dio Ming Lei
2021-10-25  9:44 ` Ming Lei [this message]

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=20211025094437.2837701-9-ming.lei@redhat.com \
    --to=ming.lei@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).