Commit graph

36 commits

Author SHA1 Message Date
Peter Collingbourne
d77b91b4ba Resync zygote64 and zygote64_32 rc files.
I noticed that the zygote64 and zygote64_32 files
had gotten slightly out of sync as a result of change
I3aad4b4b1d2f54db9e7ba86db8a655d8552bad0a. Merge the zygote64_32 changes
into zygote64, and to prevent this from happening again, replace the
64-bit zygote declaration in zygote64_32 with an import from zygote64.

Change-Id: I7fcceeb22b722c2164b9acf0b517a32ce34731fd
2022-09-29 17:21:54 -07:00
Hongguang
8d8d9d853a Restart media.tuner when zygote is restarted.
Bug: 206042321
Test: Kill system_server and dumpsys tv_tuner_resource_mgr
Change-Id: Icc83453ef8852a07329757fecd10e8898a9dbdcd
2021-11-16 04:51:49 +00:00
Woody Lin
45215ae6e5 init/service_parser: Add arguments window' and target' for `critical'
The critical services can now using the interface `critical
[window=<fatal crash window mins>] [target=<fatal reboot target>]` to
setup the timing window that when there are more than 4 crashes in it,
the init will regard it as a fatal system error and reboot the system.

Config `window=${zygote.critical_window.minute:-off}' and
`target=zygote-fatal' for all system-server services, so platform that
configures ro.boot.zygote_critical_window can escape the system-server
crash-loop via init fatal handler.

Bug: 146818493
Change-Id: Ib2dc253616be6935ab9ab52184a1b6394665e813
2020-10-26 11:38:01 +08:00
Tim Murray
e2318a2fce Move zygote64 into the top-app stune group.
Improve app startup performance before the new app is in the top-app
cpuset.

Test: boots, zygote64 in top-app stune group
Bug: 159201879

Change-Id: I3aad4b4b1d2f54db9e7ba86db8a655d8552bad0a
2020-06-18 10:43:01 -07:00
Martijn Coenen
dd0440f4e5 Abort FUSE filesystem when Zygote restarts.
The FUSE filesystem is implemented by a Zygote child. If Zygote dies,
all of its children die along with it, including the FUSE daemon. The
FUSE filesystem is cleaned up automatically whenever the /dev/fuse file
descriptor of the FUSE daemon is closed. However, due to the way the
binder driver holds on to the 'struct files' of processes in the kernel,
the closing of FDs of all of Zygote's children is serialized.

That in turn means that, if a process has a file with dirty pages on
FUSE, and that FD is closed *before* the FUSE FD, the FUSE kernel driver
will happily issue a request to the FUSE daemon to serve that request.
But since the FUSE userspace daemon is already dead, it will never get
served. And because the closing of all FDs is serialized, we will never
close the FUSE fd to unblock this request.

Solve this particular case by manually aborting the FUSE filesystem when
Zygote restarts. Because we now explicitly close the FUSE fd, the FUSE
filesystem will be cleaned up, all outstanding requests to it will be
cancelled, and new ones will be skipped.

Bug: 153411204
Test: kill zygote manually
Change-Id: I2cb6c1a03cc1a932461ff33558894a428ff35180
2020-05-28 19:11:01 +02:00
Tom Cherry
6ddce6b015 Remove references to /sys/android_power/*
It looks like these were deprecated a very long time ago.

Bug: 141939924
Test: tree-hugger
Change-Id: I4fc098b2a45c81fe2af49c0ed4248dc14489f8b1
2019-10-01 13:30:41 -07:00
Jiyong Park
3bddd540dd Don't defer zygote
Removing 'updatable' from zygote as zygote is started after apexd. All
APEXes are guaranteed to be activated at the moment.

Sequence of actions:
1) /data mounted. post-fs-data is triggered.
2) apexd starts. APEXes are activated. Init does not execute more
commands until the activation finishes.
3) all post-fs-data sections from other *.rc are executed.
4) zygote-start is triggered.

Bug: 123404717
Bug: 126555629
Bug: 125549215
Test: device boots
Test: no following message on the logcat log
Could not restart 'zygote': Cannot start an updatable service 'zygote' before configs from APEXes are all loaded. Queued for execution.

Change-Id: Ib4d0716ed5225b6ade3adaa247ff6140a9b2b9d5
2019-03-07 12:41:16 +09:00
Chris Wailes
4a25816c22 Renamed blastula to unspecialized app process (usap)
Bug: 123017829
Test: make & boot & launch apps
Change-Id: Id780245f2d86e57cc4964abb2fd10ead9b64da1f
2019-02-22 11:35:08 -08:00
Chris Wailes
ca11579b6c Added a new socket to Zygote init scripts.
This change adds new socket declarations to the init scripts for the
Zygote processes.  This socket is used for communication between the
System Server and the Blastula pool.

Bug: 68253328
Change-Id: I5dbb87770b1a3100c6c122bb39ca854006bb0b0d
Topic: zygote-prefork
Test: build image; flash device; launch apps
2019-01-22 09:42:06 -08:00
Martin Stjernholm
440efa5796 Delay zygote startup until after the Runtime APEX has been mounted.
It depends on libdexfile_external, libnative{bridge,helper,loader} and
libart(d), which are provided by the Runtime APEX.

Test: flash & boot
Test: atest CtsJdwpTestCases
Bug: 113373927
Change-Id: I0df99f444e892c47a5f06bd1bcf5d184defb4517
2019-01-21 10:55:31 +00:00
Jeff Sharkey
9410d572fb Add reserved disk GID to critical component.
We recently created a new GID that can be granted to critical system
processes, so that the system is usable enough for the user to free
up disk space used by abusive apps.

Test: builds, boots
Bug: 62024591
Change-Id: Ia5af7535cc05a214f8720ac08c594c6db888597a
2018-01-07 19:25:00 -07:00
Narayan Kamath
59e8e07c89 Merge "Revert "Revert "Lazily preload secondary zygote resources.""" 2017-02-16 12:31:02 +00:00
Narayan Kamath
f403e64bd0 Revert "Revert "Lazily preload secondary zygote resources.""
This reverts commit b248cb469a18e00131338b300f8b344aac52fcb5.

Test: manual
Bug: 34810190
Change-Id: I999e759a5681a58962aa5a0783946c15237bf45c
2017-02-14 19:03:15 +00:00
Narayan Kamath
eeabbeba16 Reapply 1339871138: Only apply schedTune boost to top-app tasks
Parts of this change were accidentally reverted by an incorrect
manual merge conflict resolution.

Bug: 35306127
Test: manual
Change-Id: I8e6d6b07dcaa548775213dd42ba9def7431c62d3
2017-02-13 17:34:51 +00:00
Narayan Kamath
f3d891031e Revert "Lazily preload secondary zygote resources."
This reverts commit e5aee79e9c.

Given recent improvements to boot timing, and higher paralellization,
the lazy preloading of zygote resources makes boot time slightly slower
by ~100-250ms. Therefore, the change is being reverted until we can do
it properly and defer it to a later point in the boot process. This work
is being tracked by b/34810190

BEFORE
------
successive-online : 17290.0,17633.0,17329.0,17655.0,16802.0,16888.0,17645.0,17369.0,17572.0,16932.0,
successive-online_avg : 17311.5
successive-boot : 24834.0,25119.0,25122.0,25091.0,25617.0,25535.0,25047.0,27462.0,25088.0,25648.0,
successive-boot_avg : 25456.3

AFTER
-----
successive-online : 16973.0,16530.0,17015.0,17953.0,17367.0,17098.0,16887.0,17377.0,18039.0,16742.0,
successive-online_avg : 17198.1
successive-boot : 24921.0,25622.0,25781.0,25449.0,25128.0,24774.0,24554.0,25029.0,24544.0,25809.0,
successive-boot_avg : 25161.1

Test: Boot timings collected with tradefed harness.
Bug: 34810190
Change-Id: I9a6dd5ce31bda067e74fc088b057711fa4a7a0fb
2017-02-07 10:22:37 +00:00
Wei Wang
67bfc5dd2c Merge "Restart wificond when zygote died" 2017-01-09 16:30:27 +00:00
Wei Wang
38fcd33e46 Restart wificond when zygote died
This helps to avoid tearDownInterfaces call from WiFiStateMachine's
constructor.

Bug: 33752168
Test: on device

(cherry picked from commit 0db195d0757e36c73b9da5a95d9b9986386f0f2e)

Change-Id: I55f56dd8daa5089073ff8dd424e92d09326c7d00
2017-01-07 19:45:42 -08:00
Wei Wang
54ad104553 Restart wificond when zygote died
This helps to avoid tearDownInterfaces call from WiFiStateMachine's
constructor.

Bug: 33752168
Test: on device
Change-Id: I44527ee39700c5ac3259bba3a007dde6979170ff
2017-01-07 05:53:43 +00:00
Narayan Kamath
e5aee79e9c Lazily preload secondary zygote resources.
Companion to change Id387b7132d0 in frameworks/base.

Test: manual
Change-Id: I3f50327aafddce8530a990505cd436225c5fe7a7
2016-12-28 15:17:52 +00:00
Nick Kralevich
d3a2573eea Merge "give zygote AID_READPROC"
am: 3a724a8f5d

Change-Id: Ie877330cba17a429ec3cd26eafaaeca3df66cc59
2016-11-03 18:15:04 +00:00
Nick Kralevich
c21169c59f give zygote AID_READPROC
In zygote wrapping mode, ZygoteConnection does a check to see if the pid
reported by the wrapped process is either child process that was
forked, or a decendent of it. This requires read access to other
processes /proc files. Grant zygote AID_READPROC to allow this access.

Bug: 32610632
Test: manual inspection of /proc files to verify group.
Test: manual inspection of zygote's children to make sure they do not
      inherit AID_READPROC

Change-Id: I3619a9ae33c8077e068e8024f7c7d44cfca6fb76
2016-11-02 13:48:32 -07:00
Todd Kjos
9453ea8ba9 resolve merge conflicts of c6937f2 to nyc-mr1-dev-plus-aosp
Change-Id: I82638b0dab5e1b5117f4ed4752fd2cbdaf8c47b1
2016-09-13 12:40:32 -07:00
TuHailong
d90a55c4bf Fix zygote energy-aware scheduler tuning bug
Change-Id: Ib612e99f7b115c2fbd1503e0994948fd0b0a2dec
2016-09-08 21:45:41 +08:00
Vitalii Tomkiv
7a1a6b91a7 Merge \\\"Set zygote process priority to -20 to speed up VM startup time.\\\" am: 92774329dd am: bf5f0fae07
am: b20a94398b

Change-Id: I65c0b4e96718c89ff3706516727cd6e6fed3d66b
2016-06-16 17:18:30 +00:00
Vitalii Tomkiv
bf5f0fae07 Merge \"Set zygote process priority to -20 to speed up VM startup time.\"
am: 92774329dd

Change-Id: I3c70a90e4d4e07f7c733a3a2738b0067ac09b6dd
2016-06-16 17:09:36 +00:00
Vitalii Tomkiv
372e5474d4 Set zygote process priority to -20 to speed up VM startup time.
Tests for Nexus9 device shows 450ms boot time speedup, 180ms for Nexus
5X.

Bug: 28866384

Change-Id: Icefd130d4bfe5538dae5b9518250807351b0789e
2016-06-08 10:54:03 -07:00
Srinath Sridharan
1339871138 Only apply schedTune boost to top-app tasks
When using EAS, the foreground tasks were all getting boosted
during touchboosts. Limit it to top-app tasks.


BUG: 28378389
Change-Id: I72b7158a614bfd9b6c61024774e408ceba61fc9c
2016-05-23 23:59:38 +00:00
Srinath Sridharan
7ac34d08ef marlin/eas: Fixing foreground/schedtune.boost path.
BUG: 28378389
Change-Id: I613fd5622d3d27deafe6054bbf2a4799d97f9170
2016-04-25 13:09:05 -07:00
Todd Kjos
11cde567a8 Mount schedTune cgroup as /dev/stune
Make stune consistent with the other cgroups mounted under /dev

Change-Id: I0fe7120ad2afbe8e6a3c9f72cc3f465de618d344
2016-02-23 09:08:54 -08:00
Chien-Yu Chen
cd2ef4ef1c Restart cameraserver
Bug: 24511454
Change-Id: Ia27f4ef0eb71f891c789f637a21b04afe0b1c4e9
2016-01-25 11:52:40 -08:00
Andy Hung
c7ae5210a7 Merge "Add audioserver uid and restart service when needed" 2015-12-11 20:08:51 +00:00
Todd Kjos
ba8a47531c Actively mangage EAS schedtune nodes
Move foreground tasks to /sys/fs/cgroup/stune/boost/tasks (boosted
weight in EAS scheduler). Move background tasks to
/sys/fs/cgroup/stune/tasks (default weight). For services started
with init, set "foreground" services to boosted.

Change-Id: I0e489fad9510727c13e6754dabaf311c2391f395
2015-11-16 14:57:47 -08:00
Todd Kjos
ed60788968 Actively mangage EAS schedtune nodes
Move foreground tasks to /sys/fs/cgroup/stune/boost/tasks (boosted
weight in EAS scheduler). Move background tasks to
/sys/fs/cgroup/stune/tasks (default weight). For services started
with init, set "foreground" services to boosted.

Change-Id: I0e489fad9510727c13e6754dabaf311c2391f395
2015-11-16 08:53:04 -08:00
Andy Hung
fec47527b4 Add audioserver uid and restart service when needed
Bug: 24511453
Change-Id: I6987a82149d23ad671478cf21488c62cb1ecfc93
2015-10-30 16:58:59 -07:00
Tim Murray
bc8c731aab Add zygote to the foreground cpuset.
This ensures that newly forked zygote processes will end up
in the corret cpuset.

bug 23751126

Change-Id: I987a2828cf2504963f1317d17f0b51d26cf22a70
2015-09-02 11:39:05 -07:00
Narayan Kamath
7cdbbcabda Add a zygote 64/32 bit config.
64 bit zygote is the "primary" and the system server is run
as a 64 bit process.

Change-Id: Ie1c2b0809faa92937bc407dd66e7a606ebb4f8f3
2014-05-21 11:20:42 +01:00