Commit graph

69570 commits

Author SHA1 Message Date
Treehugger Robot
ae451e61c8 Merge "toolbox/generate-input.h-labels.py: python3." 2021-08-17 23:12:47 +00:00
Elliott Hughes
278bfa06e9 toolbox/generate-input.h-labels.py: python3.
Test: treehugger
Change-Id: Ia63fd0db0b678de05ab2a83411f7a04d81e401e9
2021-08-17 14:34:55 -07:00
Treehugger Robot
6809b6705f Merge "Handle long responses by keymint IPC." 2021-08-17 19:26:16 +00:00
Suren Baghdasaryan
228fbadc6e Merge changes from topic "extra_free_kbytes.sh"
* changes:
  Use extra_free_kbytes.sh whenever sys.sysctl.extra_free_kbytes changes
  init: Add extra_free_kbytes.sh script to adjust watermark_scale_factor
2021-08-17 19:17:59 +00:00
Colin Cross
fb66f3d13f Merge "Include sys/select.h for fd_set" 2021-08-17 18:56:16 +00:00
Suren Baghdasaryan
92cb2e8583 Use extra_free_kbytes.sh whenever sys.sysctl.extra_free_kbytes changes
sys.sysctl.extra_free_kbytes property controls the value set to the
/proc/sys/vm/extra_free_kbytes out-of-tree kernel knob. Replace its
use with execution of extra_free_kbytes.sh script which calculates
and sets corresponding value to /proc/sys/vm/watermark_scale_factor
upstream-supported kernel knob.

Bug: 109664768
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: Iaece28eb858a20c8c39578a28dc6bbc6adc13c40
2021-08-17 17:02:25 +00:00
Suren Baghdasaryan
642048d969 init: Add extra_free_kbytes.sh script to adjust watermark_scale_factor
Android uses an out-of-tree /proc/sys/vm/extra_free_kbytes kernel knob
to increase low watermark. A similar /proc/sys/vm/watermark_scale_factor
knob supported in upstream kernel can be used for the same purpose.
The script implements conversion from desired extra_free_kbytes value
to watermark_scale_factor value and sets watermark_scale_factor according
to the value for extra_free_kbytes provided as a parameter.
Note that watermark_scale_factor affects high watermark differently
from extra_free_kbytes. While extra_free_kbytes increases low and high
watermarks by the same amount, watermark_scale_factor affects high
watermark 2x times. Therefore it is expected that replacing the usage
extra_free_kbytes with watermark_scale_factor will keep the same low
watermark but high watermark will be higher than before.

Usage:
    extra_free_kbytes.sh <extra_free_kbytes value>

Bug: 109664768
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: Id8949be731da77be884cdeec3a765ea291dbc2f0
2021-08-17 17:02:18 +00:00
Yi-Yo Chiang
b33cfbfc4b Merge "fastboot/README.md: Update response packet max size to 256" 2021-08-17 14:15:36 +00:00
David Anderson
9784f5ae1c Merge "Support multiple fstab configs for one mount point" 2021-08-17 01:39:59 +00:00
Colin Cross
cbca269d75 Include sys/select.h for fd_set
socket.cpp fails to compile on musl with a missing definition of
fd_set.  Include sys/select.h for the definition.

Bug: 190084016
Test: m USE_HOST_MUSL=true fastboot
Change-Id: I095a56381a85981f42444f4c39ae8e7786d8640f
2021-08-16 17:20:19 -07:00
Treehugger Robot
55101e53fe Merge "Add mock interface for EmitXorBlocks" 2021-08-16 18:31:19 +00:00
Hongguang Chen
f156552ef1 Merge "Add Quiescent Reboot Target" 2021-08-16 18:12:17 +00:00
Yi-Yo Chiang
a7656fa3b6 fastboot/README.md: Update response packet max size to 256
This change is to update the doc to reflect the current state and it
doesn't affect the runtime behavior.
The max packet size was updated to 256 by aosp/1226715.

Bug: 196676392
Test: Presubmit; doc update doesn't affect build
Change-Id: I73b0a416730d09fdb24ea81bffe52ddd89534132
2021-08-14 22:12:34 +08:00
Bart Van Assche
dba7e067dd Merge changes Ifa16084c,I3e3560f3,I63637811
* changes:
  Reduce the queue depth of loop devices used by the zram driver
  libdm: Export ExtractBlockDeviceName()
  libdm: Make ExtractBlockDeviceName() return its result
2021-08-13 17:43:17 +00:00
Huang Jianan
1bfa48af3c Support multiple fstab configs for one mount point
This allows us to mount with such fstab:
/dev/block/by-name/system /system ext4  ro slotselect
/dev/block/by-name/system /system erofs ro slotselect
This will be used when mount partition through ensure_path_mounted
in recovery.

Bug: 195726623
Test: mount with different image on the same fstab
Change-Id: I7761489a3e2bf46331563e872b6dfaa8b685a082
Signed-off-by: Huang Jianan <huangjianan@oppo.com>
2021-08-13 16:08:54 +08:00
Bart Van Assche
0223cd89f7 Reduce the queue depth of loop devices used by the zram driver
Make the queue depth of loop devices identical to that of the underlying
storage device. This patch reduces latency by lowering the queue depth.
With this patch applied I see the following:

 # cat /sys/block/loop30/queue/nr_requests
32

Bug: 194450129
Test: Built Android images, installed these and verified that the queue depth of loop devices is 32 instead of 256.
Change-Id: Ifa16084c7df3a54d9559c2388abc4a8392ff88c6
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2021-08-12 15:42:51 -07:00
Bart Van Assche
c24f7b8224 libdm: Export ExtractBlockDeviceName()
Make this function available to libdm users. A caller outside libdm will
be added by a later patch.

Bug: 194450129
Test: mm libfs_mgr libdm_test
Change-Id: I3e3560f3cdef8978eac644d5b53cf3851209c0c2
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2021-08-12 15:11:48 -07:00
Bart Van Assche
6b296db8e3 libdm: Make ExtractBlockDeviceName() return its result
From https://engdoc.corp.google.com/eng/doc/devguide/cpp/styleguide.md:
"Prefer using return values over output parameters: they improve
readability, and often provide the same or better performance (see the C++
Primer)." Implement this advice for ExtractBlockDeviceName(). This patch
does not change any functionality.

Bug: 194450129
Test: mm libfs_mgr libdm_test
Change-Id: I6363781163eba08e6128507b403200f472f68a59
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2021-08-12 15:11:39 -07:00
Janis Danisevskis
5b4b52126e Handle long responses by keymint IPC.
The KeyMint TA may send responses that are longer thant the 8K buffer
that the KeyMint HAL holds. This patch introduces
trusty_keymaster_call_2 which can grow the receive buffer on demand.

Bug: 195622501
Test: VTS and CTS test for regression testing.
Change-Id: Ia06e590e547e649ca81cda9a71851f334970788f
Merged-In: Ia06e590e547e649ca81cda9a71851f334970788f
2021-08-12 19:21:11 +00:00
Yabin Cui
c5c532fc31 Merge "debuggerd: add -fno-finite-loop to fix test." 2021-08-11 23:24:11 +00:00
Yabin Cui
e90a944c8a debuggerd: add -fno-finite-loop to fix test.
After compiler update, infinite side effect free loops are replaced with trap
instructions. So use -fno-finite-loop to disable this behavior.

Bug: 196162833
Test: run debuggerd_test.
Change-Id: I057263360a5df64af18c17a025fab48887d0b470
2021-08-11 13:21:11 -07:00
Christopher Ferris
4a9a79e3ff Merge "Remove jmgao from OWNERS files." 2021-08-11 17:28:27 +00:00
Yi-Yo Chiang
a50ffe6c7b Merge "Increase the minimal remount scratch size to 64MiB for F2FS scratch" 2021-08-11 07:42:51 +00:00
Christopher Ferris
0ef9b4d365 Remove jmgao from OWNERS files.
Josh no longer works on Android, so remove him from OWNERS files.

Test: NA
Change-Id: I676cd803b5e3167db1b5175a630d85d1edfcaaaf
2021-08-10 21:42:14 -07:00
Treehugger Robot
d82efe0bf0 Merge "fastboot: fix --disable-verifiation error message" 2021-08-11 04:09:46 +00:00
David Anderson
489f09abd4 Merge "fastbootd: Delete all VAB partitions during "flashall"." 2021-08-10 18:09:39 +00:00
Bowgo Tsai
671249a3d2 fastboot: fix --disable-verifiation error message
There is an unclear error message if we run
`fastboot --disable-verification flash boot boot.img` on a
AVB-disabled device without a /vbmeta partition.

Error message:
  terminating with uncaught exception of type std::out_of_range: basic_string
  Aborted

This is because the buf->fd of the loaded boot.img is not reset,
before returning from function copy_boot_avb_footer().

Also reset some changes in copy_boot_avb_footer() from commit
If83f785e235569ee8ef0de2b37f11dbd2a9a71f4, to prevent the
unnecessary read of the boot vbmeta if no need to copy the
boot image avb footer.

Bug: 191903922
Test: `fastboot --disable-verification flash boot boot.img` on a device
      without /vbmeta and without setting BOARD_AVB_ENABLE to true.
Change-Id: If84f08f1b2e12c4c6ded5cafda2bd1d30e75c662
2021-08-10 17:05:17 +08:00
David Anderson
1f670ef7a8 fastbootd: Delete all VAB partitions during "flashall".
With VAB we encourage a smaller super partition, so make sure we delete
"other" slot partitions during flashing. Otherwise, we may not have
enough space in super.

Bug: 195930130
Test: set_active, flashall, ensure other slot is deleted
Change-Id: Ic6a4f60e8f4c7abb8af7b38228753ad8ed85eedf
2021-08-09 12:36:13 -07:00
Yi-Yo Chiang
e6c21b9be1 Increase the minimal remount scratch size to 64MiB for F2FS scratch
F2FS requires a larger minimal size than the current value of 16MiB.

Bug: 171368484
Fixes: 171368484
Test: Presubmit
Change-Id: I085d91634ada673388b07a0f5c6b1847e261b7f8
2021-08-09 07:39:24 +00:00
Alexander Potapenko
6e3f64e7d8 Merge "Restrict creation of bootreceiver tracing instance to 64-bit systems." 2021-08-06 13:29:42 +00:00
Shikha Malhotra
f870b88e1b Merge "Move flattened APEX activation logic to apexd." 2021-08-06 08:15:23 +00:00
Tri Vo
2b52180603 Merge "trusty: storage: Allow starting without /data mounted" 2021-08-06 05:29:45 +00:00
Shikha Malhotra
720694dcca Move flattened APEX activation logic to apexd.
Also the check that linker configuration should not be updated if APEX
is in updatable state, is removed as now with refactoring of code and its
movement to apex project, that is also needed.

Resolves: https://b.corp.google.com/issues/192838499
Test: Run the AVD Device and check that it boots and run atest
ApexTestCases

Change-Id: I80a94fa0a4145d30546bb34a6d478a20a2881368
2021-08-05 19:57:21 +00:00
Alexander Potapenko
ec37ba8359 Restrict creation of bootreceiver tracing instance to 64-bit systems.
The main users of this instance are KFENCE and MTE-aided KASAN, which are only supported on arm64.
Skip creation of this tracing instance on 32-bit systems to save ~6Mb memory on low-end devices.

Bug: 195089948
Bug: 194719088
Bug: 194156700
Change-Id: Icaf762715fed7a282b1ad738c10bcb45dc848f4d
2021-08-05 18:46:43 +00:00
Bart Van Assche
155684c2bf Merge changes from topic "zram_loop"
* changes:
  Set the I/O scheduler of loop devices to 'none'
  Rename two local variables
2021-08-05 16:57:53 +00:00
Akilesh Kailash
e19f7be126 Merge "snapuserd: Read partition blocks to memory" 2021-08-05 03:02:07 +00:00
Bart Van Assche
ec5f635270 Set the I/O scheduler of loop devices to 'none'
The user interface of Android devices becomes very slow under memory
pressure. This is because Android uses the zram driver on top of the loop
driver for swapping, because under memory pressure the swap code alternates
reads and writes quickly, because mq-deadline is the default scheduler for
loop devices and because mq-deadline delays writes by five seconds for such
a workload with default settings. Fix this by selecting I/O scheduler 'none'
for loop devices.

Bug: 194450129
Test: Built Android images, installed these and verified that the I/O scheduler of all loop devices is 'none' instead of 'mq-deadline'.
Change-Id: Ia5f606504b663948ab56955cad5a71885a356430
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
2021-08-04 08:57:32 -07:00
Bart Van Assche
06b95de973 Rename two local variables
Improve code readability by renaming 'device' into 'loop_device' and
'device_fd' into 'loop_fd'.

Bug: 194894000
Test: Built Android images and installed these on an Android device.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Change-Id: Ia9c2d7a525e727f8706e66631b97fc4678c6a4d9
2021-08-04 08:57:27 -07:00
Kelvin Zhang
c006617c78 Add mock interface for EmitXorBlocks
Test: th
Change-Id: I8b9ccd5a0c16c45f79849c778b3d17cb1a635749
2021-08-04 11:44:23 -04:00
Akilesh Kailash
a11a338e2b snapuserd: Read partition blocks to memory
When the device is rebooted after OTA is done,
daemon will read through all the dynamic partitions
to bring the blocks to memory. When update-verifier
runs, all the blocks would be in page-cache thereby
cutting down the boot time.

Boot time improvements on Pixel:

Full OTA:
===========

VABC (Without this patch): 37.308 seconds
VABC (With this patch): 28.604 seconds

Incremental OTA:
=================

VABC (Without this patch): 39.072 seconds
VABC (With this patch): 27.523 seconds

We read the blocks only during second stage transition. Thus,
it shouldn't impact when snapuserd is spin up during
post-install phase or during first-stage init.

Bug: 193863442
Test: Full and Incremental OTA on pixel
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: Id654449238e22125f7d6288c7100fde512cc2ced
2021-08-04 08:38:10 +00:00
David Anderson
381c0fc07c Merge "Add a helper script for dumping snapshot protos." 2021-08-04 06:03:04 +00:00
David Anderson
6a2963e05a Merge "libsnapshot: Use std::unordered_set in DmSnapCowSizeCalculator." 2021-08-03 16:47:11 +00:00
Joel Galenson
0dd5dfed4a Merge "Migrate Rust libcutils bindings into librustutils." 2021-08-03 14:20:06 +00:00
Jiyong Park
5384f93751 Merge "Remove ndk_platform backend. Use the ndk backend." 2021-08-03 11:18:25 +00:00
Yi-Yo Chiang
215fde0fde Merge "fs_mgr: Add fs_mgr_flag overlayfs_remove_missing_lowerdir" 2021-08-03 08:46:57 +00:00
Daniel Rosenberg
c90b727301 Merge changes from topic "CowXorOp"
* changes:
  libsnapshot: Don't PrepMergeOps on resume
  snapuserd: Add support for Xor ops in snapuserd
  snapuserd: Rename Read Ahead Iterator
  snapuserd: Add XorSink
  libsnapshot: Clone worker readers from snapuserd
  libsnapshot: Add support for Xor ops in Cow Format
2021-08-03 03:15:49 +00:00
Tri Vo
91e475068d trusty: storage: Allow starting without /data mounted
Bug: 187105270
Test: m
Change-Id: I3735e0752a6e502536000bd3102abda30cbd58fe
2021-08-02 15:02:11 -07:00
Suren Baghdasaryan
9accb43a6a Merge "libprocessgroup: Activate controllers in cgroup v2 hierarchy at intermediate levels" 2021-08-02 21:27:37 +00:00
Suren Baghdasaryan
25ad3f9b86 libprocessgroup: Activate controllers in cgroup v2 hierarchy at intermediate levels
When creating uid/pid hierarchy, cgroup.subtree_control should be set at
every level of that hierarchy except for the leaf level.

Bug: 195149205
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: Iedc2e859715b31db62158c85016708f252db2b70
2021-08-02 20:02:51 +00:00
Tom Cherry
18a9324e3f Merge "Allow mapping of raw block devices to partition names" 2021-08-02 18:59:25 +00:00