From: ashford@whisperpc.com
To: linux-btrfs@vger.kernel.org
Subject: [Discussion] Apparent inconsistancies in use of io_align, io_width & sector_size
Date: Mon, 26 Jan 2009 12:06:21 -0800 (PST) [thread overview]
Message-ID: <38874.75.80.183.92.1233000381.squirrel@www.whisperpc.com> (raw)
In-Reply-To: <20090126162711.GA2083@elf.ucw.cz>
While digging through btrfs-progs, I noticed that there were several apparent
discrepancies in the use of io_align, io_width & sector_size (in structure
btrfs_dev_item). I believe we need the core developers to define the contents
of these values, so that the various programs and kernel modules can be
checked to be sure that the correct values are being used.
I have made some guesses as to the definitions of these values, and the kernel
code appears to support these guesses at first glance (not too sure about
io_align). My guesses are:
sector_size - This is the size, in bytes, of the atomic unit of allocation and
I/O within the file-system. It must be a power of two, must be at least as
large as a disk sector, and must be no larger than a kernel page.
io_width - This value is only meaningful in a RAID-0 or RAID-10 (also RAID-5
and RAID-6 in the future) volume, or when the underlying device is a RAID
array (other than RAID-1). This is the maximum number of bytes that can be
written to a device without switching to another device, and is equivalent
to "chunk size" in the MD driver. This must be a power of two, and an
integer multiple of sector_size.
io_align - This value is the offset, in bytes, of the start of the partition to
the start of the file-system. As an example, a value of 1536 would
indicate that the file-system starts 1536 bytes (3 disk blocks) into the
file-system. This must be an integer multiple of the disk sector size.
For optimum RAID performance, it should also be the offset of first RAID
segment from the beginning of the partition. I believe that the intended
usage of this value is to allow file-system allocations to align with RAID
segments provided by lower levels (Linux MD, HW RAID controllers or SAN
controllers).
Thank you.
Peter Ashford
next prev parent reply other threads:[~2009-01-26 20:06 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-13 14:21 Warning and BUG with btrfs and corrupted image Eric Sesterhenn
2009-01-13 14:40 ` Chris Mason
2009-01-13 14:43 ` Eric Sesterhenn
2009-01-15 2:13 ` Chris Mason
2009-01-18 17:40 ` Pavel Machek
2009-01-20 6:31 ` Eric Sesterhenn
2009-01-20 9:34 ` Pavel Machek
2009-01-20 10:11 ` Dave Chinner
2009-01-20 10:15 ` Eric Sesterhenn
2009-01-20 12:59 ` Dave Chinner
2009-01-20 13:28 ` Christoph Hellwig
2009-01-20 22:20 ` Pavel Machek
2009-01-21 4:00 ` Dave Chinner
2009-01-26 16:27 ` Pavel Machek
2009-01-26 20:06 ` ashford [this message]
2009-02-01 1:40 ` Dave Chinner
2009-02-04 18:29 ` Pavel Machek
2009-02-05 8:59 ` Dave Chinner
2009-02-05 9:02 ` Pavel Machek
2009-02-05 13:02 ` Chris Mason
2009-02-05 13:50 ` Pavel Machek
2009-02-05 14:19 ` jim owens
2009-02-25 19:54 ` Pavel Machek
2009-01-20 17:34 ` Eric Sesterhenn
2009-01-20 22:18 ` Pavel Machek
2009-01-21 9:36 ` Eric Sesterhenn
2009-01-20 13:11 ` Chris Mason
2009-01-20 16:51 ` Eric Sesterhenn
2009-01-22 2:15 ` Phillip Lougher
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=38874.75.80.183.92.1233000381.squirrel@www.whisperpc.com \
--to=ashford@whisperpc.com \
--cc=linux-btrfs@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