android_system_core/fs_mgr/liblp
David Anderson 2332afb31f 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
2018-07-09 18:50:28 -07:00
..
include/liblp liblp: Implement support for request queue alignment. 2018-07-09 18:50:28 -07:00
Android.bp liblp: Implement support for request queue alignment. 2018-07-09 18:50:28 -07:00
builder.cpp liblp: Implement support for request queue alignment. 2018-07-09 18:50:28 -07:00
builder_test.cpp liblp: Implement support for request queue alignment. 2018-07-09 18:50:28 -07:00
io_test.cpp liblp: Add unit tests for flashing and readback. 2018-06-21 12:58:34 -07:00
reader.cpp liblp: Implement support for request queue alignment. 2018-07-09 18:50:28 -07:00
utility.cpp liblp: Fix incorrect get_block_device_size usage. 2018-07-06 16:01:27 -07:00
utility.h liblp: Implement support for request queue alignment. 2018-07-09 18:50:28 -07:00
utility_test.cpp liblp: Implement support for request queue alignment. 2018-07-09 18:50:28 -07:00
writer.cpp liblp: Add unit tests for flashing and readback. 2018-06-21 12:58:34 -07:00