Commit graph

38190 commits

Author SHA1 Message Date
Elliott Hughes
ce232d572d Add NDK folks to OWNERS for library configuration.
Bug: N/A
Test: N/A
Change-Id: I868f1710ba2a5f9a60b4ae6fe4900f2b38095114
2018-03-19 10:56:07 -07:00
Treehugger Robot
d555e08224 Merge "Copy adb/OWNERS to diagnose_usb/OWNERS." 2018-03-06 01:50:49 +00:00
Elliott Hughes
ce55523ffc Copy adb/OWNERS to diagnose_usb/OWNERS.
Bug: N/A
Test: builds
Change-Id: Iba1922309ef178a41b5bb622065840f49f3c81cf
2018-03-05 15:47:43 -08:00
Josh Gao
9ee373ac2c Merge changes from topic "adb_bp"
* changes:
  adb: remove meaningless const.
  adb: convert Connection to a nonblocking interface.
  adb: use soong version stamping.
  adb: switch over to Android.bp.
2018-03-05 23:45:27 +00:00
Josh Gao
ffbd3364a4 adb: remove meaningless const.
Returning a const value is pointless.

Test: mma
Change-Id: Ia578d75345361d53e4a29bb9724bfcc161b8d8be
2018-03-05 13:00:28 -08:00
Josh Gao
0bbf69cbbf adb: convert Connection to a nonblocking interface.
Rename the existing Connection to BlockingConnection, add a nonblocking
Connection, and add an adapter between the two, to enable future work
to reduce the impedance mismatch from implementing a blocking interface
on top of nonblocking primitives.

While we're here, delete A_SYNC, and remove one layer of pipes when
sending a packet (replacing it with a condition variable when using
BlockingConnectionAdapter).

Test: python test_device.py, manually plugging/unplugging devices
Change-Id: Ieac2bf937471d9d494075575f07e53b589aba20a
2018-03-05 13:00:28 -08:00
Josh Gao
c7567fa52e adb: use soong version stamping.
Bug: http://b/71719137
Test: adb version
Change-Id: Ic735814574c83a7c2b8bef213592d494f5ec3860
2018-03-05 13:00:08 -08:00
Treehugger Robot
fc882a67d8 Merge "Add ek and lorenzo to OWNERS for system/core netlink code." 2018-03-05 19:21:37 +00:00
Lorenzo Colitti
29005acfd4 Add ek and lorenzo to OWNERS for system/core netlink code.
Test: builds
Change-Id: I3f3ffaf45b683a5f757d83f751a8adb8bb2e0daf
2018-03-05 19:18:02 +09:00
Suren Baghdasaryan
1d5b102671 Merge changes I394a7920,Ia847118c,Ic8396eee,I79a85c33,Id015e6a7, ...
* changes:
  lmkd: Select in-kernel vs userspace lmk based on kernel driver presence
  lmkd: Implement kill timeout
  lmkd: Allow killing multiple processes to downgrade memory pressure
  lmkd: Detect the highest level of vmpressure when event is detected
  lmkd: Close cgroup.event_control file when done writing
  lmkd: Remove stale dependency on libprocessgroup
  lmkd: Add ability to trace lmkd kills
  lmkd: add logic to kill the heaviest of the eligible processes
  lmkd: change defaults to disable event upgrade/downgrade logic
  lmkd: add ability to monitor all vmpressure events
2018-03-02 21:32:18 +00:00
Treehugger Robot
24efdff2c5 Merge "fastboot: only require Linux modules on Linux" 2018-03-02 20:44:29 +00:00
Treehugger Robot
3dad67af05 Merge "healthd: Fix negativity check after cast to unsigned enum" 2018-03-02 19:49:18 +00:00
Yi Kong
808e57e3f3 healthd: Fix negativity check after cast to unsigned enum
mapSysfsString return code is checked for negativity after being casted
to unsigned enum type, which will always be false. This is obviously
unintended behaviour.

Fixes tautological-unsigned-enum-zero-compare warning.

Bug: 72331526
Test: m
Change-Id: Icec76d7a1121cb56fd9d05feb70cede69954c322
2018-03-02 18:42:03 +00:00
Treehugger Robot
fd42c09813 Merge "Remove empty zip warning on host builds" 2018-03-02 02:07:00 +00:00
Treehugger Robot
b9ee9abebe Merge "Revert "If enablefilecrypto or init_user0 fails, reboot into recovery."" 2018-03-02 01:26:32 +00:00
Suren Baghdasaryan
2088f6ad03 lmkd: Select in-kernel vs userspace lmk based on kernel driver presence
(cherry pick from commit 979591b627)

Currently selection criteria for in-kernel vs userspace lmk is kernel
driver presence and device not being a Go device. This change removes
Go device check leaving kernel driver presence to be the only selection
criteria.

Bug: 71502948

Change-Id: I394a7920433a8d090e207ea86296356413a63fe7
Merged-In: I394a7920433a8d090e207ea86296356413a63fe7
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2018-03-02 01:16:05 +00:00
Suren Baghdasaryan
63dadcf79e lmkd: Implement kill timeout
(cherry pick from commit caa2dc56fd)

New ro.lmk.kill_timeout_ms property defines timeout in ms after a
successful kill cycle for more kills to be considered. This is
necessary because memory pressure after a kill does not go down
instantly and system needs time to reflect new memory state. This
timeout prevents extra kills in the period immediately after a
kill cycle. By default it is set to 0 which disables this feature.

Bug: 63631020
Test: alloc-stress

Change-Id: Ia847118c8c4a659a7fc38cd5cd0042acb514ae28
Merged-In: Ia847118c8c4a659a7fc38cd5cd0042acb514ae28
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2018-03-02 01:15:01 +00:00
Suren Baghdasaryan
aa73bafea7 lmkd: Allow killing multiple processes to downgrade memory pressure
(cherry pick from commit 65f54a2665)

Record free memory at low vmpressure levels and whenever pressure
increases beyond low free up enough memory to downgrade memory pressure
to low. This is done by freeing enough memory to get to the max free
memory levels seen during low vmpressure.
The kill logic for Go devices is not changed as these devices are designed
to operate under high memory pressure.

Bug: 63631020
Test: alloc-stress

Change-Id: Ic8396eee08013b1c709072a13525601d5c8bf1f1
Merged-In: Ic8396eee08013b1c709072a13525601d5c8bf1f1
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2018-03-02 01:14:13 +00:00
Suren Baghdasaryan
1a2589e52b lmkd: Detect the highest level of vmpressure when event is detected
(cherry pick from commit e82e15c242)

lmkd checks for vmpressure events using epoll_wait() with eventfds of
all registered events. It's possible that multiple events of different
priorities happen before epoll_wait() returns. For these cases we
use conservative approach by assuming that the system is under the
highest registered vmpressure levels. This speeds up lmkd response time
to high memory pressure by not responding to possibly stale low pressure
levels when vmpressure rises quickly.

Bug: 63631020
Test: alloc-stress

Change-Id: I79a85c3342e7e1b3a3be82945266b2cc60b437cf
Merged-In: I79a85c3342e7e1b3a3be82945266b2cc60b437cf
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2018-03-02 01:13:16 +00:00
Tom Cherry
c3892c045f Merge "Restrict setting platform properties from vendor .prop files" 2018-03-02 01:12:32 +00:00
Suren Baghdasaryan
ab05d67d86 lmkd: Close cgroup.event_control file when done writing
(cherry pick from commit 1bd2fc4fb6)

After events are specified by writing into cgroup.event_control file
the file should be closed.

Change-Id: Id015e6a7bac2b74bbc8d8793c85f529ee00bdf55
Merged-In: Id015e6a7bac2b74bbc8d8793c85f529ee00bdf55
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2018-03-02 01:12:29 +00:00
Suren Baghdasaryan
e57c3d313d lmkd: Remove stale dependency on libprocessgroup
(cherry pick from commit b333f83481)

Remove stale dependencies and header file inclusions

Change-Id: Ic0e7adb5bd2a0832937a831b6918e52ace4ad46a
Merged-In: Ic0e7adb5bd2a0832937a831b6918e52ace4ad46a
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2018-03-02 01:11:34 +00:00
Suren Baghdasaryan
e1217c025d lmkd: Add ability to trace lmkd kills
(cherry pick from commit c71355991d)

For tracing lmkd kills inside kernel it is useful to have traces
indicating when and which process lmkd is killing. By default the
tracing is disabled.

Bug: 63631020
Test: alloc-stress

Change-Id: I3ceb2bde0c292eec55855cb4535927f3b4c5d08b
Merged-In: I3ceb2bde0c292eec55855cb4535927f3b4c5d08b
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2018-03-02 01:10:42 +00:00
Suren Baghdasaryan
b93764db9c lmkd: add logic to kill the heaviest of the eligible processes
(cherry pick from commit 662492ab1d)

Killing the most memory-demanding process from the set of eligible
processes yields better results on high-performance devices than
killing the first one we could find. This is in line with how in-kernel
lowmemorykiller driver chooses its victims.

Bug: 63631020
Test: alloc-stress

Change-Id: Ie1ef7f33f3e79698a9b4120c14490386d6129f9b
Merged-In: Ie1ef7f33f3e79698a9b4120c14490386d6129f9b
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2018-03-02 01:09:12 +00:00
Suren Baghdasaryan
e5c9643119 lmkd: change defaults to disable event upgrade/downgrade logic
(cherry pick from commit ad2fd9150b)

vmpressure upgrade/downgrade logic based on swap utilization works well
for low memory devices because of a small swap size, however for high
performance devices this measure is not a good indication of the memory
pressure because of large swap resources. This change sets the default
levels to disable upgrade/downgrade logic by default and each device
can set these properties appropriately.

Bug: 63631020
Test: alloc-stress

Change-Id: Ifd4fbd4d6bb3e82f0f87b029df94934f1e7b1c9c
Merged-In: Ifd4fbd4d6bb3e82f0f87b029df94934f1e7b1c9c
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2018-03-02 01:07:42 +00:00
Treehugger Robot
a281389bf4 Merge "Remove unreachable condition" 2018-03-02 00:48:42 +00:00
Paul Crowley
e242a97db5 Revert "If enablefilecrypto or init_user0 fails, reboot into recovery."
This reverts commit 959b055535.

Reason for revert: b/73968735
Bug: 73968735
Test: b/73968735#comment5

Change-Id: Ifce4c029bab7380c60e20cc2b2885beb4a097456
2018-03-01 23:24:20 +00:00
Tom Cherry
fe6cc42de4 Merge "Clean up property set error handling" 2018-03-01 22:54:24 +00:00
Yi Kong
141cceee58 Remove unreachable condition
Comparison of unsigned enum expression < 0 is always false. Fixes
tautological-unsigned-enum-zero-compare warning.

Bug: 72331526
Test: m
Change-Id: I17eb218b256015f5f406fd24324a49b05a0e8866
2018-03-01 22:54:08 +00:00
Treehugger Robot
10f62351eb Merge "Add a NOLINT for the memory leak we added" 2018-03-01 22:00:02 +00:00
Suren Baghdasaryan
cd7ad2f081 lmkd: add ability to monitor all vmpressure events
(cherry pick from commit 96bf3a600c)

Ability to monitor all available vmpressure event levels is needed
to accommodate systems with different memory resources. Low memory
systems can rely on medium and critical level events because working
under memory pressure is usual mode of operation. High performance
systems with more memory need to react earlier using also low
vmpressure level events to free memory early and prevent low memory
condition affecting its performance.

Bug: 63631020
Test: alloc-stress

Change-Id: I0cef1bd4c97d32c005045ae47f0ce3464ed98899
Merged-In: I0cef1bd4c97d32c005045ae47f0ce3464ed98899
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2018-03-01 21:40:13 +00:00
Adam Lesinski
b354dcef98 Remove empty zip warning on host builds
Change-Id: Iaafe208930c316cc32f39ce2687be555b9eeb35f
2018-03-01 21:33:49 +00:00
Tom Cherry
dc375869ab Restrict setting platform properties from vendor .prop files
We should only allow vendor-init-settable properties to be set from
.prop files on /vendor and /odm.

Bug: 73905119
Test: test on walleye that disallowed properties are rejected
Change-Id: I2a5d244fdc71060ddda3e3d87442e831e6b97831
2018-03-01 11:17:07 -08:00
Tom Cherry
69d47aa829 Clean up property set error handling
Currently we only report why a property set call has failed but drop
the context of what was trying to set the property.  This change
adds information about why a property was trying to be set when it
fails.

It also unifies property_set() within init to go through the same
HandlePropertySet() function as normal processes do, removing unneeded
special cases.

Test: boot bullhead
Test: attempt to set invalid properties and see better error messages
Change-Id: I5cd3a40086fd3b226e9c8a5e3a84cb3b31399c0d
2018-03-01 11:14:02 -08:00
George Burgess IV
657db00e3d Add a NOLINT for the memory leak we added
Added by I7255d45335fa009dc9e5de99dff67af52bd70e06

Bug: None
Test: Ran the analyzer. Complaint is gone.
Change-Id: Id9b8debd8b9690210f5a8e19154ee3a5095b8fbd
2018-03-01 18:59:50 +00:00
Tom Cherry
45ee43b1ac Merge "Don't build host_init_verifier on Android either" 2018-03-01 05:46:39 +00:00
Tom Cherry
547f7318c2 Don't build host_init_verifier on Android either
Also fixes another mac build issue...

Test: linux builds still work...
Change-Id: I549891c7e38729bd5fbe79f79b7345dabd9b4b28
2018-02-28 21:43:59 -08:00
Tom Cherry
28d364792f Merge "Don't build host_init_verifier for darwin" 2018-03-01 01:25:32 +00:00
Tom Cherry
96ff0fed82 Don't build host_init_verifier for darwin
And therefore fix the mac build break.

Test: none
Change-Id: Ice28780abc62fc3e46119497d23bcbc124354159
2018-02-28 17:21:14 -08:00
Tom Cherry
49fd480ede Merge "init: add host side parser for init" 2018-03-01 00:04:49 +00:00
Josh Gao
2776845aa5 adb: switch over to Android.bp.
Rearrange some files while we're doing this.

Bug: http://b/71721338
Test: manually ran adb on windows
Change-Id: Ie47bda82279e4b9521505ad0353bf9ef649fc7d7
2018-02-28 15:29:50 -08:00
Treehugger Robot
1ac7150590 Merge "adb: add a way to make the server intentionally leak." 2018-02-28 22:56:30 +00:00
Josh Gao
e2176118f4 adb: add a way to make the server intentionally leak.
Add a way to test LeakSanitizer with the server by adding an
environment variable that intentionally leaks.

Test: ASAN_OPTIONS=detect_leaks=1:leak_check_at_exit=1 ADB_LEAK=1 adb server nodaemon
Change-Id: I7255d45335fa009dc9e5de99dff67af52bd70e06
2018-02-28 14:16:14 -08:00
Colin Cross
c8a22bc1af Merge "Make memunreachable_binder_test suitable for VTS" 2018-02-28 19:11:42 +00:00
Tom Cherry
de6bd50d42 init: add host side parser for init
Create a host side parser for init such that init rc files can be
verified for syntax correctness before being used on the device.

Bug: 36970783
Test: run the parser on init files on host

Change-Id: I7e8772e278ebaff727057308596ebacf28b6fdda
2018-02-28 10:45:45 -08:00
Treehugger Robot
d24c8484c8 Merge "Change the remount command to be more container-friendly" 2018-02-28 16:48:37 +00:00
Tom Cherry
304dacae8a Merge "libprocessgroup: remove legacy C string handling and build for host" 2018-02-28 16:22:09 +00:00
Treehugger Robot
c0d4786989 Merge "Mark crash_dump.policy as not supported on mips" 2018-02-28 03:07:21 +00:00
Colin Cross
51e6c252c4 Make memunreachable_binder_test suitable for VTS
Link statically against libmemunreachable to avoid runtime
dependency on libmemunreachable.so.
Provide a better error when run as non-root.
Rename the test to MemunreachableBinderTest.
Add comments explaining the test sequence.

Bug: 28275695
Test: memunreachable_binder_test
Change-Id: Iddfba636205b7ca3ad31a6ba2c4e85abadd32d0d
2018-02-27 18:29:18 -08:00
Josh Gao
09d5e258ef Merge changes I0783be05,Id8178913
* changes:
  adb: allow reentrant calls to fdevent_run_on_main_thread.
  adb: stop using quick_exit.
2018-02-28 00:14:58 +00:00