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
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html