From 9210c0c3770dac2fc6c511a0092d5fbd9c634a70 Mon Sep 17 00:00:00 2001 From: Akilesh Kailash Date: Mon, 2 Jan 2023 22:20:23 -0800 Subject: [PATCH] Enable Batch writes for OTA installation. By default set `ro.virtual_ab.compression.threads` it to false. Enabling this will improve OTA install time at the cost of one more CPU. Bug: 254188450 Test: OTA on Pixel Change-Id: Idf1fa950a5fc394f0d783d80c84045295185fb85 Signed-off-by: Akilesh Kailash --- .../virtual_ab_ota/android_t_baseline.mk | 32 +++---------- target/product/virtual_ab_ota/compression.mk | 6 +++ .../product/virtual_ab_ota/vabc_features.mk | 46 +++++++++++++++++++ 3 files changed, 59 insertions(+), 25 deletions(-) create mode 100644 target/product/virtual_ab_ota/vabc_features.mk diff --git a/target/product/virtual_ab_ota/android_t_baseline.mk b/target/product/virtual_ab_ota/android_t_baseline.mk index 716c8e0600..418aaa4c2d 100644 --- a/target/product/virtual_ab_ota/android_t_baseline.mk +++ b/target/product/virtual_ab_ota/android_t_baseline.mk @@ -12,29 +12,11 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +# -# This file enables baseline features, such as io_uring, -# userspace merge, etc. But sets compression method to none. -# This .mk file also removes snapuserd from vendor ramdisk, -# as T launching devices will have init_boot which has snapuserd -# in generic ramdisk. -# T launching devices should include this .mk file, and configure -# compression algorithm by setting -# PRODUCT_VIRTUAL_AB_COMPRESSION_METHOD to gz or brotli. Complete -# set of supported algorithms can be found in -# system/core/fs_mgr/libsnapshot/cow_writer.cpp - -PRODUCT_VIRTUAL_AB_OTA := true - -PRODUCT_VENDOR_PROPERTIES += ro.virtual_ab.enabled=true - -PRODUCT_VENDOR_PROPERTIES += ro.virtual_ab.compression.enabled=true -PRODUCT_VENDOR_PROPERTIES += ro.virtual_ab.userspace.snapshots.enabled=true -PRODUCT_VENDOR_PROPERTIES += ro.virtual_ab.io_uring.enabled=true -PRODUCT_VENDOR_PROPERTIES += ro.virtual_ab.compression.xor.enabled=true - -PRODUCT_VIRTUAL_AB_COMPRESSION := true -PRODUCT_VIRTUAL_AB_COMPRESSION_METHOD ?= none -PRODUCT_PACKAGES += \ - snapuserd \ - +# This file should be used only for T launching devices. We maintain +# this file just for backward compatibility for T launch devices +# so that build doesn't break. +# +# All U+ launching devices should instead use vabc_features.mk. +$(call inherit-product, $(SRC_TARGET_DIR)/product/virtual_ab_ota/vabc_features.mk) diff --git a/target/product/virtual_ab_ota/compression.mk b/target/product/virtual_ab_ota/compression.mk index d5bd2a5395..dc1ee3e028 100644 --- a/target/product/virtual_ab_ota/compression.mk +++ b/target/product/virtual_ab_ota/compression.mk @@ -19,6 +19,12 @@ $(call inherit-product, $(SRC_TARGET_DIR)/product/virtual_ab_ota/launch_with_ven PRODUCT_VENDOR_PROPERTIES += ro.virtual_ab.compression.enabled=true PRODUCT_VENDOR_PROPERTIES += ro.virtual_ab.userspace.snapshots.enabled=true PRODUCT_VENDOR_PROPERTIES += ro.virtual_ab.io_uring.enabled=true +PRODUCT_VENDOR_PROPERTIES += ro.virtual_ab.batch_writes=true + +# Enabling this property, will improve OTA install time +# but will use an additional CPU core +# PRODUCT_VENDOR_PROPERTIES += ro.virtual_ab.compression.threads=true + PRODUCT_VIRTUAL_AB_COMPRESSION := true PRODUCT_PACKAGES += \ snapuserd.vendor_ramdisk \ diff --git a/target/product/virtual_ab_ota/vabc_features.mk b/target/product/virtual_ab_ota/vabc_features.mk new file mode 100644 index 0000000000..874eb9cd83 --- /dev/null +++ b/target/product/virtual_ab_ota/vabc_features.mk @@ -0,0 +1,46 @@ +# +# Copyright (C) 2022 The Android Open-Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This file enables baseline features, such as io_uring, +# userspace merge, etc. But sets compression method to none. +# This .mk file also removes snapuserd from vendor ramdisk, +# as T launching devices will have init_boot which has snapuserd +# in generic ramdisk. +# +# T and U launching devices should include this .mk file, and configure +# compression algorithm by setting +# PRODUCT_VIRTUAL_AB_COMPRESSION_METHOD to lz4, gz or brotli. Complete +# set of supported algorithms can be found in +# system/core/fs_mgr/libsnapshot/cow_writer.cpp + +PRODUCT_VIRTUAL_AB_OTA := true + +PRODUCT_VENDOR_PROPERTIES += ro.virtual_ab.enabled=true + +PRODUCT_VENDOR_PROPERTIES += ro.virtual_ab.compression.enabled=true +PRODUCT_VENDOR_PROPERTIES += ro.virtual_ab.userspace.snapshots.enabled=true +PRODUCT_VENDOR_PROPERTIES += ro.virtual_ab.io_uring.enabled=true +PRODUCT_VENDOR_PROPERTIES += ro.virtual_ab.compression.xor.enabled=true +PRODUCT_VENDOR_PROPERTIES += ro.virtual_ab.batch_writes=true + +# Enabling this property, will improve OTA install time +# but will use an additional CPU core +# PRODUCT_VENDOR_PROPERTIES += ro.virtual_ab.compression.threads=true + +PRODUCT_VIRTUAL_AB_COMPRESSION := true +PRODUCT_VIRTUAL_AB_COMPRESSION_METHOD ?= none +PRODUCT_PACKAGES += \ + snapuserd \ +