Commit graph

86606 commits

Author SHA1 Message Date
Akilesh Kailash
a8f6ce3344 libsnapshot: Tune readahead during OTA for source and COW block device
Scanning of partitions post OTA leads to memory pressure. Tune
the read-ahead of source and COW block device. This is currently
set to 32KB.

This reduces Inactive(file) and Active(file) usage during entire
duration of boot post OTA.

On Pixel 6: For incremental OTA ~400M. During boot:

                            Without-patch         With-patch    Delta
			    --------------------------------------------
1: Peak Inactive(file):     4469MB                3118MB        ~30%

2: Peak Active(file):       985MB                 712MB         ~27%

No regression observed on boot time.

Additionally, cut down the number of threads to verify the partitions.

Bug: 311233916
Test: Incremental OTA on Pixel 6
Change-Id: I0b842776c36fa089c39c170fa7bf0f246e16636d
Signed-off-by: Akilesh Kailash <akailash@google.com>
2023-12-04 14:07:26 -08:00
Treehugger Robot
5e3a8ab891 Merge "Shove CowOperation type into source_info" into main am: 240f7084be
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2850213

Change-Id: I8971598d51ba524df2c9e41da0c26ae226d36b91
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-04 19:33:50 +00:00
Treehugger Robot
240f7084be Merge "Shove CowOperation type into source_info" into main 2023-12-04 18:50:46 +00:00
Kelvin Zhang
7d526560df Allow Cow version v3 to be used
This does not change the default cow version. Currently v2 is still the
default. This CL only enables OEMs to set virtual_ab_cow_version to 3
for testing purposes.

Test: th
Bug: 313962438
Change-Id: I7a328fa32283560a48604ffe02edd2551ac49a83
2023-12-04 09:29:20 -08:00
Kelvin Zhang
2bf1da5d2c Shove CowOperation type into source_info
We can shove type into source info to save 8 bits in per cow operation.
We only need 4 bits inside of source_info to enumerate all the types of
Cow Operation. Since CowOperationV3 is not used on disk(just yet) , we
can make format changes.

This CL is mechanical:
    1. Remove tye .type field from CowOperation struct
    2. Add a type() getter method to CowOperation struct
    3. Replace all existing usage of `type` member with the new getter

No functional changes, just refactorings.

Test: th
Bug: 304602386
Bug: 313962438

Change-Id: I85d89c71fc6afede12ea299a4a3e3b2184ea2d8b
2023-12-04 09:14:20 -08:00
Treehugger Robot
4fd99c9191 Merge "fs_mgr_overlayfs: MapScratchPartitionIfNeeded always tries to create scratch" into main am: 3ecba6b927
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2845636

Change-Id: Ieb56d0f6d300c81a5a3e048ffb8e7d35126182de
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-04 04:02:40 +00:00
Treehugger Robot
3ecba6b927 Merge "fs_mgr_overlayfs: MapScratchPartitionIfNeeded always tries to create scratch" into main 2023-12-04 02:53:30 +00:00
Elliott Hughes
d6d8ef71e0 Merge "fs_mgr: IWYU include <algorithm> for std::sort" into main am: 1784219094
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2839495

Change-Id: Ief79a69b39bb725a04f420dad1374255c9ea378a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-01 22:55:42 +00:00
Elliott Hughes
1784219094 Merge "fs_mgr: IWYU include <algorithm> for std::sort" into main 2023-12-01 22:22:34 +00:00
Lucas Henneman
3bcfa9c039 TEST_MAPPING: fix syntax of TODO tag
Bug: 279009697
Test: git diff
Change-Id: I7133bc0abe6634193b0fb006f5cd77ed2dc05844
Signed-off-by: Lucas Henneman <henneman@google.com>
2023-12-01 20:17:42 +00:00
Bart Van Assche
9820b1d9a3 Merge "task_profiles.json: Set io.prio.class" into main am: 1a97c485d0
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2768906

Change-Id: Id11851a9fac06d69ca2fb321ae1b7e353853e0f5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-01 19:18:23 +00:00
Bart Van Assche
1a97c485d0 Merge "task_profiles.json: Set io.prio.class" into main 2023-12-01 18:02:56 +00:00
Bart Van Assche
cfd44f56de Merge "service_test: Only run the ServiceStopTest as root" into main am: a34c125cad
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2854013

Change-Id: I64013f0097757b529dc809997abc13032f20163e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-01 03:58:21 +00:00
Treehugger Robot
f3170564c2 Merge "Allow to set scudo allocation buffer size" into main am: 56f7436a3e
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2822611

Change-Id: I5dc53010458ccf70c8ebf13e6e5d798e0e208bc8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-01 03:25:27 +00:00
Bart Van Assche
a34c125cad Merge "service_test: Only run the ServiceStopTest as root" into main 2023-12-01 03:08:02 +00:00
Treehugger Robot
56f7436a3e Merge "Allow to set scudo allocation buffer size" into main 2023-12-01 02:52:38 +00:00
Daniel Rosenberg
cab0371198 Merge changes I1ecdffcb,Ib0d1ea81 into main am: 4ae617f676
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2837188

Change-Id: Ic75a8c831a57f7c3c43fea75a5c7157c62a3d549
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-01 01:52:02 +00:00
Daniel Rosenberg
4ae617f676 Merge changes I1ecdffcb,Ib0d1ea81 into main
* changes:
  fs_mgr: Support 16k F2FS
  fs_mgr_overlayfs: Support 16k F2FS
2023-12-01 00:52:16 +00:00
Bart Van Assche
9bba87244d task_profiles.json: Set io.prio.class
Provide an additional way to request the block layer to prioritize
foreground I/O over background I/O. This patch prepares for tests with
the mq-deadline I/O scheduler. While CFQ and BFQ support a "weight"
cgroup attribute, the mq-deadline scheduler does not. The mq-deadline
I/O scheduler only supports the I/O priority class for differentiating
I/O priorities.

The io.prio.class attribute is declared optional since this attribute
only exists if CONFIG_BLK_CGROUP_IOPRIO != n in the kernel
configuration.

Bug: 186902601
Change-Id: Iee1004cd0996e32245aff2b51772ef40178e024f
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-11-30 10:00:44 -08:00
Bart Van Assche
fb3e64ab42 service_test: Only run the ServiceStopTest as root
Despite 'require_root: true' in Android.bp for CtsInitTestCases, it can
happen that this test is run without root privileges. If that happens,
skip the ServiceStopTest.

Bug: 313551148
Change-Id: I45f29369915a1f61e08ffd9bf5601a83a147597c
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-11-30 10:00:43 -08:00
Treehugger Robot
bc829d6f72 Merge "Remove marcone@google.com from trusty/OWNERS" into main am: 58beb4a624
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2853577

Change-Id: I6af24009b8ec1b50773168413c4e72d146468b11
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-30 17:54:42 +00:00
Treehugger Robot
58beb4a624 Merge "Remove marcone@google.com from trusty/OWNERS" into main 2023-11-30 17:08:20 +00:00
Owner Cleanup Bot
3d37da29e7 Remove marcone@google.com from trusty/OWNERS
This suggested change is automatically generated based on group
memberships and affiliations.
If this change is unnecessary or in error, vote CR -1 and the bot
will abandon it. Vote CR +1/2 to approve this change.

See the owner's recent activity for context:
https://android-review.googlesource.com/q/marcone@google.com

To report an issue, file a bug in the Infra>Codereview component.

Change-Id: Ia8f5d261cbfc7328c7dffa0bdf92a5732ba3eee8
2023-11-30 16:37:53 +00:00
Steven Moreland
1c20d89000 Merge "Looper: Fixed compile error when enabling DEBUG_CALLBACKS" into main am: e9c24760d3
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2844941

Change-Id: I0d78b05ffce3964a1364bec71ab8d504a0bcd72a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-30 03:16:05 +00:00
Steven Moreland
e9c24760d3 Merge "Looper: Fixed compile error when enabling DEBUG_CALLBACKS" into main 2023-11-30 02:06:43 +00:00
Akilesh Kailash
6726abe653 Merge "snapshotctl: fsync after writing every 1MB buffer" into main am: 37e7498fc0
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2852969

Change-Id: I84e43154d189594e8358fcf074ca4d473bfb62a9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-29 21:20:23 +00:00
Kelvin Zhang
3ce61c018f Merge "Turn CowOperationType into an enum" into main am: 54702a79f9
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2850866

Change-Id: If872b67d8a01d3941989cad30529e5af87e98c96
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-29 21:19:42 +00:00
Akilesh Kailash
37e7498fc0 Merge "snapshotctl: fsync after writing every 1MB buffer" into main 2023-11-29 20:37:55 +00:00
Kelvin Zhang
54702a79f9 Merge "Turn CowOperationType into an enum" into main 2023-11-29 20:26:05 +00:00
Akilesh Kailash
b78d0e2856 snapshotctl: fsync after writing every 1MB buffer
Sync writes after every 1MB instead of flushing at the end.

Bug: 299011882
Test: Boot device off snapshots
Change-Id: If91168ec92c2b2995bdf296ea1c7d4c261b12411
Signed-off-by: Akilesh Kailash <akailash@google.com>
2023-11-29 11:26:46 -08:00
Kelvin Zhang
1ccb347e87 Turn CowOperationType into an enum
There's a bug previsouly where we compare return value of
GetCowOpSourceInfoData() with CowOperationType. Such bugs are possible
because cow operation enums are weakly typed integers. Turn
CowOperationType into strongly typed enum to prevent such bugs.

Test: th
Bug: 304602386
Change-Id: If6941a4740c374ed066cf0aee9e52f4df05a9b38
2023-11-29 10:46:10 -08:00
Kai Sky
862f049d17 Looper: Fixed compile error when enabling DEBUG_CALLBACKS
When enabling DEBUG_CALLBACKS , compiler complains
for the undeclared identifier 'fd'.
Fix by removing undeclared objects.

Change-Id: I751a9ef9d8843350105acd6a30645f897050ffa4
2023-11-29 05:41:01 +00:00
Treehugger Robot
d891ecae9c Merge "service_test: Test stopping services after migration to another cgroup" into main am: 0ca4e8f4b4
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2832973

Change-Id: I523d9b42bcb02ef05fb4d1e184bb47ed17d37b28
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-28 00:40:54 +00:00
Treehugger Robot
f6e3aa5bce Merge "libprocessgroup: Stop services that have been migrated to another v2 cgroup" into main am: 57359b731e
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2832972

Change-Id: I918dec6c8d796b52ada3b395e2b290f5265e448f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-28 00:40:21 +00:00
Treehugger Robot
0ca4e8f4b4 Merge "service_test: Test stopping services after migration to another cgroup" into main 2023-11-28 00:14:31 +00:00
Treehugger Robot
57359b731e Merge "libprocessgroup: Stop services that have been migrated to another v2 cgroup" into main 2023-11-27 23:23:12 +00:00
Bart Van Assche
86a2ae28e6 service_test: Test stopping services after migration to another cgroup
The root cause of "After OTA, device is not responding" is that
Service::Stop() did not stop services that had been migrated to another
v2 cgroup. Add a unit test for that scenario.

Bug: 308900853
Change-Id: I590fde90e31326290c2c8ce8fce51e94b215a979
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-11-27 14:27:02 -08:00
Bart Van Assche
a43b96c157 libprocessgroup: Stop services that have been migrated to another v2 cgroup
CL 2828279 doesn't do what it's description says that it does. Making
Service::Stop() work for processes that have been migrated to another v2
cgroup requires changing DoKillProcessGroupOnce(). Hence this CL that
removes the early return statements from DoKillProcessGroupOnce().

Bug: 308900853
Change-Id: Ib798555feeb95a786a619c3d7013c7d5829b01ad
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-11-27 14:13:46 -08:00
Christopher Fore
fad8b7a130 fs_mgr: IWYU include <algorithm> for std::sort
GCC 14 starts to no longer include <algorithm> by default, resulting in
it needing to be explicitly declared.

Test: Recompiled with GCC 14 and succeeded

Change-Id: Ifc5dd58b7476ba728ae604cd2924cb68fbcab701
Signed-off-by: Christopher Fore <csfore@posteo.net>
2023-11-27 14:55:19 -05:00
Yi-Yo Chiang
eeb8077577 Merge "fs_mgr_overlayfs: De-dup common methods" into main am: 455fb82bf9
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2845635

Change-Id: Ic18d0ea983562dcab61ade26545f1b39a5826329
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-27 12:04:11 +00:00
Yi-Yo Chiang
6c86cb59d7 Merge "second-stage-init: Don't move submounts when mounting overlayfs" into main am: 475599f5c5
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2845633

Change-Id: Ie753a5886813b724544946569533f3a8ff6683c7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-27 12:03:37 +00:00
Yi-Yo Chiang
3a22c9e16e fs_mgr_overlayfs: MapScratchPartitionIfNeeded always tries to create scratch
Simplify the logic of MapScratchPartitionIfNeeded to just map the
scratch partition unconditionally. If there is a "scratch" logical
partition available, we just assume it must be needed later to
facilitate overlayfs.

Going through the fstab & fs_mgr_overlayfs_candidate_list to determine
if overlayfs is needed or not might be inaccurate as the fstab passed into
MapScratchPartitionIfNeeded is incomplete (it includes only the
"first_stage_mount" entries). So the scratch device might not get created
even though there are some "late mount" partitions that need the scratch
device to facilitate overlayfs.

Bug: 306124139
Test: adb-remount-test
Change-Id: I8590750e822219dec3d7d3c8648e9c9a5a32f68c
2023-11-27 11:17:12 +00:00
Yi-Yo Chiang
455fb82bf9 Merge "fs_mgr_overlayfs: De-dup common methods" into main 2023-11-27 11:16:51 +00:00
Yi-Yo Chiang
16239ad862 fs_mgr_overlayfs: De-dup common methods
Keep only one copy of GetBootScratchDevice().

Bug: 306124139
Test: build
Change-Id: I11603566ab454eb028b50873d66f4ab967b204f9
2023-11-27 11:16:41 +00:00
Yi-Yo Chiang
475599f5c5 Merge "second-stage-init: Don't move submounts when mounting overlayfs" into main 2023-11-27 11:16:24 +00:00
Yi-Yo Chiang
28113cf3f6 second-stage-init: Don't move submounts when mounting overlayfs
Right now there is a bug in second-stage-init that screws up the
overlayfs overrides. This happens because:
1. second-stage-init mount_all might be executed in the "bootstrap"
   mount namespace.
2. In order to move (MS_MOVE) submounts in fs_mgr_overlayfs_mount_all(),
   we change the mount propagation type of overridden filesystems to
   MS_PRIVATE.
3. This means that the "default" mount namespace would not receive the
   mount events of the overlayfs overrides.
4. After /data is mounted, init would switch to the "default" namespace.
   This means any new processes spawned after this period would not be
   able to see the overlayfs overrides.

We fix this by changing the mount order of second-stage-init mount_all
to mount the overlayfs override of a partition immediately after the
partition is mounted. This way we don't need to move any submounts as
there can't be any, thus we don't need to set any mountpoint to
MS_PRIVATE so the mount event of the overlayfs would be propagated to
the "default" mount namespace, too.

Bug: 309407859
Bug: 306124139
Test: adb-remount-test
Test: verify that overlayfs tookover successfully from second-stage-init
Change-Id: If2ff4852516292ccbc7abdeebe0e9a7c1c7ba606
2023-11-27 17:16:40 +08:00
Treehugger Robot
73469a1299 Merge "Add exfat fs in fs_mgr" into main am: bc907c00f4
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2842875

Change-Id: I82b3097984f056e219d3546d8ecf85f33912ece4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-24 11:58:36 +00:00
Treehugger Robot
bc907c00f4 Merge "Add exfat fs in fs_mgr" into main 2023-11-24 10:55:29 +00:00
yanxu
3f9f595067 Add exfat fs in fs_mgr
Need to support exfat fs type point mount in recovery mode

Bug:312674538
Test: SIU (Apply update from SD card) in recovery mode

Change-Id: I2735e5068c47b183a25d2305bca89f08de1e32c7
2023-11-24 10:26:59 +00:00
Treehugger Robot
7aa325791f Merge "init: Fix signalfd support in WaitToBeReaped()" into main am: dfe6c802d0
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2834997

Change-Id: I312a9aed346703b92fbb5f3e520ae88f7b46d770
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-22 18:27:29 +00:00