diff options
author | David Anderson <dvander@google.com> | 2018-07-09 12:12:52 -0700 |
---|---|---|
committer | David Anderson <dvander@google.com> | 2018-07-09 18:50:28 -0700 |
commit | 2332afb31fabd7b5fba7bfbc3f7073e02bbfb009 (patch) | |
tree | 4dd9a7fd7dd280ad1f30cbefe34370dfda1ed955 /libcutils/hashmap.cpp | |
parent | a04058ea481eca2968bbc62e6e392c3b90113157 (diff) |
liblp: Implement support for request queue alignment.
Block devices in the Linux kernel have a "minimum I/O request" size. The
minimum size is usually acquired by the block driver and can change
from device to device. When stacking devices (such as with
device-mapper), the kernel goes through great lengths to make sure this
alignment is respected for optimal I/O. In device-mapper's case,
misalignment can lead to kernel warnings and performance issues.
While this is unlikely to matter with a few targets, it could become
problematic on a large number of targets, and so we would prefer to
align all partition extents to the minimum I/O size.
We now support two new properties in the partition table geometry: an
"alignment", which is the minimum I/O size, and an "alignment offset",
which is an offset that when applied to sector 0, causes the sector to
be properly aligned within its parent device (for example, if a
physical partition is misaligned). All partition extents now begin on a
sector that respects this alignment.
One major caveat is that it is difficult for the initial partition table
to have the correct alignment without build system and/or flash tool
support. To accomodate this, all alignment is optional, and the lpmake
tool will support a default alignment of 1MiB as a failsafe.
Bug: 79173901
Test: liblp_test gtest
Change-Id: I5bc41b90aa085f4f30393951af0d2b37c4ac2a72
Diffstat (limited to 'libcutils/hashmap.cpp')
0 files changed, 0 insertions, 0 deletions