Commit graph

46696 commits

Author SHA1 Message Date
Rajeev Kumar
2bc24f88ca Read memory stats from /proc/pid/stat file.
(cherry pick from commit 0301683e49)
Bug: 117333340
Test: Manual testing using alloc-stress tool
Merged-In: Ie555933aafa6a6b7aa1dbf5518ebe804376e0afd

Change-Id: I8ab08606dba7de2f65711204453067dbfbdcbdd8
2019-03-05 11:53:14 -08:00
Mark Salyzyn
14fea4f7a2 Merge "fs_mgr: remount: add partition argument list"
am: 4c46285e2e

Change-Id: I343332051ac7a99822d940e5e3d69af12d541c0b
2019-03-05 10:20:12 -08:00
Mark Salyzyn
4c46285e2e Merge "fs_mgr: remount: add partition argument list" 2019-03-05 17:49:30 +00:00
Jiyong Park
a192ff7ad3 Merge changes from topic "apex_earlymount_base"
am: c676cca4f6

Change-Id: I417eb7fffbaa2c495b8dc1c1c10e5683ebafcc84
2019-03-04 23:03:13 -08:00
Jiyong Park
854c5bc218 mount /apex during first_stage init
am: 4ba548d845

Change-Id: I2f86489449b0a81c4173981a8ffe1bcb945df129
2019-03-04 23:02:24 -08:00
Treehugger Robot
c676cca4f6 Merge changes from topic "apex_earlymount_base"
* changes:
  Activate system APEXes early
  mount /apex during first_stage init
2019-03-05 06:49:02 +00:00
Jiyong Park
dcbaf9f41b Activate system APEXes early
Summary: Boot sequence around apexd is changed to make it possible for
pre-apexd processes to use libraries from APEXes. They no longer need to
wait for the apexd to finish activating APEXes, which again can be
done only after /data/ is mounted. This improves overall boot
performance.

Detail: This change fixes the problem that processes that are started
before apexd (so called pre-apexd processes) can't access libraries
that are provided only by the APEXes but are not found in the system
partition (e.g. libdexfile_external.so, etc.). Main idea is to activate
system APEXes (/system/apex/*.apex) before /data is mounted and then
activate the updated APEXes (/data/apex/*.apex) after the /data mount.

Detailed boot sequence is as follows.

1) init prepares the bootstrap and default mount namespaces. A tmpfs is
mounted on /apex and the propagation type of the mountpoint is set to
private.

2) before any other process is started, apexd is started in bootstrap
mode. When executed in the mode, apexd only activates APEXes under
/system/apex. Note that APEXes activated in this phase are mounted in
the bootstrap mount namespace only.

3) other pre-apexd processes are started. They are in the bootstrap
mount namespace and thus are provided with the libraries from the system
APEXes.

4) /data is mounted. init switches into the default mount namespace and
starts apexd as a daemon as usual.

5) apexd scans both /data/apex and /system/apex, and activate latest
APEXes from the directories. Note that APEXes activated in this phase
are mounted in the default namespaces only and thus are not visible to
the pre-apexd processes.

Bug: 125549215
Test: m; device boots
Change-Id: I21c60d0ebe188fa4f24d6e6861f85ca204843069
2019-03-05 09:47:49 +09:00
Mark Salyzyn
bc0887add7 Merge "adb: use /system/bin/remount command"
am: d458066bc7

Change-Id: I0276c6488dd5d57475e6b73cf1fef5a00a2e75b8
2019-03-04 14:41:21 -08:00
Mark Salyzyn
d458066bc7 Merge "adb: use /system/bin/remount command" 2019-03-04 22:27:19 +00:00
Mark Salyzyn
f4e7422c65 fs_mgr: remount: add partition argument list
Can supply a specific partition to remount.  Partitions can be
specified by name or mount point.  Some extra work to differentiate
an unknown partition, invalid partition, or one that is covered by
overlayfs.

Test: adb-remount-test.sh
Bug: 122602260
Change-Id: Iab6f51c2b5ebe01f1cea3fb235445d5e2f495365
2019-03-04 11:13:05 -08:00
Mark Salyzyn
2f6c180749 adb: use /system/bin/remount command
Replace direct logic in support for 'adb remount' with an exec out to
/system/bin/remount to do the heavy lifting.  Remount success and
failure strings are reported by the adb remount service in response
to the various reported errors, freeing up the remount command itself
from the legacy of script expectations.

Test: adb-remount-test.sh
Bug: 122602260
Change-Id: I686fa465f463b881bbb38f709d780a95e463be80
2019-03-04 11:12:54 -08:00
Felix
7334915cf5 Merge "ld.config: Permit legacy /system/vendor paths"
am: 6521bf3c98

Change-Id: If01c6a02f530b60167c1d29c5bf3c75befa531c9
2019-03-04 05:07:39 -08:00
Treehugger Robot
6521bf3c98 Merge "ld.config: Permit legacy /system/vendor paths" 2019-03-04 12:58:11 +00:00
Jiyong Park
4ba548d845 mount /apex during first_stage init
/apex is not mounted via init.rc but directly by the first_stage init
before the mount namespaces are configured.

This allows us to change the propagation type for /apex mount point to
private to isolate APEX activatesions across post- and pre-apexd
processes.

Bug: 125549215
Test: m; device boots to the UI

Change-Id: I10e056cd30d64cb702b6c237acd8dab326162884
2019-03-04 16:22:41 +09:00
Felix
9e40e12cea ld.config: Permit legacy /system/vendor paths
Because /vendor is a symlink to /system/vendor on devices without a
dedicated /vendor partition, /system/vendor/lib/* needs to be added to
the permitted paths whereever /vendor/lib/* is permitted.

Reasoning:
Legacy devices are forced to use ld.config.legacy.txt, which is very
permissive. We can prolong support for them and enable them to use the
VNDK if we extend the search paths to include the resolved symlink dirs.

Change-Id: I6b3bb7b86ed82395345a16bdc857353b1b15c704
2019-03-03 14:31:37 +01:00
Petri Gynther
05e32cf544 Merge "toolbox: make "r" available for /vendor"
am: bc6372103a

Change-Id: Ib55339d168808e2593748efe1aea573a56b3beb5
2019-03-02 23:30:27 -08:00
Petri Gynther
bc6372103a Merge "toolbox: make "r" available for /vendor" 2019-03-03 07:20:04 +00:00
Erick Reyes
f3a23fe800 Merge "libmeminfo: librank optimization using maps instead of vectors"
am: 924eec9518

Change-Id: Icaff42f16eb4ee6339b27ad2c750ba770be7b2e1
2019-03-01 20:12:42 -08:00
Treehugger Robot
924eec9518 Merge "libmeminfo: librank optimization using maps instead of vectors" 2019-03-02 03:58:28 +00:00
David Anderson
aaf5d64713 Merge "Fix double-accounting bug in liblp."
am: 42294631a7

Change-Id: Icc511967cbd7ce549256896f25632c741ba1a89b
2019-03-01 19:28:59 -08:00
David Anderson
42294631a7 Merge "Fix double-accounting bug in liblp." 2019-03-02 03:16:10 +00:00
Petri Gynther
7c71e06f8e toolbox: make "r" available for /vendor
Make "r" package available for /vendor, so that we can easily add:

PRODUCT_PACKAGES_DEBUG += r.vendor

in device/google/<device>/device.mk

Change-Id: I46c23a85c95444083b8e4b68961c541d9af9b216
2019-03-01 17:51:56 -08:00
David Anderson
88e36c1514 Fix double-accounting bug in liblp.
When flashing in fastbootd, we create a new MetadataBuilder using the
given super_empty.img and attempt to import the existing partition
table. This will fail if there is some incompatibility in the partition
layout or partition quotas.

This import code was accidentally double-accounting partitions when
determining if they could fit within the group quota, preventing
"fastboot flashall" once partitions reached a certain size.

Bug: 126930319
Test: liblp_test gtest
Change-Id: I89a69cba110b62719197c9a4885cfc5bcf8f009f
2019-03-01 16:17:27 -08:00
Erick Reyes
5a744684c3 libmeminfo: librank optimization using maps instead of vectors
librank was calling std::vector::find_if in nested loops when iterating
through processes and maps.

Changed the implementation to use std::map::insert, this resulted in
a significant improvement to execution speed.

Test: time librank on crosshatch

Before:  1m22.57s real     1m15.87s user     0m05.79s system
After:   0m03.85s real     0m00.88s user     0m02.92s system

Bug: 124523194

Change-Id: I2b519d0bfd7f7929c6c4c6c2374794cb1a744585
Signed-off-by: Erick Reyes <erickreyes@google.com>
2019-03-01 16:17:20 -08:00
David Anderson
5704d3e22d Merge "Remove the block size alignment restriction."
am: b1f97f9d1b

Change-Id: I47bcdfe414ef646be36b2633d77697b6d9a71084
2019-03-01 14:57:02 -08:00
David Anderson
b1f97f9d1b Merge "Remove the block size alignment restriction." 2019-03-01 22:48:25 +00:00
Wei Wang
f4885cb770 Merge "Reduce log spam from libprocessgroup"
am: 8dcd839158

Change-Id: I9fa927e181424f55b4d6043352dd3b9d08c96e29
2019-03-01 14:25:43 -08:00
Treehugger Robot
8dcd839158 Merge "Reduce log spam from libprocessgroup" 2019-03-01 22:11:15 +00:00
Suren Baghdasaryan
29b5a37e6d Merge "libprocessgroup: convert Json::Value to const refs"
am: 6ad4eb3519

Change-Id: Ida562f432aa455ea1043161dc12e157c22a380fb
2019-03-01 10:10:07 -08:00
Suren Baghdasaryan
6f8eee612c Merge "Add vendor cgroups and task_profiles support"
am: 3af39f36cc

Change-Id: I4aec4ccdb0511f70a291b404432ff341c45522fb
2019-03-01 10:08:49 -08:00
Mark Salyzyn
8138593f5a Merge "bootstat: add salyzyn as owner"
am: 8da7a1e6fd

Change-Id: I1188d770df246691a9e75caab215f01cb552d279
2019-03-01 10:03:00 -08:00
Suren Baghdasaryan
6ad4eb3519 Merge "libprocessgroup: convert Json::Value to const refs" 2019-03-01 18:02:22 +00:00
Suren Baghdasaryan
3af39f36cc Merge "Add vendor cgroups and task_profiles support" 2019-03-01 18:01:39 +00:00
David Anderson
47f7420366 Remove the block size alignment restriction.
Rather than require block-size alignment, instead bump the requested
file size to the necessary alignment. This ensures that the final block
is usable without placing onerous restrictions on the caller to figure
out the file system's block size.

This will require callers (namely, gsid) to track the actual desired
image size separately from the flie size.

This patch also updates tests to use the actual filesize of the
filesystem, rather than hardcoded 4096.

Bug: 126230649
Test: fiemap_writer_test gtest
Change-Id: I000cca274718c3ceac526d7c3392fe3a23bb42bc
2019-03-01 09:52:52 -08:00
Mark Salyzyn
8da7a1e6fd Merge "bootstat: add salyzyn as owner" 2019-03-01 17:48:56 +00:00
Bowgo Tsai
b9eca0256c Merge "fs_mgr: fix fs_mgr avb_keys parsing problem"
am: c8964edb7e

Change-Id: I5c032f678e49947e972a73335b40fdcc71187561
2019-03-01 07:41:48 -08:00
Treehugger Robot
c8964edb7e Merge "fs_mgr: fix fs_mgr avb_keys parsing problem" 2019-03-01 15:31:47 +00:00
Josh Gao
ace5a7c799 Merge "adbd: fix a case where we can fail to join a thread."
am: b530537d46

Change-Id: Ie36cec5292121754944626db5c615e42fc276102
2019-03-01 02:21:42 -08:00
Josh Gao
68f136b407 Merge changes I4d351f56,Ib9e91157
am: 7669ea5a44

Change-Id: I4336eebc399cef4df8157a00f186379a2b2e376f
2019-03-01 02:20:59 -08:00
Dima Zavin
0bb3fd4dbb Merge changes Ia3bba21c,I0ffc159b
am: 83d9b680f5

Change-Id: I3dc5a30f40b3066f08bbefc43fca2066967a619f
2019-03-01 02:19:58 -08:00
Josh Gao
b530537d46 Merge "adbd: fix a case where we can fail to join a thread." 2019-03-01 10:16:46 +00:00
Josh Gao
7669ea5a44 Merge changes I4d351f56,Ib9e91157
* changes:
  adbd: tune USB read/write sizes and queue depths.
  adb: add benchmarks for sink/source.
2019-03-01 10:15:54 +00:00
Dima Zavin
83d9b680f5 Merge changes Ia3bba21c,I0ffc159b
* changes:
  fastboot: reset timeout if INFO is received during long commands
  fastboot: switch the timeout clock source to steady_clock
2019-03-01 10:12:39 +00:00
Suren Baghdasaryan
e681df44eb libprocessgroup: convert Json::Value to const refs
Convert Json::Value to const refs to prevent creation of a null member
if specified element does not exist. Fix variable naming in the parser
while we are at it.

Change-Id: I7dabfd1c73983b465984dd6c411c9fe48743a348
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-03-01 00:29:49 +00:00
Suren Baghdasaryan
05da67c390 Add vendor cgroups and task_profiles support
Vendors should be able to specify additional cgroups and task profiles
without changing system files. Add support for /vendor/etc/cgroups.json
and /vendor/etc/task_profiles.json files which will augment cgroups and
task profiles specified in /etc/cgroups.json and /etc/task_profiles.json
system files.

Bug: 124960615
Change-Id: I548c2e866b65c19856a3617d75b75dcd06f7d5b7
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-03-01 00:29:37 +00:00
Josh Gao
5841a96afc adbd: tune USB read/write sizes and queue depths.
Reduce the operation sizes to sizes that are small enough that the
kernel will run the OOM killer to try to make them succeed. Compensate
for the smaller operation sizes by increasing the queue depth.

Bug: http://b/126582877
Test: benchmark_device.py
Change-Id: I4d351f56c8f83fea882614238cc3fec8ba1e9bf9
2019-02-28 15:53:48 -08:00
Josh Gao
b416f2252e adb: add benchmarks for sink/source.
Test: ./benchmark_device.py
Change-Id: Ib9e911574be3afa94efcfd9bc5be0a5cf7b9e2c0
2019-02-28 15:53:48 -08:00
Dima Zavin
6d46a4975e fastboot: reset timeout if INFO is received during long commands
As part of a refactor, commit db511207ed
added a timeout for receving responses for commands. Unfortunately,
the timeout is optimistic as to how quickly target devices can complete
such operations. Flash and erase commands can be quite slow on devices
with traditional flash chips. The fastboot protocol is already adept
at handling such cases because it allows for sending INFO packets during
these periods. We may receive one or more INFO packets during tehse long
operations. Every time we receive an INFO packet, it proves the remote
end is alive, but busy, which should reset our timeout timer.

Change-Id: Ia3bba21c497b22639b626d89711ecd4eb02504ed
Signed-off-by: Dima Zavin <dmitriyz@waymo.com>
2019-02-28 14:55:49 -08:00
Dima Zavin
a5b85a431e fastboot: switch the timeout clock source to steady_clock
Previously, system_clock was used for remote command timeouts
which can get disturbed by NTP adjustments (jumps).

Change-Id: I0ffc159bf34d12e8d3713044524114d60a6a45ca
Signed-off-by: Dima Zavin <dmitriyz@waymo.com>
2019-02-28 14:55:48 -08:00
Mark Salyzyn
fe85df1c0d bootstat: add salyzyn as owner
Test: none
Change-Id: I1d8874dfb5cc9efaed5ad85702a054f1c2a7766f
2019-02-28 14:10:34 -08:00