Commit graph

38472 commits

Author SHA1 Message Date
Tom Cherry
8f38048f7d init: add sigstop option for debugging services from their start
Test: the examples in README.md
Change-Id: Idb528ea4017f8f4ce62911928c040f4bc558d196
2018-04-17 14:52:49 -07:00
Treehugger Robot
22dc27b9fa Merge "lmkd: Introduce support for legacy kill algorithm that uses minfree levels" 2018-04-15 17:34:59 +00:00
Suren Baghdasaryan
c09b53db7b lmkd: Introduce support for legacy kill algorithm that uses minfree levels
Add ability to switch to the algorithm used by lowmemorykiller driver
for determining when to kill. It uses minfree levels to decide at which
levels of free memory and file cache to kill a process. oom_adj_score
is also determined by comparing current memory resources against minfree
levels.
ro.lmk.use_minfree_levels property is introduces for switching into this
mode. By default it is disabled.

Bug: 77299493
Bug: 75322373
Merged-In: I6b51972951026854a079fcda33d6786b7ed035e4
Change-Id: I6b51972951026854a079fcda33d6786b7ed035e4
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2018-04-15 16:02:36 +00:00
Treehugger Robot
5176b4b37a Merge "lmkd: Switch to using /proc/meminfo to have access to file cache size" 2018-04-15 11:36:46 +00:00
Suren Baghdasaryan
45c9e0b30c lmkd: Switch to using /proc/meminfo to have access to file cache size
Current mechanism of getting system memory state by using sysinfo()
is not enough because it does not provide information about file cache
size which is needed to correctly assess memory state. Switch to using
data from /proc/meminfo that includes information provided by sysinfo()
and file cache size in addition to that.


Bug: 77299493
Bug: 75322373
Merged-In: I16106fc4f9254f17f776803e60502b7b6474e1b7
Change-Id: I16106fc4f9254f17f776803e60502b7b6474e1b7
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2018-04-15 10:03:05 +00:00
Treehugger Robot
b62d5ed25e Merge changes Ie7d80bbb,I8e27f8b9
* changes:
  lmkd: Add zoneinfo and meminfo parsing routines
  lmkd: Optimize frequent file reads by keeping file descriptors open
2018-04-15 09:31:52 +00:00
Suren Baghdasaryan
ceffb41162 lmkd: Add zoneinfo and meminfo parsing routines
/proc/zoneinfo and /proc/meminfo contain information necessary for lmkd
to assess system memory state. Add routines to parse these files.


Bug: 77299493
Bug: 75322373
Merged-In: Ie7d80bbb81fd0d2fc0629f6f678e6afc97fed1f6
Change-Id: Ie7d80bbb81fd0d2fc0629f6f678e6afc97fed1f6
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2018-04-15 07:55:27 +00:00
Suren Baghdasaryan
6499e5ec4a lmkd: Optimize frequent file reads by keeping file descriptors open
To check system memory state lmkd is using same files every time vmpressure
event is received. Instead of opening and closing these files every time
we store the file descriptor and use pread() to reread the file from
the beginning.


Bug: 77299493
Bug: 75322373
Merged-In: I8e27f8b9526e82e3cc313a02fce215c2e4dd3d29
Change-Id: I8e27f8b9526e82e3cc313a02fce215c2e4dd3d29
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2018-04-15 07:54:03 +00:00
Elliott Hughes
66b685ef3f Merge "debuggerd: remove maximum abort message length." 2018-04-14 16:17:14 +00:00
Treehugger Robot
bb266150fe Merge changes I78d2dc79,I6e2eaebe
* changes:
  lmkd: Fix usage of ro.lmk.kill_heaviest_task property
  lmkd: Rename is_go_device variable to better reflect its function
2018-04-14 05:59:27 +00:00
Treehugger Robot
2468b7623c Merge "adb: fix adb reverse when adbd has multiple transports." 2018-04-14 00:43:33 +00:00
Josh Gao
1cc7bd80a6 debuggerd: remove maximum abort message length.
Let the logging implementation be the imposer of limits.

Bug: http://b/64759619
Test: debuggerd_test
Change-Id: I8bc73bf2301ce071668993b740880224846a4e75
2018-04-13 17:34:20 -07:00
Treehugger Robot
95a37079f5 Merge "Add missing @addtogroup tags." 2018-04-13 23:50:42 +00:00
Suren Baghdasaryan
818b59b229 lmkd: Fix usage of ro.lmk.kill_heaviest_task property
lmkd should use ro.lmk.kill_heaviest_task property to select between
algorithms for victim selection. Set ro.lmk.kill_heaviest_task default
value to false in order to keep it compatible with previous versions
of lmkd (killing the heaviest task is a new mechanism).

Change-Id: I78d2dc79d9c54e636c26665605518d9c87b535b3
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2018-04-13 23:24:24 +00:00
Suren Baghdasaryan
ff61afb002 lmkd: Rename is_go_device variable to better reflect its function
Rename is_go_device variable to low_ram_device to better reflect
its meaning and relation to ro.config.low_ram variable.

Change-Id: I6e2eaebe79cf2e6edf861f7c602e52a5b573ad0a
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2018-04-13 23:24:09 +00:00
Treehugger Robot
b518418fbb Merge "lmkd: Add lmkd README file" 2018-04-13 22:29:49 +00:00
Dan Albert
55a76719e2 Add missing @addtogroup tags.
These NDK docs weren't in any groups, so they don't show up in the
new site.

Test: https://irina-dot-devsite.googleplex.com/ndk/reference/group/logging
Test: https://irina-dot-devsite.googleplex.com/ndk/reference/group/sync
Bug: http://b/77236573
Change-Id: I300f96585dec94359ecf96fbf39c6dc3ec4579e5
2018-04-13 14:49:41 -07:00
Suren Baghdasaryan
7e5dea82a5 lmkd: Add lmkd README file
Add README file providing lmkd overview and description for its
properties.

Change-Id: I30236dd4ccaa2b48c31dfb80b63f0b82b49b5744
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2018-04-13 21:36:44 +00:00
Josh Gao
44899eeb53 adb: fix adb reverse when adbd has multiple transports.
Plumb the transport that we received the adb reverse request on through
to reverse_service, instead of trying to get a unique transport on
devices that have multiple active transports (e.g. a device with USB
(even unplugged) connected via TCP).

Bug: http://b/37066218
Bug: http://b/71898863
Test: `echo foo | nc -l 12345 & adb reverse tcp:12345 tcp:12345; adb shell nc localhost 12345` on a device connected via TCP
Change-Id: Iae199ae787f2e344126bbcacca8544cfc9844a4c
2018-04-13 14:25:28 -07:00
Treehugger Robot
cd71fd5109 Merge changes Ida272d21,If3f29f9e,I7dc5258d,I55258c15,Ibad79770
* changes:
  adb: win32: cleanup winsock initialization.
  adb: win32: properly set EBADF in some functions.
  adb: partially clang-format sysdeps_win32.cpp.
  adb: implement adb_writev.
  adb: switch apacket payload to a type that doesn't initialize its contents.
2018-04-13 20:54:53 +00:00
Treehugger Robot
07de83831f Merge "init: use signalfd to catch SIGCHLD" 2018-04-12 22:49:27 +00:00
Treehugger Robot
ee1b5a605e Merge "Allow vendor-init-actionable for vold-related properties" 2018-04-12 22:33:03 +00:00
Tom Cherry
4396bb85da Merge "init: do not impose vendor_init restrictions on old vendor images" 2018-04-12 22:31:02 +00:00
Ryan Prichard
1325ec8cfb init: use signalfd to catch SIGCHLD
Previously, if init received too many SIGCHLD signals, then the write to
signal_write_fd could fail with EAGAIN. The handler tried to log the
EAGAIN error, and init deadlocked if the interrupted init process had
already acquired a logging-related lock.

Bug: b/77867680
Test: manual
Change-Id: Ief0b5e94d8517827a5a7d03773391ba3ba9447c4
2018-04-12 14:15:26 -07:00
Tom Cherry
a1dbeb8d33 init: do not impose vendor_init restrictions on old vendor images
Do not restrict vendor_init restrictions on vendor images that were
built before P, as they will not have the correct permissions.

Bug: 77732028
Test: test new devices and see vendor_init still works
Change-Id: I636a07b54fbfb248e1d1a68a8f3c4d047fd5a9e9
2018-04-12 10:17:45 -07:00
Treehugger Robot
183b575e78 Merge "storaged: lower capabilities in init" 2018-04-12 15:55:26 +00:00
Treehugger Robot
d652a9e231 Merge "Remove more semicolons at the end of namespaces" 2018-04-12 14:50:07 +00:00
Treehugger Robot
ffc325a3b2 Merge "storaged: update OWNERS" 2018-04-12 10:18:48 +00:00
Pirama Arumuga Nainar
90affce0c8 Remove more semicolons at the end of namespaces
These warnings are triggered by -Wextra-semi (and not -Weverything, as
incorrectly mentioned in I49b6e6af483e011632e6a34c0663c93e5c385aa6).
This warning is added to Hidl-generated libs.

To appease clang-format, this patch also fixes some extra newlines.

Test: Build
Change-Id: I63cf5d8ecba46ad87876ff21848bfff04b12ec6e
2018-04-11 23:14:13 -07:00
Treehugger Robot
53135a4772 Merge "fastboot: fix header_actual calculation" 2018-04-12 05:56:27 +00:00
Jaekyun Seok
00ef7d560c Allow vendor-init-actionable for vold-related properties
Bug: 75987246
Bug: 73871799
Test: succeeded building and tested with taimen
Change-Id: Ifec879f07705a52501757b58b1562a97c668b8b0
Merged-In: Ifec879f07705a52501757b58b1562a97c668b8b0
(cherry picked from commit 65ce3b2cd8)
2018-04-12 12:51:09 +09:00
Fernando Lugo
91dfaecca7 fastboot: fix header_actual calculation
Bug: 77920157
Test: fastboot boot $OUT/kernel
Change-Id: Ibe2f4b9a6476ac11937448e6547b5159af011633
Signed-off-by: Fernando Lugo <flugo@google.com>
2018-04-11 19:02:59 -07:00
David Anderson
3214731cc8 storaged: update OWNERS
Bug: N/A
Test: N/A
Change-Id: Ic3e3fbcb4c4357a286ef05feab68e65390e2eab3
2018-04-11 18:50:14 -07:00
Elliott Hughes
af15fbf9aa Merge "Build /vendor/bin/logwrapper too." 2018-04-11 22:14:28 +00:00
Treehugger Robot
1e4764e90c Merge "Add SIZEOF_MEMBER." 2018-04-11 21:56:25 +00:00
Josh Gao
2e93df2e14 adb: win32: cleanup winsock initialization.
Instead of doing it in 3 arbitrary functions, do it at startup always.

Test: wine adb_test.exe
Change-Id: Ida272d218aee6c331471250edce64d512d3b628a
2018-04-11 12:54:38 -07:00
Josh Gao
011ba4b9bf adb: win32: properly set EBADF in some functions.
Test: treehugger
Change-Id: If3f29f9ee586e29652e9709b3f594a1376ed4bb3
2018-04-11 12:54:38 -07:00
Josh Gao
64a63acba9 adb: partially clang-format sysdeps_win32.cpp.
clang-format some functions that I'm about to touch, but do it in a
separate commit to avoid making the actual changes unreadable.

Test: treehugger
Change-Id: I7dc5258d9ecc1c091d42311149d9e18ae483715b
2018-04-11 12:54:38 -07:00
Josh Gao
116aa0a4ad adb: implement adb_writev.
Change-Id: I55258c155d7b07368ebb45577b2e01ca804cf258
Test: adb_test
Test: python test_device.py
2018-04-11 12:54:36 -07:00
Josh Gao
1ce99576f0 adb: switch apacket payload to a type that doesn't initialize its contents.
Switch from using std::string as the type we use to hold our payload in
apacket to a custom reimplementation that doesn't zero initialize. This
improves bulk transfer throughput in the adb_benchmark microbenchmark
on walleye by ~20%.

Test: adb shell taskset f0 /data/benchmarktest64/adb_benchmark/adb_benchmark
Change-Id: Ibad797701eb1460c9321b0400c5b167b89b2b4d0
2018-04-11 12:54:07 -07:00
David Anderson
e54ca5fa0e storaged: lower capabilities in init
Lower storaged's capabilities to DAC_READ_SEARCH as an initial step
toward running it non-root.

Bug: 77634061
Test: storaged still runs and its /proc/pid/status has lower CapPrms
Change-Id: Ibfe0349fc059e2f37efba33f587176e8ce6be9fe
2018-04-11 12:33:02 -07:00
Elliott Hughes
1b86d41c78 Add SIZEOF_MEMBER.
Bug: N/A
Test: ran tests
Change-Id: Icb7e8ae83d242c867b71a990b08eb1a62ed1482c
2018-04-11 12:29:50 -07:00
Elliott Hughes
0b539f3bcb Build /vendor/bin/logwrapper too.
Bug: https://issuetracker.google.com/77284669
Test: builds
Change-Id: Iaafc856f2a7441d318f7b9376caa6629e02a8e23
2018-04-11 08:28:37 -07:00
Treehugger Robot
1b2f2ee621 Merge "Fix mac build (ldflags -> ldlibs)" 2018-04-11 08:11:33 +00:00
Dan Willemsen
d81279f7ed Fix mac build (ldflags -> ldlibs)
Test: mmma system/core/fastboot   (on mac)
Change-Id: Ib917758c59fc33d6f8d9bd4f8716cf530c646f54
2018-04-10 22:55:55 -07:00
Treehugger Robot
002959e492 Merge changes I983f361d,I899c8433,Ie6f4b029,Ic3cb9c82,I27107d05
* changes:
  Remove unused variable.
  Remove -i vendor id matching.
  Add quotes to -v INFO/OKAY/FAIL for clarity.
  Remove legacy slot-suffix support.
  Add fastboot_test.cpp and test --os-version/--os-patch-level parsing.
2018-04-11 03:22:26 +00:00
Elliott Hughes
fef56f13bb Merge "Fix Darwin build." 2018-04-11 01:02:32 +00:00
Elliott Hughes
7678ffd6d9 Fix Darwin build.
TEMP_FAILURE_RETRY in fs.cpp.

Bug: N/A
Test: N/A
Change-Id: If77da90eeb59e485d5caf4a2e73f7aa91801be2a
2018-04-10 18:01:08 -07:00
Treehugger Robot
1d2bf45b55 Merge "Remove extra semicolon at end of namespace" 2018-04-11 00:29:29 +00:00
Treehugger Robot
ee63d74b6c Merge "adb: properly calculate packet size on Mac." 2018-04-11 00:27:36 +00:00