Commit graph

89062 commits

Author SHA1 Message Date
Akilesh Kailash
59fa486703 libsnapshot_cow: Support multi-block compression
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>
2024-01-31 12:52:31 -08:00
Akilesh Kailash
13cb6f7b4b Merge "libsnapshot: set header max_compression" into main 2024-01-31 20:42:58 +00:00
Daniel Zheng
bcce91603b libsnapshot: set header max_compression
Intermediate CL needed before variable block size can land. Since v3 is
enabled on cuttlefish, the base build needs to write the
compression_factor in order for reader to properly parse. Otherwise
we'll fail OTA test

Test: th
Change-Id: Ia353aae8e668858851073f09308909ae70d7854e
2024-01-31 17:35:00 +00:00
David Drysdale
6c2cb28318 Merge "Secretkeeper: require SECRETKEEPER_ENABLED=true" into main am: 700ff706f1
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2937199

Change-Id: I45d94c65b841765ad81ad34c1ac687441c2c25e6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-31 08:00:03 +00:00
David Drysdale
700ff706f1 Merge "Secretkeeper: require SECRETKEEPER_ENABLED=true" into main 2024-01-31 07:13:24 +00:00
Jiyong Park
ac6907b466 Merge "Drop CtsInitTestCases from cts" into main am: 0edd5b860a
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2935210

Change-Id: I3c5f869e67c32498c57e99ccdb1784b8036ccde9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-31 01:31:31 +00:00
Jiyong Park
0edd5b860a Merge "Drop CtsInitTestCases from cts" into main 2024-01-31 00:58:50 +00:00
Xin Li
4090c94e73 Merge "Merge Android 24Q1 Release (ab/11220357)" into aosp-main-future 2024-01-30 22:43:43 +00:00
Akilesh Kailash
c9d7942e5d Merge "libsnapshot: update type" into main am: 14258369ef
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2903390

Change-Id: Ibd57839d562924067c254e160825dcb664f022e5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-30 19:34:28 +00:00
Daniel Zheng
874d5006a2 Merge "libsnapshot: op_count_max default to max blocks" into main am: 5e4b3263ab
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2898987

Change-Id: I9811519fa263dd64efb9a548446a107db46e00af
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-30 19:33:53 +00:00
Daniel Zheng
2aad9fcba2 Merge "libsnapshot: use compression_factor in ota" into main am: 560c753ee8
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2901503

Change-Id: I6f2f7b9efe981dcdd9c1caa371859ba547b46fcc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-30 19:33:34 +00:00
Akilesh Kailash
14258369ef Merge "libsnapshot: update type" into main 2024-01-30 19:23:49 +00:00
Daniel Zheng
5e4b3263ab Merge "libsnapshot: op_count_max default to max blocks" into main 2024-01-30 18:49:14 +00:00
Daniel Zheng
560c753ee8 Merge "libsnapshot: use compression_factor in ota" into main 2024-01-30 18:48:58 +00:00
Daniel Zheng
6ca4d66a05 libsnapshot: update type
num_compress_threads should be unsigned integer as it can never be
negative.

Test: th
Change-Id: Ic0456ac717483300fa9cbd55eba5cdd0156207a7
2024-01-30 09:25:23 -08:00
Daniel Zheng
2aed5a5e4c libsnapshot: op_count_max default to max blocks
In the case that op_count_max is read in as zero, we should use the
upper bound of max blocks as the estimation. One case in which this
error can happen is if a v2 cow estimator is used, we should still be
able to run an OTA if we upper bound our ops buffer size estimation.

Test: th
Change-Id: I97ca66368d6631bf43c8911ed66f99c9e8096e2d
2024-01-30 09:25:15 -08:00
Daniel Zheng
2c82c81f12 libsnapshot: use compression_factor in ota
Parse manifest compression_factor and set CowOptions appropriately. This
allows v3 writer to use compression factor in OTA. Updating some
comments about supported compression algorithms

Test: th
Change-Id: I88f254087e536d9e5925064f85317f0acce280ee
2024-01-30 09:25:02 -08:00
David Drysdale
073133811e Secretkeeper: require SECRETKEEPER_ENABLED=true
Make the makefile safer by requiring a specific value for the
environment variable that turns on Secretkeeper

Bug: 306364873
Test: TreeHugger
Change-Id: Ic5bb5e7411a19941f58ec8c973104c1e53f3834f
2024-01-30 16:49:13 +00:00
Xin Li
7f41fd4852 Merge Android 24Q1 Release (ab/11220357)
Bug: 319669529
Merged-In: I856c812d22363cc1d1e8aa88706d4d3b89044f52
Change-Id: I9ef2aa7496bbf81f7f0da6b0ea46dc2157ad91f1
2024-01-29 21:19:57 -08:00
Jiyong Park
75070b37e2 Drop CtsInitTestCases from cts
The test is not eligible for CTS. Reasons:

1. The init behavior does not directly affect app compat. App interact
   with init only for the property service and that part is covered by
the Bionic test already.

2. This test doesn't run against the init binary installed on the
   device. libinit where most of the init functionalities are
implemented is statically linked to this test binary. In other words,
this test is closer to a unit test for init.

3. This test is not compatible with Trunk stable where test and DUT are
   built in different branches. The test depends on several (private)
libraries like libbase and libutils. Since the interfaces of the
libraries may have changed in the main branch, the test binary built
from the old test-dev branch may break.

This change does not remove the test. The test will still run as a unit
test during pre/post submit.

I didn't drop the `Cts` prefix from the name, because that requires
broader changes.

Bug: 320800872
Test: N/A
Change-Id: I1402c08b79b57ad6daa7948fe37f14fbbe36f1d6
2024-01-30 10:24:10 +09:00
Daniel Zheng
f47187745e Merge "libsnapshot: remove op count check" into main am: 81f49ed2e7
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2903467

Change-Id: I78afa5f5f8a039ed50dee9dbb527cc93bc4f3911
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-30 01:09:47 +00:00
Daniel Zheng
0043447ea4 Merge "libsnapshot: v3 structural changes" into main am: a4af286e98
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2933914

Change-Id: I8a362f52f3ae191074117afce8fb99aace62ea3b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-30 01:09:13 +00:00
Daniel Zheng
81f49ed2e7 Merge "libsnapshot: remove op count check" into main 2024-01-30 00:38:35 +00:00
Daniel Zheng
a4af286e98 Merge "libsnapshot: v3 structural changes" into main 2024-01-30 00:38:27 +00:00
Daniel Zheng
d84857fcfc libsnapshot: remove op count check
With variable block size compression being added, the number of ops
written cannot be calculated directly as easily since one op can cover
the data for multiple ops previously. We can get rid of this check for
XOR and Raw blocks as
within WriteOperation() we already make a check to see if we are
exceeding op_count_max limit.

We still need to keep this check for EmitZeroBlocks and EmitCopyBlocks
since the number of operations is determined ahead of time in those
function calls. Without this check in place, the ops will be added to
cached ops and return true when ops cannot be written.
with this change, v3 cow ota now works on cuttlefish with support for
variable block size compression.

Test: th
Change-Id: Ia55f152f5deb67a9022d0feff112345e72741dd3
2024-01-29 14:04:18 -08:00
Daniel Zheng
903f8e07ff libsnapshot: v3 structural changes
Changes to structure of v3 header + operation needed for variable block
size. Seperating this CL from the variable block size one so we can get
v3 enabled on cuttlefish

the op count type changes are so that op count matches the type of
max_blocks. Max_blocks is used when op buffer size is not set -> we
default to upper bound of one operation per block in the partition.

Test: th
Bug: 307452468
Change-Id: I1a2581763a4fd6be5d5795f7e4781023e9984256
2024-01-29 14:04:17 -08:00
T.J. Mercier
3d3b86548a Merge changes I6e95870e,Ibcef6b73,I302ce3c2 into main am: 96b0065ebf
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2928353

Change-Id: I67f0528a3075f1856fbb5fec5ba10fe65e245e76
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-29 21:56:15 +00:00
T.J. Mercier
96b0065ebf Merge changes I6e95870e,Ibcef6b73,I302ce3c2 into main
* changes:
  libprocessgroup: Use pid_t consistently for TIDs
  libprocessgroup: Use pid_t consistently for PIDs
  libprocessgroup: Use uid_t consistently for UIDs
2024-01-29 21:28:12 +00:00
David Drysdale
f99559a09b Merge "Secretkeeper HAL: support large messages" into main am: b077fcce13
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2921586

Change-Id: I3f852f0e71f4c81f838bb51fb0952adde2147961
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-29 15:04:11 +00:00
David Drysdale
b077fcce13 Merge "Secretkeeper HAL: support large messages" into main 2024-01-29 14:09:42 +00:00
Yi-Yo Chiang
bbb9690935 remount: Auto remount option (-R) also tries to gain root
When doing an auto remount & reboot command and is running as the SHELL
uid, just try to gain root on behalf of the user and retry the remount
command.
If "gain root" failed, then print the message to tell the user to run
"adb root" and retry.

Bug: 322285923
Test: adb unroot && adb remount -vR
Test: adb unroot && adb shell remount -vR
Change-Id: If8e04dc602573c73178c108ef4944f0a985b590e
2024-01-29 15:51:52 +08:00
Treehugger Robot
c4c84371e6 Merge changes from topic "b314861914" into main am: 761db93167
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2929790

Change-Id: I1c86687d1b2bb6fe03cef81c020a73e2019ccde1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-26 16:24:33 +00:00
Youngtae Cha
aaf85070ca Merge "A new folder to store OTA telephony config update" into main am: 6392be617b
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2908983

Change-Id: Ic636fa99c9326d81c89c8faa0eab72ee49292da7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-26 16:24:13 +00:00
Treehugger Robot
761db93167 Merge changes from topic "b314861914" into main
* changes:
  Revert "Migrate the blkio controller to the v2 cgroup hierarchy"
  Revert "task_profiles.json: Set io.prio.class"
2024-01-26 15:38:44 +00:00
Youngtae Cha
6392be617b Merge "A new folder to store OTA telephony config update" into main 2024-01-26 15:37:46 +00:00
David Drysdale
c4d82f3d84 Merge "Revert "rpc_binder: Change trusty_tipc_fuzzer to support multiple connections and messages"" into main am: 81190566f9
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2907204

Change-Id: I465fbbd890c5f401fdd4201f8c268df7505a017b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-26 10:46:27 +00:00
David Drysdale
81190566f9 Merge "Revert "rpc_binder: Change trusty_tipc_fuzzer to support multiple connections and messages"" into main 2024-01-26 10:15:47 +00:00
Ryan Prichard
ff168c1a6b Merge "trusty: clear fuzzer's extra counters directly" into main am: 49be29ed5b
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2898988

Change-Id: If307d5c8598dd050875dd0a51e8d3e6f6401a073
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-26 05:43:37 +00:00
Ryan Prichard
49be29ed5b Merge "trusty: clear fuzzer's extra counters directly" into main 2024-01-26 05:13:52 +00:00
Randall Huang
d0ce4ca33c Revert "Migrate the blkio controller to the v2 cgroup hierarchy"
This reverts commit f99ca8aeb1.

Reason for revert: b/2768906

Change-Id: I9ce259a2c96e9f8dd8c7598204c35922b56f7a0a
2024-01-26 03:54:47 +00:00
Randall Huang
9e38fe5299 Revert "task_profiles.json: Set io.prio.class"
This reverts commit 9bba87244d.

Reason for revert: b/314861914

Change-Id: I566c4fa98e4d1bd8701086c2b5e34802ee0a89fb
2024-01-26 03:51:54 +00:00
Automerger Merge Worker
55591140c2 Merge changes from topic "am-d8fea4fdc745480eafaff93d2422f2b9" into main am: ae983560a4 -s ours
am skip reason: Merged-In Ia77ace7513c48b1a14290c6ecc0222b46d6bf927 with SHA-1 7e5925ef02 is already in history

Original change: https://android-review.googlesource.com/c/platform/system/core/+/2913222

Change-Id: If019daaffca8d306980639276242eb441396a2d9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-25 22:05:06 +00:00
Automerger Merge Worker
e80a82245e [automerger skipped] Merge changes from topic "am-c58c55a0d19c465ab951e0f12c782b4f" into android14-tests-dev am: 0ecf04d632 -s ours am: d75c639278 -s ours
am skip reason: Merged-In Ia77ace7513c48b1a14290c6ecc0222b46d6bf927 with SHA-1 7e5925ef02 is already in history

Original change: https://android-review.googlesource.com/c/platform/system/core/+/2913222

Change-Id: I1ded9c4c6d8b16020431c799352f55ec0f560f9b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-25 22:05:03 +00:00
Automerger Merge Worker
ae983560a4 Merge changes from topic "am-d8fea4fdc745480eafaff93d2422f2b9" into main
* changes:
  Merge changes from topic "am-c58c55a0d19c465ab951e0f12c782b4f" into android14-tests-dev am: 0ecf04d632 -s ours
  [automerger skipped] Merge changes from topic "am-42c0dbea3ac34fc69f4fc2fd082669b3" into android13-tests-dev am: bc49a17b24 -s ours am: 30e3072d1f -s ours
2024-01-25 21:24:49 +00:00
Automerger Merge Worker
d75c639278 Merge changes from topic "am-c58c55a0d19c465ab951e0f12c782b4f" into android14-tests-dev am: 0ecf04d632 -s ours
am skip reason: Merged-In Ia77ace7513c48b1a14290c6ecc0222b46d6bf927 with SHA-1 7e5925ef02 is already in history

Original change: https://android-review.googlesource.com/c/platform/system/core/+/2913222

Change-Id: I63c2e10b890a989627f744614d76d970a6bdb968
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-25 21:24:45 +00:00
Automerger Merge Worker
b49cd0904e [automerger skipped] Merge changes from topic "am-42c0dbea3ac34fc69f4fc2fd082669b3" into android13-tests-dev am: bc49a17b24 -s ours am: 30e3072d1f -s ours
am skip reason: Merged-In Ia77ace7513c48b1a14290c6ecc0222b46d6bf927 with SHA-1 7e5925ef02 is already in history

Original change: https://android-review.googlesource.com/c/platform/system/core/+/2913222

Change-Id: If890bd3499d5049024b7c2e4ab2125ec71d43822
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-25 21:24:41 +00:00
Automerger Merge Worker
d4573b7c8f Merge changes from topic "am-5f49de7777604a57bc6361257c32394a" into main am: 3aa2cf0654 -s ours
am skip reason: Merged-In Ia77ace7513c48b1a14290c6ecc0222b46d6bf927 with SHA-1 d5ffbdfc56 is already in history

Original change: https://android-review.googlesource.com/c/platform/system/core/+/2911926

Change-Id: I4d5617aae7ced0ca27e4a2fcf3e2edfbbdab39b1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-25 20:38:29 +00:00
Automerger Merge Worker
c4b9107f05 [automerger skipped] Merge changes from topic "am-7d67da27f9ce4ecf871760ea2fa05b1c" into android14-tests-dev am: b9407709d9 -s ours am: 7fdeb917be -s ours
am skip reason: Merged-In Ia77ace7513c48b1a14290c6ecc0222b46d6bf927 with SHA-1 d5ffbdfc56 is already in history

Original change: https://android-review.googlesource.com/c/platform/system/core/+/2911926

Change-Id: I8b3c4bea0f60b7bbd44942179cf071a72cb41309
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-25 20:38:25 +00:00
Automerger Merge Worker
0ecf04d632 Merge changes from topic "am-c58c55a0d19c465ab951e0f12c782b4f" into android14-tests-dev
* changes:
  Merge changes from topic "am-42c0dbea3ac34fc69f4fc2fd082669b3" into android13-tests-dev am: bc49a17b24 -s ours
  [automerger skipped] Merge "Merge "sched_policy_test: set_sched_policy also set the cpuset policy as fallback" into android12-tests-dev am: ce34e32556" into android12L-tests-dev am: 421a3c69ad -s ours am: db8555c78e -s ours
2024-01-25 20:37:58 +00:00
Automerger Merge Worker
30e3072d1f Merge changes from topic "am-42c0dbea3ac34fc69f4fc2fd082669b3" into android13-tests-dev am: bc49a17b24 -s ours
am skip reason: Merged-In Ia77ace7513c48b1a14290c6ecc0222b46d6bf927 with SHA-1 7e5925ef02 is already in history

Original change: https://android-review.googlesource.com/c/platform/system/core/+/2913222

Change-Id: I9534b7bb318e94e937d81fffa9cb5f6b5e3e6e16
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-25 20:37:54 +00:00