59fa486703
This patch supports compression for bigger block size. 3 bits [57-59] in the COW Operation "source_info_" field is used to store the compression factor. Supported compression factors are power of 2 viz: 4k, 8k, 16k, 32k, 64k, 128k, 256k. Only REPLACE operations will have the bigger block size support for now. This can be extended to other operations later. The write path in EmitBlocks() has the core logic wherein consecutive sequence of REPLACE ops are compressed based on the compression factor settings. Thus, for a 64k compression factor, there will be just one COW operation which encodes all the 16 operation and the entire 64k block is compressed in one shot. NOTE: There is no read I/O path support in this patch. Subsequent patch will have the read support. Performance data (with read I/O path support in subsequent patch): go/variable-block-vabc-perf covers detail performance runs on Pixel 6 for full and incremental OTA. TL;DR: Performance of a full OTA (All numbers are compared against 4k block size) ======================================= Snapshot-size: ~10-11% decrease in snapshot-size (disk-space) for zstd with 256k block size. ~8% decrease in snapshot-size (disk-space) for lz4 Install time: ~13% decrease in OTA install time for zstd with 256k block size. Snapshot-merge: ~50% decrease in snapshot-merge time with 256k block size for zstd Post OTA boot-time: ~10.5 decrease in boot time for 64k block size for zstd In-memory footprint for COW operations: ~80% decrease in memory footprint for 256k block size. (58MB -> 9.2MB) ============================================ For more improvements, further tuning of zstd/lz4 is required primariy the compression levels, zstd compression window, performance of gz with compression levels. Bug: 319309466 Test: cow_api test covering all the supported block sizes for v3 writer. On Pixel 6: ======================================= COW Writer V3: for OTA in full, incremental OTA for block_size in 4k, 16k, 32k, 64k, 128k, 256k for compression_algo in lz4, zstd, gz, none install OTA, reboot, verify merge ======================================= COW Writer V2: for OTA in full, incremental OTA for block_size in 4k for compression_algo in lz4, zstd, gz, none install OTA, reboot, verity merge ===================================== Change-Id: I96201f1609582aa9d44d8085852e284b0c4a426d Signed-off-by: Akilesh Kailash <akailash@google.com> |
||
---|---|---|
.. | ||
android/snapshot | ||
include/libsnapshot | ||
include_test/libsnapshot | ||
libsnapshot_cow | ||
scripts | ||
snapuserd | ||
tools | ||
Android.bp | ||
device_info.cpp | ||
device_info.h | ||
dm_snapshot_internals.h | ||
OWNERS | ||
partition_cow_creator.cpp | ||
partition_cow_creator.h | ||
partition_cow_creator_test.cpp | ||
return.cpp | ||
snapshot.cpp | ||
snapshot_metadata_updater.cpp | ||
snapshot_metadata_updater.h | ||
snapshot_metadata_updater_test.cpp | ||
snapshot_stats.cpp | ||
snapshot_stub.cpp | ||
snapshot_test.cpp | ||
snapshotctl.cpp | ||
test_helpers.cpp | ||
utility.cpp | ||
utility.h | ||
vts_ota_config_test.cpp |