Commit Graph

975 Commits

Author SHA1 Message Date
Tim Murray 6a9c142f1b DO NOT MERGE: lmkd: retune rate at which processes are killed
Kill a single process at a time and try to wait up to 100ms for
that process to reclaim memory before triggering another kill.

Test: boots, works
bug: 116877958
Change-Id: I6775d0534b3e3728c04389d3eae1a00e3cbf9f27
2018-10-26 13:21:17 -07:00
Bill Yi 44149bfe34 [automerger skipped] Merge pie-platform-release to aosp-master - DO NOT MERGE am: d4e20cd0f9 -s ours am: 6f691264b0 -s ours
am: ea149f0dad  -s ours

Change-Id: I077c643d9361721b7e8352be028161bffc995c7f
2018-10-24 20:38:44 -07:00
Suren Baghdasaryan 58c52acb36 Merge "lmkd: Add command to get number of kills" am: a1c684be4f am: e518e0a1b8
am: 50312e155b

Change-Id: Id63ec92116193c7a485dc6243fad8ac9c5e6679d
2018-10-24 20:33:11 -07:00
Bill Yi 75fc74cc6a [automerger skipped] Merge pie-platform-release to aosp-master - DO NOT MERGE am: d4e20cd0f9 -s ours
am: 6f691264b0  -s ours

Change-Id: I0e2fd6cf802c4b132d0b5d4daa1c7bde3b1f323d
2018-10-24 19:54:21 -07:00
Suren Baghdasaryan 0a31d7860a Merge "lmkd: Add command to get number of kills" am: a1c684be4f
am: e518e0a1b8

Change-Id: Ibe242de81e5e7cf027763a67dafde70621a7e152
2018-10-24 19:52:18 -07:00
Bill Yi a6426eb63b [automerger skipped] Merge pie-platform-release to aosp-master - DO NOT MERGE
am: d4e20cd0f9  -s ours

Change-Id: Ie17a382505e1b8f6fb135a415f6fa8c9671354e4
2018-10-24 16:38:21 -07:00
Bill Yi 5b3b22bbc2 Merge pie-platform-release to aosp-master - DO NOT MERGE
Change-Id: I413bb086f5ff064430c061bdd5d0fe3d02925304
2018-10-24 14:48:45 -07:00
Suren Baghdasaryan 301581b8af Merge "lmkd: Add command to get number of kills"
am: a1c684be4f

Change-Id: I0e22129a27765cacb7840a3c60b95b20c9d0d42d
2018-10-24 14:45:11 -07:00
Suren Baghdasaryan a7394ea37f lmkd: Add command to get number of kills
Intrduce LMK_GETKILLCNT command for ActivityManager to get the number of
kills from lmkd.

Bug: 117126077
Test: used lmkd_unit_test to verify correct reporting
Change-Id: I09c720a7176b4df95efc544177cd2694f8d791be
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2018-10-24 17:18:32 +00:00
Bill Yi eb2614e4a4 [automerger skipped] Merge pi-platform-release to stage-aosp-master - DO NOT MERGE am: 9b472034fe -s ours
am: 82a731feb5  -s ours

Change-Id: I57a7b510e1e45a41e8cb77537057198b026e861c
2018-10-24 09:59:59 -07:00
Bill Yi d3579c32ef [automerger skipped] Merge pi-platform-release to stage-aosp-master - DO NOT MERGE
am: 9b472034fe  -s ours

Change-Id: I425c3c5cc8d042ac822351d7a395922048eae0f8
2018-10-24 09:46:29 -07:00
Bill Yi 850ee989e4 Merge pi-platform-release to stage-aosp-master - DO NOT MERGE
Change-Id: Ibdbef72fcbee2eb6688f526e353f7244b93df734
2018-10-24 09:18:47 -07:00
Srinivas Paladugu b332c05f03 [automerger skipped] Merge "lmkd: increase the soft limit for keyboard" am: 618be4c225 am: a213c8931c
am: 6db669c598  -s ours

Change-Id: I10d89f1f691787dd4d97e64ef03681edf203e359
2018-10-16 13:45:19 -07:00
Srinivas Paladugu 66286cb747 Merge "lmkd: increase the soft limit for keyboard" am: 618be4c225
am: a213c8931c

Change-Id: Ie7abdb7dcd106b31ff3b59998cf4d3636ae25411
2018-10-16 13:38:12 -07:00
Srinivas Paladugu bab828217f Merge "lmkd: increase the soft limit for keyboard"
am: 618be4c225

Change-Id: Ia475bcd0feaaeaf0ea9cb2a8af9bc12e020532fd
2018-10-16 13:31:00 -07:00
Srinivas Paladugu a453f0b9ee lmkd: increase the soft limit for keyboard
lmkd sets the soft limit parameters for Go devices.
The limit for apps in the perceptible group is set to 16M.
However this limit is not sufficient for the keyboard app to
prevent pages from being re-claimed quickly. The mem usage of
the keyboard app is around 55M most cases with some occasional
spikes to 70-80M. Increasing the limit to 64M improves the warm
startup latency for keyboard. It is still lower than the limits
set for foreground and visible apps.

Test: Go device (1G)
Bug: 117517805
Merged-In: Id50e49327cfd76126e41ef6503971845f29196af
Change-Id: Id50e49327cfd76126e41ef6503971845f29196af
2018-10-16 18:58:01 +00:00
Suren Baghdasaryan aacf4181a3 Merge "lmkd: Implement pid purge command to clear old pids when zygote restarts" am: 79e5b550ce am: c95bfa5e9e
am: 1fadb0f68d

Change-Id: I2c30a4ad6f467ac71e83c07179c0cf0ac32eb8e5
2018-10-15 13:30:57 -07:00
Suren Baghdasaryan 22ec342a67 Merge "lmkd: Implement pid purge command to clear old pids when zygote restarts" am: 79e5b550ce
am: c95bfa5e9e

Change-Id: I55d31cc28dafdd24132e3234bc92e53028c4063b
2018-10-15 13:17:43 -07:00
Suren Baghdasaryan fee8b42c10 Merge "lmkd: Implement pid purge command to clear old pids when zygote restarts"
am: 79e5b550ce

Change-Id: I054cc48a4f9106f0a4e9f313bf997facac9c1b1e
2018-10-15 13:07:28 -07:00
Rajeev Kumar 83a87e94b7 [automerger skipped] Merge "Read memory stats from /proc/pid/stat file." into pi-dev am: e77572d76d -s ours
am: e7d884bb50  -s ours

Change-Id: Ic2113ac9355cb645c01310a3a6a4a7e144a53992
2018-10-15 12:49:02 -07:00
Rajeev Kumar 742a2ed4f0 [automerger skipped] Merge "Read memory stats from /proc/pid/stat file." into pi-dev
am: e77572d76d  -s ours

Change-Id: I1a594da0c5eda810d641e33809fae5c695606d68
2018-10-15 12:42:52 -07:00
TreeHugger Robot cc7862d9b7 Merge "Read memory stats from /proc/pid/stat file." into pi-dev 2018-10-15 19:24:44 +00:00
Suren Baghdasaryan 83df0088a3 lmkd: Implement pid purge command to clear old pids when zygote restarts
lmkd keeps a list of pids registered by ActivityManager, however on rare
occasions when framework restarts and lmkd survives that list has to be
purged. Implement a command that can be used to clear the pid list.

Bug: 116801366
Test: locally by killing zygote process
Change-Id: I71d6012f86bb83a73edd5b687e05a0848e0569b1
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2018-10-15 16:22:17 +00:00
Suren Baghdasaryan f405453c44 lmkd: Implement pid purge command to clear old pids when zygote restarts am: c89be17730
am: e6fcbe0719

Change-Id: I560e7076a24f4122a7a0c73890234ba9d8c05389
2018-10-12 16:48:13 -07:00
Suren Baghdasaryan a6573c818c lmkd: Implement pid purge command to clear old pids when zygote restarts
am: c89be17730

Change-Id: I11ebb0c22eedeaebd1c8f55ad5bec17abb82ba82
2018-10-12 16:43:03 -07:00
Suren Baghdasaryan 19e96c9c8f Merge "lmkd: Fix an invalid access to a pointer after it's freed" am: 1f149d8d2a am: 8950a02d10
am: 3503445f7f

Change-Id: Ia6fe0dcf6814e29be1faba15f1c0a5ae67a59a34
2018-10-12 14:52:33 -07:00
Suren Baghdasaryan 3134deab6b Merge "lmkd: Fix an invalid access to a pointer after it's freed" am: 1f149d8d2a
am: 8950a02d10

Change-Id: I87ec58231106933ef3cdcec50110c307bd2b3b83
2018-10-12 14:44:40 -07:00
Suren Baghdasaryan fd42ffb457 Merge "lmkd: Fix an invalid access to a pointer after it's freed"
am: 1f149d8d2a

Change-Id: I3bd979baf13d574b0f3f6eef1236512d9342640e
2018-10-12 14:39:28 -07:00
Rajeev Kumar d128423ee4 Read memory stats from /proc/pid/stat file.
(cherry pick from commit 0301683e49ab255769b15469487feaab3466167a)
Bug: 117333340
Test: Manual testing using alloc-stress tool
Change-Id: Ie555933aafa6a6b7aa1dbf5518ebe804376e0afd
Merged-In: Ie555933aafa6a6b7aa1dbf5518ebe804376e0afd
2018-10-12 21:28:50 +00:00
Srinivas Paladugu 4f3def3776 Merge "lmkd: increase the soft limit for keyboard" 2018-10-12 19:08:28 +00:00
Suren Baghdasaryan 8b00c6d79a lmkd: Fix an invalid access to a pointer after it's freed
pid_remove() frees a structure representing registered process and the
pointer can't be used anymore. This change fixes an instance when pointer
was used after it was freed. pid_remove() is moved to the end of the
function and comments are added to prevent similar situation in the future.

Bug: 117625315

Change-Id: I6a922952a31232497b3f9caf87d5a21bd402db94
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2018-10-12 11:28:33 -07:00
Rajeev Kumar 91ed713fc5 [automerger skipped] Merge "Read memory stats from /proc/pid/stat file." into stage-aosp-master am: ab0cfea162 -s ours
am: d3bb07c799  -s ours

Change-Id: I626fee42fab6060b9036ae815889b6fad38a708e
2018-10-12 11:02:33 -07:00
Rajeev Kumar 2cbeb781f6 [automerger skipped] Merge "Read memory stats from /proc/pid/stat file." into stage-aosp-master
am: ab0cfea162  -s ours

Change-Id: I08e70c57079b586c34317f262f8a02d3bc9876f7
2018-10-12 10:58:43 -07:00
Srinivas Paladugu 2770ab17b3 lmkd: increase the soft limit for keyboard
lmkd sets the soft limit parameters for Go devices.
The limit for apps in the perceptible group is set to 16M.
However this limit is not sufficient for the keyboard app to
prevent pages from being re-claimed quickly. The mem usage of
the keyboard app is around 55M most cases with some occasional
spikes to 70-80M. Increasing the limit to 64M improves the warm
startup latency for keyboard. It is still lower than the limits
set for foreground and visible apps.

Test: Go device (1G)
Bug: 117517805
Change-Id: Id50e49327cfd76126e41ef6503971845f29196af
2018-10-11 13:53:40 -07:00
Rajeev Kumar 2b07944e79 Read memory stats from /proc/pid/stat file.
(cherry pick from commit 0301683e49ab255769b15469487feaab3466167a)
Bug: 117333340
Test: Manual testing using alloc-stress tool
Merged-In: Ie555933aafa6a6b7aa1dbf5518ebe804376e0afd
Change-Id: Ie555933aafa6a6b7aa1dbf5518ebe804376e0afd
2018-10-10 18:20:10 -07:00
Rajeev Kumar 5c0163adea [automerger skipped] Merge "Read memory stats from /proc/pid/stat file." am: d936e628a3 -s ours am: e10165769e
am: ecc05e6e54  -s ours

Change-Id: Ie3f81c1fa27a92175ec6f8744e26003f90aa335e
2018-10-10 18:13:15 -07:00
Rajeev Kumar f46ba8edf1 [automerger skipped] Merge "Read memory stats from /proc/pid/stat file." am: d936e628a3 -s ours
am: e10165769e

Change-Id: Ie08d729a9944e72f0392f4b626e29cff31166b53
2018-10-10 18:03:58 -07:00
Rajeev Kumar 6a4ee28b85 [automerger skipped] Merge "Read memory stats from /proc/pid/stat file."
am: d936e628a3  -s ours

Change-Id: Ifcc16f31ad7dc9b9a6f7071dbbb5741fc96c064d
2018-10-10 17:50:52 -07:00
Rajeev Kumar 2534d2e54d Read memory stats from /proc/pid/stat file.
(cherry pick from commit 0301683e49ab255769b15469487feaab3466167a)
Bug: 117333340
Test: Manual testing using alloc-stress tool
Merged-In: Ie555933aafa6a6b7aa1dbf5518ebe804376e0afd
Change-Id: Ie555933aafa6a6b7aa1dbf5518ebe804376e0afd
2018-10-10 22:23:25 +00:00
Suren Baghdasaryan 08df7871d3 lmkd: Implement pid purge command to clear old pids when zygote restarts
lmkd keeps a list of pids registered by ActivityManager, however on rare
occasions when framework restarts and lmkd survives that list has to be
purged. Implement a command that can be used to clear the pid list.

Bug: 116801366
Test: locally by killing zygote process
Change-Id: I71d6012f86bb83a73edd5b687e05a0848e0569b1
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2018-10-10 22:11:23 +00:00
Rajeev Kumar b9ee75e58d Read memory stats from /proc/pid/stat file.
Bug: 117333340
Test: Manual testing using alloc-stress tool
Change-Id: Ie555933aafa6a6b7aa1dbf5518ebe804376e0afd
2018-10-10 12:42:12 -07:00
Suren Baghdasaryan 9bce389557 [automerger skipped] lmkd: rate-limit and cleanup failed kill reports am: d6cbf3f41d -s ours
am: e603f04e6b  -s ours

Change-Id: Ia701df3276517f59d1c91ffee2d9b55f4448f9f9
2018-09-12 16:34:27 -07:00
Suren Baghdasaryan 0421ee6865 [automerger skipped] lmkd: rate-limit and cleanup failed kill reports
am: d6cbf3f41d  -s ours

Change-Id: Ic59dd4599ce3d9aaf3715aa40a58e9088e68c4ad
2018-09-12 15:41:44 -07:00
Suren Baghdasaryan 16e959bc67 lmkd: rate-limit and cleanup failed kill reports
Excessive number of failed kill reports when lmkd can't find an eligible
process to kill or frees not enough memory pollutes logs and bugreports.
Cleanup kill reports to remove duplicate information and rate limit failed
kill attempts at 1 report per sec. The number of suppressed failed kills
will be reported in the next lmkd report.

Bug: 113864581
Test: Verified using lmkd_unit_test
Change-Id: I67fa1fec97613f136c7582115edcbc56b1503c9c
Merged-In: I67fa1fec97613f136c7582115edcbc56b1503c9c
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2018-09-07 18:27:17 -07:00
Suren Baghdasaryan d60ccbaa3a Merge "lmkd: rate-limit and cleanup failed kill reports" am: 83193c6c78 am: b6d606d06a
am: 18d0260406

Change-Id: Ieb8d80612d9cb74afd6f1dc4207e560e07c8d848
2018-09-06 13:25:31 -07:00
Suren Baghdasaryan ba497f0324 Merge "lmkd: rate-limit and cleanup failed kill reports"
am: 83193c6c78

Change-Id: I087c782727e8c83afe606e0c23b42aa2e048e11b
2018-09-06 12:33:33 -07:00
Suren Baghdasaryan 61750b2ecc Merge "lmkd: Introduce system property to get minfree and oom_adj levels" am: ca2d03ebdb am: 4ca5f5be67
am: 4121aea7ac

Change-Id: I31a515121b68b6f7f74a96aac9bf80c205cad989
2018-09-05 21:22:47 -07:00
Suren Baghdasaryan 53be36e6d8 lmkd: rate-limit and cleanup failed kill reports
Excessive number of failed kill reports when lmkd can't find an eligible
process to kill or frees not enough memory pollutes logs and bugreports.
Cleanup kill reports to remove duplicate information and rate limit failed
kill attempts at 1 report per sec. The number of suppressed failed kills
will be reported in the next lmkd report.

Bug: 113864581
Test: Verified using lmkd_unit_test
Change-Id: I67fa1fec97613f136c7582115edcbc56b1503c9c
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2018-09-06 01:59:49 +00:00
Suren Baghdasaryan 3e81b52bb8 Merge "lmkd: Introduce system property to get minfree and oom_adj levels"
am: ca2d03ebdb

Change-Id: I8cfbfb8ec49336820692d04af6efc8adae23820d
2018-09-05 17:08:24 -07:00
Suren Baghdasaryan 1ed0db1a19 lmkd: Introduce system property to get minfree and oom_adj levels
Introduce sys.lmk.minfree_levels system property to allow minfree level
reporting. The format for this property is:

<minfree 1>:<oom_adj 1>, <minfree 2>:<oom_adj 2>, ...

Max number of minfree levels is 6 and they are specified in the
increasing order. For example:

sys.lmk.minfree_levels=18432:0,23040:100,27648:200,32256:300,55296:900,80640:906

sys.lmk.minfree_levels updates are ratelimited to once per second in order
to prevent DoS attacks.

Bug: 111521182
Test: getprop sys.lmk.minfree_levels returns expected value
Change-Id: I80d75d6836650b12457d6a99ca88898535837a97
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2018-09-05 10:54:22 -07:00