Commit graph

14 commits

Author SHA1 Message Date
Kelvin Zhang
823d695d3a Install new snapuserd_ramdisk stem
This installs snapuserd to /system/bin/snapuserd_ramdisk instead of
/system/bin/snapuserd

Test: th
Bug: 219841787
Change-Id: I517e251bf1f895b9de993ec7e5f57f11205172c8
2022-05-11 11:30:26 -07:00
Kelvin Zhang
8a7277df41 Remove snapuserd from vendor ramdisk
When BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT is set,
snapuserd.recovery will be installed to vendor ramdisk, which we don't
want. To remove snapuserd from vendor ramdisk, remove
snapuserd.recovery. And only include it if dedicated recovery partition
is enabled. For non-dedicated recovery case, boot partition contains
snapuserd.

Test: th
Test: acloud create --local-image --local-instance, install OTA, reboot
Change-Id: Ib8173f68a1f43b736fe609977a36ad4851e0c367
2022-03-24 10:43:37 -07:00
Kelvin Zhang
ecdfb79033 Split VABC into two .mk files
1. android_t_baseline.mk enables baseline features, such as io_uring,
   userspace merge, etc. But sets compression method to none. T
   launching devices should include this. It also moves snapuserd from
   vendor_ramdisk to init_boot
2. To add compression, set PRODUCT_VIRTUAL_AB_COMPRESSION_METHOD to
   gz/brotli

Test: th
Bug: 219841787

Change-Id: I6ae4d951b0a64f142acd4c152ce96375d47ecf74
2022-03-14 09:31:47 -07:00
Akilesh Kailash
6c171a69b2 Enable Async merge during OTA
If the async merge has a temporary failure, gracefully fallback
to synchronous I/O without failing the OTA merge.

Bug: 220991038
Test: 1: OTA on CF pre-submit runs
2: OTA on O6, R4 and Bramble with the following flow on TP builds:

BUILD-1 (without-this-patch) -> BUILD-2 (with this patch) -> BUILD-3 (with this patch)

Verified the failure path of async merge on all three devices

Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: I0b499d2cc81f44c74f85745f9165b81d0ce34eba
2022-02-28 06:29:50 +00:00
Akilesh Kailash
f1e7fb3af7 Revert "Enable io_uring feature for virtual A/B OTA"
This reverts commit f72860ce18.

Reason for revert: http://b/219642530 - I/O failures seen on one specific device intermittently. Let's pause this; I will revisit it before we land it back as we don't want to hold dogfood builds.

Change-Id: I3a80ccf5f67daed01d5b2e6a502e8acea85a769f
2022-02-16 04:21:01 +00:00
Akilesh Kailash
f72860ce18 Enable io_uring feature for virtual A/B OTA
snapuserd: Use io_uring READ/WRITE opcodes for snapshot merge.
Specifically, it is used only for readahead and ordered ops
code path.

    Snapshot merge perf:

    ===========================================================

    Incremental OTA of 300M between two git_master branches on Pixel 6:

    ===========================================================

    On Android S (with dm-snapshot): ~15 minutes:

    update_engine: [INFO:cleanup_previous_update_action.cc(330)] Merge finished with state MergeCompleted.
    update_engine: [INFO:cleanup_previous_update_action.cc(130)] Stopping/suspending/completing CleanupPreviousUpdateAction
    update_engine: [INFO:cleanup_previous_update_action.cc(501)] Reporting merge stats: MergeCompleted in 926508ms (resumed 0 times), using 0 bytes of COW image.

    ===========================================================

    On Android T (with io_uring: ~38 seconds):

    update_engine: [INFO:cleanup_previous_update_action.cc(330)] Merge finished with state MergeCompleted.
    update_engine: [INFO:cleanup_previous_update_action.cc(130)] Stopping/suspending/completing CleanupPreviousUpdateAction
    update_engine: [INFO:cleanup_previous_update_action.cc(501)] Reporting merge stats: MergeCompleted in 38868ms (resumed 0 times), using 0 bytes of COW image.

    ===========================================================

Bug: 202784286
Test: Full/Incremental OTA
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: Ia6efff32898cdc6b683ca49c233ef45e8cd732e7
2022-02-08 20:00:39 +00:00
Akilesh Kailash
bfdd246130 Enable userspace snapshots for OTA
Bug: 202784018

Test: Full/Incremental OTA tested on CF, Pixel

OTA Merge time performance on Pixel (bramble)

==========================================================

Incremental - OTA - 389M

OTA Operations:

system - Copy-ops: 34060 Zero-ops: 678 Replace-ops: 93846 Xor-ops: 75490

product - Copy-ops: 241742 Zero-ops: 1970 Replace-ops: 292890 Xor-ops: 80763

vendor - Copy-ops: 110285 Zero-ops: 660 Replace-ops: 62163 Xor-ops: 23474

system_ext_b - Copy-ops: 44509 Zero-ops: 426 Replace-ops: 39475 Xor-ops: 44628

====================================================================

1: VAB - Compression with dm-snapshot (on Android S)

Merge-time = 344 seconds (~5.7 minutes)

2: VAB - Compression with user-snapshot (on Android T)

Merge-time = 53 seconds

3: VAB - Without compression (using kernel COW format)

Merge-time = 33 seconds

Compared to Android S, merge time improves by 84% with user-snapshots on Android T.

The 20 seconds difference between (2) and (3) is because of two phase merge during compression which essentially serializes merge start time between partitions.

On (3), there is no two phase merge as all the partition starts merge at the same time.

When there is no two phase merge involved, (2) and (3) are nearly identical.

============================================================

Full OTA - 1.8G

1: VAB - Compression with dm-snapshot (on Android S)

Merge-time = 40 seconds

2: VAB - Compression with user-snapshot (on Android T)

Merge-time = 32 seconds

3: VAB - Without compression (using kernel COW format)

Merge-time = 32 seconds

===============================================================

Presubmit OTA testing enabled on Cuttlefish for ~1 Week with
the feature enabled.

https://v2-dot-atp.googleplex.com/tests/asit/ota/incremental_mixed_resume

Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: I88d15b94a48799996f38755063319269a3d70723
2021-12-07 20:38:29 +00:00
David Anderson
00addb0d28 Add f2fs.fsck to vendor_ramdisk.
Bug: 202462683
Test: f2fs.fsck is present in first_stage_ramdisk.
Change-Id: Ia4b76fc9ea25637d25e7171ee14278d2d80a2a33
2021-10-07 21:57:30 -07:00
Kelvin Zhang
bcda23488c Add a build prop for go/vabc-xor
Allow each lunch target to control if they want to use this new feature.

Test: th
Change-Id: I10219a916bca258e669de051262f9ebba8434803
2021-08-06 11:51:41 -04:00
Kelvin Zhang
239a79ae19 Emit virtual_ab_compression prop to dynamic_parttiion_info.txt
Test: mm -j && mm -j dist, make sure virtual_ab_compression is set to
true in dynamic_partition_info.txt of target_File.zip

Change-Id: Id0d46bd8ed738b2b69a0c01481b7db0c7127f773
2021-01-19 16:11:32 -05:00
David Anderson
da770507ab Include snapuserd in recovery for VABC builds.
Bug: N/A
Test: snapuserd available in recovery
Change-Id: Ide10a1da72becffad53f1daf2594d57813fc6636
2020-12-21 23:35:45 +00:00
Yifan Hong
914ef21c28 Add linker to VAB with vendor_ramdisk
Add linker.vendor_ramdisk for Virtual A/B devices with
a vendor_ramdisk because e2fsck is dynamic.

Test: pass
Bug: 173425293
Change-Id: I0a6f5bf15362e28eaa07a4d639ea23749b94b0f5
2020-12-02 19:51:16 -08:00
Yifan Hong
6b7cc73ec5 Add Virtual A/B with vendor ramdisk product.
If vendor_ramdisk exists, it is preferred to use launch_with_vendor_ramdisk.mk
because it moves e2fsck to vendor_ramdisk, making ramdisk smaller.

Devices that uses VABC is assumed to have a vendor ramdisk, so inherit
from this new makefile.

Test: pass
Change-Id: If6adad9985ca4750225fd4263edb42de1ddaf486
2020-11-23 15:17:01 -08:00
Yifan Hong
018c698280 Move virtual_ab makefiles to its own dir.
Also add a readme file.

Test: none

Change-Id: Ia1e02d8fb0c6df13271f208b3ca1dc1f250b085b
2020-11-23 15:17:01 -08:00