Util-Linux package development
 help / color / mirror / Atom feed
From: Karel Zak <kzak@redhat.com>
To: Tom Yan <tom.ty89@gmail.com>
Cc: util-linux@vger.kernel.org,
	"Martin K. Petersen" <martin.petersen@oracle.com>
Subject: Re: optimal io size / custom alignment
Date: Tue, 16 Jun 2015 11:43:20 +0200	[thread overview]
Message-ID: <20150616094320.GX1992@ws.net.home> (raw)
In-Reply-To: <CAGnHSEm6wDq_EjJXYwqV2Tt2868DbR0bNRYvevhN1AM4qJpaPw@mail.gmail.com>

On Tue, Jun 16, 2015 at 01:20:37PM +0800, Tom Yan wrote:
> The thing is, why any io/transfer size/length should be considered
> when it comes to partition alignment? From what I understand,
> partition alignment is only to make sure partition starts at physical
> boundaries of the disk because of the mismatch between logicial sector
> (512 bytes) and physical sectors (4096 bytes) or pages/erase blocks of
> SSDs.

It's more complicated, the I/O limits are the most important for RAIDs
where optimal I/O size is usually stripe size and you want to use it
for partitions alignment for better performance (if you align to
sector size then read/write on RAID maybe performed on more disks on
unaligned partitions). And it's not only fdisk who cares, it's also
important for mkfs.<type> (for example XFS align according to I/O limits).

And because all this is mess and sometimes HW does not provide
relevant information and because people use dd(1) to copy partition
tables we have decided to use 1MiB granularity if possible. If 1MiB is
useless then we use optimal_io_size, if undefined then minimal_io_size 
and if undefined then sector_size.

http://people.redhat.com/msnitzer/docs/io-limits.txt


Unfortunately the current code does not check if optimal_io_size makes
sense, so thing like 33553920 for 4k device is blindly accepted ;-(

    Karel


-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

  parent reply	other threads:[~2015-06-16  9:43 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-13 14:52 optimal io size / custom alignment Tom Yan
2015-06-15 13:31 ` Karel Zak
2015-06-16  5:20   ` Tom Yan
2015-06-16  5:37     ` Tom Yan
2015-06-16  9:43     ` Karel Zak [this message]
2015-06-16 10:22       ` Tom Yan
2015-06-16 17:08     ` Martin K. Petersen
2015-06-16 19:26       ` Tom Yan
2015-06-16 21:28         ` Martin K. Petersen
2015-06-17  9:49           ` Tom Yan
2015-06-18 21:01             ` Martin K. Petersen
2015-06-20 16:01               ` Tom Yan
2015-06-21  0:12                 ` Martin K. Petersen
2015-06-22 14:32                 ` Alan Stern
2015-07-12  4:19   ` optimal io size / custom alignment -- caution on custom aligns Linda Walsh

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=20150616094320.GX1992@ws.net.home \
    --to=kzak@redhat.com \
    --cc=martin.petersen@oracle.com \
    --cc=tom.ty89@gmail.com \
    --cc=util-linux@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