Commit graph

78045 commits

Author SHA1 Message Date
Elliott Hughes
594a67ce35 Merge "Add support for only starting 64 bit zygote." am: 1012626192
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2061509

Change-Id: I16d2104ef124cd3bee86923f36c80352117ff69f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-13 20:19:00 +00:00
Elliott Hughes
1012626192 Merge "Add support for only starting 64 bit zygote." 2022-07-13 19:57:47 +00:00
Treehugger Robot
e03286ac40 Merge "Add ctl.apex_(un)load properties to (un)load apex" am: e271146ec8
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2146970

Change-Id: I26a3865aaaae2ded31c84e701a0a6fe3592b65a1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-13 04:20:59 +00:00
Treehugger Robot
e271146ec8 Merge "Add ctl.apex_(un)load properties to (un)load apex" 2022-07-13 04:04:20 +00:00
Treehugger Robot
5591ee3531 Merge "Replace deprecated atoms.proto file path" am: b718a4372b
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2146967

Change-Id: Id2aeda77fcaa664f703e945a7b869eba33e8fb3d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-13 02:21:27 +00:00
Treehugger Robot
b718a4372b Merge "Replace deprecated atoms.proto file path" 2022-07-13 02:06:14 +00:00
Treehugger Robot
e591c7d174 Merge "Make 'mkbootfs' print a usage message for insufficent args." am: 4cc0cb2b62
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2152273

Change-Id: Iee4fc68cf029e2ee5bfae73ffab89715d2c88386
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-13 01:08:21 +00:00
Treehugger Robot
4cc0cb2b62 Merge "Make 'mkbootfs' print a usage message for insufficent args." 2022-07-13 00:49:33 +00:00
Mateus Azis
023f67b95e Make 'mkbootfs' print a usage message for insufficent args.
Right now, it just prints "no directories to process". There is also no
indication anywhere about the availability of the -f and -d flags.

Also took the opportunity to perform small quality-of-life improvements,
like updating error messages, hiding internal functions.

Test: (cd system/core/mkbootfs && mma) && ./out/host/linux-x86/bin/mkbootfs
Change-Id: Ia81eff0308e6e2686dde979d47c0bf938afbaf82
2022-07-12 16:00:07 -07:00
Treehugger Robot
11b2028a39 Merge "Add zhangkelvin@ as owner of fastboot" am: 0c1fdc1a09
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2151834

Change-Id: I8def0a41c146076a98509112f0297bf6fdfb1db3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-12 19:11:56 +00:00
Treehugger Robot
0c1fdc1a09 Merge "Add zhangkelvin@ as owner of fastboot" 2022-07-12 18:38:20 +00:00
Akilesh Kailash
57a6216c6b Merge "libsnapshot: Fix vts_libsnapshot_test.SnapshotUpdateTest#FullUpdateFlow" am: 58f66339ef
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2150260

Change-Id: Ia0755fc6686de7cfb0eb2bc3d52296789cb16f79
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-12 18:07:07 +00:00
Treehugger Robot
666b847b17 Merge "Convert fastboot/libsnapshot to new BootControl client" am: c29f0745d5
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2132796

Change-Id: I75dd91acaf0d051d4a114b2fcdc822d4ed66a453
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-12 18:06:57 +00:00
Kelvin Zhang
1fcdce21d6 Add zhangkelvin@ as owner of fastboot
Working on replacing aio w/ liburing in fastboot recently

Change-Id: I8076e2e53dc8d620faf9bff7f37ba2d2538460d6
2022-07-12 11:05:33 -07:00
Akilesh Kailash
58f66339ef Merge "libsnapshot: Fix vts_libsnapshot_test.SnapshotUpdateTest#FullUpdateFlow" 2022-07-12 17:53:09 +00:00
Treehugger Robot
c29f0745d5 Merge "Convert fastboot/libsnapshot to new BootControl client" 2022-07-12 17:47:20 +00:00
Sandeep Dhavale
906ebf775c Merge "Print OTA merge progress state in logs" am: f607e37fd0
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2150256

Change-Id: I80f0a829281b9dfc031dbd0f9440a4094109e2f5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-12 17:32:13 +00:00
Sandeep Dhavale
f607e37fd0 Merge "Print OTA merge progress state in logs" 2022-07-12 17:12:23 +00:00
Pete Bentley
4e245edf96 Merge "Move boringssl self tests from early-init to init." am: 00bf9dcb01
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2148027

Change-Id: Icc07f5446583b26b15b43092762f4f38ecfe09d0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-12 10:31:09 +00:00
Pete Bentley
00bf9dcb01 Merge "Move boringssl self tests from early-init to init." 2022-07-12 09:50:40 +00:00
Treehugger Robot
06bf4e25ee Merge "Do not enforce EROFS for android-T and below." am: eebd7f2b7d
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2146826

Change-Id: Icaa0f8645f329ffeb417785be48f8f93f6e1eb90
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-12 07:04:09 +00:00
Treehugger Robot
eebd7f2b7d Merge "Do not enforce EROFS for android-T and below." 2022-07-12 06:39:59 +00:00
jiajia tang
f083957850 Replace deprecated atoms.proto file path
Path of "frameworks/base/cmds/statsd/src/atoms.proto"
is out of date. Latest path is
"frameworks/proto_logging/stats/atoms.proto".

Signed-off-by: jiajia tang <tangjiajia@xiaomi.com>
Change-Id: Ib9471e812466238d79e836b026123f167aaad701
2022-07-12 06:01:44 +00:00
Akilesh Kailash
bfbd9b0e6e libsnapshot: Fix vts_libsnapshot_test.SnapshotUpdateTest#FullUpdateFlow
Check if compression feature is enabled.

Bug: 238143011
Test: OTA
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: I77663799a5371f1de8b4e29d7c777a24249d1b7b
2022-07-12 05:23:48 +00:00
Sandeep Dhavale
5bdb9dbb79 Print OTA merge progress state in logs
Currently OTA merge process prints enum values in logs in numerical
form. This patch changes the log messages from numerical enums to
more friendly names.

Test: Manual OTA

===========Logs==========
CheckTargetMergeState for vendor_dlkm_b returned: Merging
ProcessUpdateState handling state: Merging
CheckTargetMergeState for product_b returned: Merging
CheckTargetMergeState for vendor_dlkm_b returned: MergeCompleted
ProcessUpdateState handling state: Merging
CheckTargetMergeState for product_b returned: MergeCompleted
ProcessUpdateState handling state: MergeCompleted

Bug: 234518211
Change-Id: If690d3ea86e6fe37e8b3e4bd52e87b70ae92495c
2022-07-12 03:40:11 +00:00
Treehugger Robot
592de2a382 Merge "Don't kill subcontext if it's null" am: 932e069f0f
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2146830

Change-Id: Ib839545df89ff9b6c6b554d7429c2f6e602a32f3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-11 07:17:30 +00:00
Treehugger Robot
932e069f0f Merge "Don't kill subcontext if it's null" 2022-07-11 06:47:19 +00:00
Inseob Kim
5caaa5575e Don't kill subcontext if it's null
We don't initialize subcontext in microdroid. subcontext->pid() will
crash in such case.

Test: atest MicrodroidTests
Change-Id: Ifca65acededbf7f113d8bf16afbb8e2c1aa91b41
2022-07-11 14:34:15 +09:00
Kelvin Zhang
6befe78c3c Convert fastboot/libsnapshot to new BootControl client
Thew new client will use AIDL if available, and fallback to HIDL
otherwise.

Test: th
Bug: 227536004
Change-Id: I9af21037a76a4a6db00144f5b2774ea23f3a5cc2
2022-07-08 10:57:53 -07:00
P.Adarsh Reddy
a571d4a9bc Do not enforce EROFS for android-T and below.
EROFS is not mandatory for android T and below,
so skip the test for those.

Bug: 237765186
Test: vts_fs_test fs#ErofsSupported
Change-Id: Iceea46f8f2d443636de504962b718a2461605591
2022-07-08 12:14:01 +00:00
Pete Bentley
c017e2ce0a Move boringssl self tests from early-init to init.
In previous releases, these self tests had a secondary purpose
of writing a flag file to save future processes from running
some slow self checks.  This is no longer true in T.

However running the tests from early-init has caused issues
on some devices as the kernel's entropy pool is not yet
initialised, causing the process to block for a second or more.

Bug: 231946889
Test: m && flashall
Change-Id: I2116f2029ca6a21e4359407dfff4dc79edd39084
2022-07-07 15:34:46 +01:00
Jooyung Han
678f0b4828 Add ctl.apex_(un)load properties to (un)load apex
These props are supposed to be used by apexd when installing an apex
without reboot. During the installation, apexd will unmount the current
one and mount the new one. Since the path and its contents will be
replaced, anything loaded from the apex should be unloaded before
unmounting. After apexd mounts the apex again, then init should re-read
.rc files from the apex.

This change only addes required properties:
- ctl.apex_load <apex_name>
- ctl.apex_unload <apex_name>
- init.apex.<apex_name> = loaded | unloaded

Bug: 232114573
Bug: 232173613
Test: atest CtsInitTestCases
Change-Id: I4a8942d67912e2f11acc51bec756c4e3c218179a
2022-07-07 15:58:33 +09:00
Treehugger Robot
0cbf9cee6f Merge "Check userspace snapshots only for API level >= T" am: ff3fdf36ef
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2145879

Change-Id: I9c4ff47eebd400e9908438f47d90686a41c22bae
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-06 09:16:45 +00:00
Treehugger Robot
ff3fdf36ef Merge "Check userspace snapshots only for API level >= T" 2022-07-06 08:59:12 +00:00
Benergy Meenan Ravuri
7680c29bc9 Check userspace snapshots only for API level >= T
Skip checking for userspace snapshots enabled property
for API level < T as this feature is not applicable for
GRF targets.

Bug: 236450435
Test: vts_ota_config_test
Change-Id: Ib5083f6237cdf4962aae06f166811d67cf6c385e
2022-07-05 16:43:31 +05:30
Yi-yo Chiang
2d2f73d1f5 Merge "fs_mgr_fstab: Refactor & cleanup DSU mounting logic" am: 827389c9a4
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2135097

Change-Id: I528c314c02fffa062602bccacff56fa36d80bacb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-04 05:56:29 +00:00
Yi-yo Chiang
827389c9a4 Merge "fs_mgr_fstab: Refactor & cleanup DSU mounting logic" 2022-07-04 05:32:51 +00:00
Jason Chiu
55493c6de3 Merge "bootstat: add more bootreasons" am: 23ff619088
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2138772

Change-Id: I20a83032f86febcdd0f45a65d7c90f886721a355
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-03 14:30:56 +00:00
Jason Chiu
23ff619088 Merge "bootstat: add more bootreasons" 2022-07-03 14:07:17 +00:00
Jason Chiu
17251023bd bootstat: add more bootreasons
add more bootreasons for new projects

Bug: 219902794
Test: trigger apc watchdog then "adb root; adb shell bootstat -p"
Signed-off-by: Jason Chiu <jasoncschiu@google.com>
Change-Id: I7e19c4d48fb3d5b1c49dc8688936cf1d6eea6e9c
2022-07-03 14:07:09 +00:00
Akilesh Kailash
dcb486fbf6 Merge changes I6791dd72,I887d5073 am: 5c00853601
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2142512

Change-Id: Ia33302120a1b13bd78ed8e99d32f1f7b9fdc12cf
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-03 07:15:11 +00:00
Akilesh Kailash
5c00853601 Merge changes I6791dd72,I887d5073
* changes:
  Reduce priority of merge threads
  Tune snapshot-merge performance
2022-07-03 06:54:12 +00:00
Akilesh Kailash
1e46611c78 Reduce priority of merge threads
Currently, when daemon is spin up, it runs at the highest
priority with nice value set to -20. This can potetially
lead to a problem in a busy system especially after OTA
reboot when all the merge threads are running in parallel.

Now that we reduced the number of merge threads in-flight
to 2, we reduce the priority as well by setting the nice
value to -5. The other threads which serve I/O's
from dm-user (from root filesystem) still runs at higher
priority. We need this because post OTA reboot, these
threads serve I/O's until merge is completed.

Merge threads on the other hand can run at a relatively
lower priority. We need to make sure that there
is always forward progress even in a busy system
and hence set the priority to -5 as compared
to default value of 0.

No boot time regressions observed.

Output of NICE value of merge and worker threads post OTA reboot:

1 S     0   427   451     1 0  39 -20  64 2314640 dev_r+ ?      00:00:00 8
1 S     0   427   486     1 4  39 -20  64 2314640 dev_r+ ?      00:00:02 8
1 S     0   427   487     1 4  39 -20  64 2314640 dev_r+ ?      00:00:02 8
1 S     0   427   488     1 3  39 -20  64 2314640 dev_r+ ?      00:00:02 8
5 R     0   427   634     1 1  24  -5  64 2314640 0    ?        00:00:00 8
5 R     0   427   935     1 5  24  -5  64 2314640 0    ?        00:00:02 8

Bug: 237490659
Test: Full and incremental OTA
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: I6791dd72ccd8cd5bba6eff663bb3f9598bce7ed2
2022-07-01 19:11:24 +00:00
Akilesh Kailash
9df7c07e5a Tune snapshot-merge performance
Currently, there is one thread per partition
for snapshot merge. When all these threads are
run in parallel, this may stress the system
as the merge threads are both CPU and I/O bound.

Allow only two merge threads to be in-flight
at any point in time. This will ensure that there
is forward progress done with respect to snapshot-merge
and only two cores are used as against using
5-6 cores.

Additionally, system and prodcut partitions are merged
first. This is primarily because /root is mounted
of system partition and faster the merge completes
on /system partition, we can switch the dm tables
immediately. There is no change in the merge phase
from libsnapshot perspective. This prioritization
is based on each merge phase. If the system partition
merge is in second phase, then it takes priority
in that phase.

As a side benefit, this should also
reduce the memory usage when merge is in-flight
given that we now limit the threads.

There is slight delay in overall merge time as
we now throttle the merge.

No boot time regressions observed.

Full OTA:

Merge time (Without this patch): 42 seconds
Merge time (With this patch): 46 seconds

Incremental OTA:

Merge time (Without this patch): 52 seconds
Merge time (With this patch): 57 seconds

system partition merge completes in the first ~12-16 seconds.

App-launch (COLD) on Pixel:

Baseline (After snapshot-merge is completed when there is no daemon):
==========================

Chrome: 250
youtube: 631
camera: 230

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

Without this patch when snapshot-merge is in-progress (in ms):

Full - OTA

Chrome: 1729
youtube: 3126
camera: 1525

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

With this patch when snapshot-merge is in-progress (in ms):


Full - OTA

Chrome:  1061
youtube: 820
camera: 1378

Incremental - OTA (350M)

Chrome: 495
youtube: 1442
camera: 641
=====================

Bug: 237490659
Test: Full and incremental OTA
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: I887d5073dba88e9a8a85ac10c771e4ccee7c84ff
2022-07-01 19:05:09 +00:00
Peter Collingbourne
8b7637dc52 Merge "Fix scudo MTE tests." am: 73583331a0
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2143092

Change-Id: I2af8047b063d82500f11657ca0518a97ffd92608
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-01 17:30:05 +00:00
Peter Collingbourne
73583331a0 Merge "Fix scudo MTE tests." 2022-07-01 17:09:55 +00:00
Peter Collingbourne
7827991d7f Fix scudo MTE tests.
r.android.com/2108505 was intended to fix a crash in Scudo in
the case where the stack depot, region info or ring buffer were
unreadable. However, it also ended up introducing a number of bugs into
the code. It failed to call __scudo_get_error_info if the page at the
fault address was unreadable. This can happen in legitimate crash cases
if a primary allocation was close to the boundary of a mapped region,
or if the allocation was a secondary allocation with guard pages. It
also used long as the type for tags, whereas Scudo expects it to be
char. In combination this ended up causing most of the MTE tests to
fail. Therefore, mostly revert that change.

Fix the original crash by null checking the pointers returned by
AllocAndReadFully before proceeding with the rest of the function.

Bug: 233720136
Change-Id: I04d70d2abffaa35fe315d15d9224f9b412a9825d
2022-06-30 18:54:19 -07:00
Yi-Yo Chiang
f8671e0fc1 fs_mgr_fstab: Refactor & cleanup DSU mounting logic
* Instead of copy-and-modify `/data` mount entry, TransformFstabForDsu()
  can just modify all `/data` mount entries in-place.
* This also stops TransformFstabForDsu() from shuffling the mount entry
  of `/data` in fstab, simplifying the testcase.
* Implement GetEntriesForMountPoint() with GetEntriesByPred().
* Remove unused method BuildDsuUserdataFstabEntry() and
  EraseFstabEntry().

Bug: 235111004
Test: atest CtsFsMgrTestCases
Test: Presubmit GSI boot test
Change-Id: I4afb443b7e527038fb42424543bb1538b01d5ec9
2022-06-30 06:46:02 +00:00
Yi-yo Chiang
f0ccadbdc3 Merge "fs_mgr_fstab: Remove legacy DSU logic for Q first_stage_init" am: fad8eabad7
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2138552

Change-Id: I223c56d76aeeed297916951b1d44939ba7c3fb47
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-30 06:27:05 +00:00
Yi-yo Chiang
fad8eabad7 Merge "fs_mgr_fstab: Remove legacy DSU logic for Q first_stage_init" 2022-06-30 06:07:35 +00:00