linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@redhat.com>
To: Harshad Shirwadkar <harshadshirwadkar@gmail.com>
Cc: linux-block@vger.kernel.org, tytso@mit.edu
Subject: Re: [PATCH] block: add split_alignment for request queue
Date: Tue, 16 Jun 2020 10:40:28 +0800	[thread overview]
Message-ID: <20200616024028.GE27192@T590> (raw)
In-Reply-To: <20200616005633.172804-1-harshadshirwadkar@gmail.com>

On Mon, Jun 15, 2020 at 05:56:33PM -0700, Harshad Shirwadkar wrote:
> This feature allows the user to control the alignment at which request
> queue is allowed to split bios. Google CloudSQL's 16k user space
> application expects that direct io writes aligned at 16k boundary in
> the user-space are not split by kernel at non-16k boundaries. More
> details about this feature can be found in CloudSQL's Cloud Next 2018
> presentation[1]. The underlying block device is capable of performing
> 16k aligned writes atomically. Thus, this allows the user-space SQL
> application to avoid double-writes (to protect against partial
> failures) which are very costly provided that these writes are not
> split at non-16k boundary by any underlying layers.
> 
> We make use of Ext4's bigalloc feature to ensure that writes issued by
> Ext4 are 16k aligned. But, 16K aligned data writes may get merged with
> contiguous non-16k aligned Ext4 metadata writes. Such a write request
> would be broken by the kernel only guaranteeing that the individually
> split requests are physical block size aligned.
> 
> We started observing a significant increase in 16k unaligned splits in
> 5.4. Bisect points to commit 07173c3ec276cbb18dc0e0687d37d310e98a1480
> ("block: enable multipage bvecs"). This patch enables multipage bvecs
> resulting in multiple 16k aligned writes issued by the user-space to
> be merged into one big IO at first. Later, __blk_queue_split() splits
> these IOs while trying to align individual split IOs to be physical
> block size.
> 
> Newly added split_alignment parameter is the alignment at which
> requeust queue is allowed to split IO request. By default this
> alignment is turned off and current behavior is unchanged.
> 

Such alignment can be reached via q->limits.chunk_sectors, and you
just need to expose it via sysfs and make it writable.

Thanks,
Ming


  parent reply	other threads:[~2020-06-16  2:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-16  0:56 [PATCH] block: add split_alignment for request queue Harshad Shirwadkar
2020-06-16  2:14 ` John Dorminy
2020-06-16  2:25   ` Martin K. Petersen
2020-06-16  2:40 ` Ming Lei [this message]
2020-06-16  2:50   ` harshad shirwadkar
2020-06-16  3:24     ` harshad shirwadkar
2020-06-16  4:16       ` Ming Lei
2020-06-16  7:29 ` Christoph Hellwig
2020-06-16 11:12   ` Sweet Tea Dorminy
2020-06-16 14:38     ` 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=20200616024028.GE27192@T590 \
    --to=ming.lei@redhat.com \
    --cc=harshadshirwadkar@gmail.com \
    --cc=linux-block@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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).