Commit Graph

715 Commits

Author SHA1 Message Date
Martin Liu 0b55174ae7 lmkd: Add a margin for watermark when swap free is low am: 95551f816a
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/memory/lmkd/+/12361021

Change-Id: I241e3dd3ffafded55f303e91b61ed0c6edadc272
2020-08-14 14:14:26 +00:00
Martin Liu 95551f816a lmkd: Add a margin for watermark when swap free is low
When swap is depleted file cache thrashing might result in allocations
quickly pushing memory below low watermark and kswapd quickly pushing
it back above high watermark. In this situation free memory stays above
high watermark most of the time and lmkd during its periodic wake-ups
has low chance of detecting low memory conditions. Add a 15% margin
for high watermark which would allow lmkd to kill if swap is low,some
memory was reclaimed since the last wakeup and free memory is just
above the high watermark limit.

Bug: 163134367
Test: heavy loading launch
Signed-off-by: Martin Liu <liumartin@google.com>
Change-Id: I5694736b04bafcd13c01f4b51e242e2ac4ff55a8
2020-08-14 04:29:48 +00:00
Ioannis Ilkos d6bf19a8b2 Emit swap size in the killed process' statsd atoms am: 279268a07f am: 30240af1f0 am: 4018f3e2d1 am: 6e31b19a94
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1398492

Change-Id: I02e5cba798f923e16462606ec0325e226ef52946
2020-08-13 09:05:02 +00:00
Ioannis Ilkos 6e31b19a94 Emit swap size in the killed process' statsd atoms am: 279268a07f am: 30240af1f0 am: 4018f3e2d1
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1398492

Change-Id: I48cb0b10ae6aa65abb7e1ba3ffdcbadb56f269ff
2020-08-13 08:48:40 +00:00
Ioannis Ilkos 4018f3e2d1 Emit swap size in the killed process' statsd atoms am: 279268a07f am: 30240af1f0
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1398492

Change-Id: I0d1856dc7b2b33437ee62a79e8dc49bec06368f1
2020-08-13 08:05:03 +00:00
Ioannis Ilkos 30240af1f0 Emit swap size in the killed process' statsd atoms am: 279268a07f
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1398492

Change-Id: I1a3e6a035e60cd15ff6723ffcdcdc6e01262ccc0
2020-08-13 07:51:07 +00:00
Ioannis Ilkos 279268a07f Emit swap size in the killed process' statsd atoms
Changes:
- We are already reading /proc/pid/status to resolve the tgid. While we
are at it, also parse RSS and swap values.
- Use the RSS and swap values for non memcg builds when creating the
statsd outputs
- Given we already read RSS, remove the separate read of /proc/pid/statm
that used to get tasksize.

Bug: 163116785
Test: manual, out/host/linux-x86/bin/statsd_testdrive 51
Change-Id: I9d98b9ffe8be0b014bb09174ec9532382cae1f38
2020-08-12 20:24:56 +01:00
Suren Baghdasaryan 280b96ad4a [automerger skipped] lmkd: Add lmkd wakeup information into killinfo logs am: fa667edb56 am: 2c509d9073 -s ours
am skip reason: Change-Id I0356c27515132ff0dd309b59a8bf907acbd67cd8 with SHA-1 fa667edb56 is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/memory/lmkd/+/12245884

Change-Id: I9a089a64efd480fa9db148552dc89ef6d14c70cd
2020-07-30 02:03:03 +00:00
Suren Baghdasaryan c063938c8d [automerger skipped] lmkd: Set default kill timeout to limit waits for uninterruptible processes am: dd8c2c181b am: 504a7cafc5 -s ours
am skip reason: Change-Id Ia280dc095df9ca8494278e0a75b976ed93fc04ae with SHA-1 dd8c2c181b is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/memory/lmkd/+/12245883

Change-Id: I3cbc899106a37001e4e09c6b0223086a43c96e00
2020-07-30 02:03:02 +00:00
Suren Baghdasaryan 19d9d66dc5 [automerger skipped] lmkd: Add lmkd wakeup information into killinfo logs am: fa667edb56 -s ours am: 5ac19eb471 -s ours
am skip reason: Change-Id I0356c27515132ff0dd309b59a8bf907acbd67cd8 with SHA-1 d7b4fcb8a5 is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/memory/lmkd/+/12245884

Change-Id: Ic7c9677be9e1d64d1fa3eff622a8b7fc3d21baf2
2020-07-30 01:50:56 +00:00
Suren Baghdasaryan d457698550 [automerger skipped] lmkd: Set default kill timeout to limit waits for uninterruptible processes am: dd8c2c181b -s ours am: 4a04afd997 -s ours
am skip reason: Change-Id Ia280dc095df9ca8494278e0a75b976ed93fc04ae with SHA-1 7d1f4f0047 is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/memory/lmkd/+/12245883

Change-Id: Ie74c182c82187afebc3b5a83aea0b501a395826e
2020-07-30 01:50:54 +00:00
Suren Baghdasaryan 2c509d9073 lmkd: Add lmkd wakeup information into killinfo logs am: fa667edb56
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/memory/lmkd/+/12245884

Change-Id: I0e84d86642df4dc4097f01ab7f6f94ba441f3692
2020-07-30 01:43:30 +00:00
Suren Baghdasaryan 504a7cafc5 lmkd: Set default kill timeout to limit waits for uninterruptible processes am: dd8c2c181b
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/memory/lmkd/+/12245883

Change-Id: I65c4ef026b2118d09fd3d3cdd2ff5aab2bf66cd2
2020-07-30 01:43:29 +00:00
Suren Baghdasaryan 5ac19eb471 [automerger skipped] lmkd: Add lmkd wakeup information into killinfo logs am: fa667edb56 -s ours
am skip reason: Change-Id I0356c27515132ff0dd309b59a8bf907acbd67cd8 with SHA-1 d7b4fcb8a5 is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/memory/lmkd/+/12245884

Change-Id: I21557b59bcb67736b552b7f5fa3b37045851a4dd
2020-07-30 01:41:43 +00:00
Suren Baghdasaryan 4a04afd997 [automerger skipped] lmkd: Set default kill timeout to limit waits for uninterruptible processes am: dd8c2c181b -s ours
am skip reason: Change-Id Ia280dc095df9ca8494278e0a75b976ed93fc04ae with SHA-1 7d1f4f0047 is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/memory/lmkd/+/12245883

Change-Id: I72a2b3e18a4f8e29095150f9eeb7dd64c622281f
2020-07-30 01:41:40 +00:00
Suren Baghdasaryan fa667edb56 lmkd: Add lmkd wakeup information into killinfo logs
Oftentimes while investigating bugreports it's unclear whether lmkd
was active between kills. To provide visibility into lmkd activity
adding the following fields into killinfo reports:
MsSinceEvent - number of msecs since the last PSI/vmpressure event
MsSincePrevWakeup - number of msecs since the previous wakeup
WakeupsSinceEvent - number of wakeups since the last PSI/vmpressure
event
SkippedWakeups - number of wakeups that were skipped due to an
incomplete kill

Bug: 162034541
Bug: 161955028
Bug: 162297751
Test: lmkd_unit_test
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I0356c27515132ff0dd309b59a8bf907acbd67cd8
(cherry picked from commit d7b4fcb8a5)
Signed-off-by: Martin Liu <liumartin@google.com>
Merged-In: I0356c27515132ff0dd309b59a8bf907acbd67cd8
2020-07-30 01:33:27 +00:00
Suren Baghdasaryan dd8c2c181b lmkd: Set default kill timeout to limit waits for uninterruptible processes
When lmkd tries to kill a process in uninterruptible sleep state, it may
need to wait for a long time. To prevent this set the default kill timeout
to 100ms which should work for majority of the devices.

Bug: 160295034
Bug: 161955028
Bug: 162297751
Test: lmkd_unit_test
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: Ia280dc095df9ca8494278e0a75b976ed93fc04ae
(cherry picked from commit 7d1f4f0047)
Signed-off-by: Martin Liu <liumartin@google.com>
Merged-In: Ia280dc095df9ca8494278e0a75b976ed93fc04ae
2020-07-28 09:13:44 +00:00
Suren Baghdasaryan c2cd36c35c lmkd: Add lmkd wakeup information into killinfo logs am: d7b4fcb8a5 am: 403c7fd536 am: 48f7d0e49f am: c7c600c768
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1371804

Change-Id: Ic747bddb3936cf3f6e58705ea65b238d92402cc6
2020-07-26 18:19:48 +00:00
Suren Baghdasaryan c7c600c768 lmkd: Add lmkd wakeup information into killinfo logs am: d7b4fcb8a5 am: 403c7fd536 am: 48f7d0e49f
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1371804

Change-Id: Ied2bb909d79ae865982795db181824a85bcf887c
2020-07-26 18:06:59 +00:00
Suren Baghdasaryan 48f7d0e49f lmkd: Add lmkd wakeup information into killinfo logs am: d7b4fcb8a5 am: 403c7fd536
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1371804

Change-Id: Ifcca19bbbb6c5d69f44edf20d34af824e9879060
2020-07-26 17:47:07 +00:00
Suren Baghdasaryan 403c7fd536 lmkd: Add lmkd wakeup information into killinfo logs am: d7b4fcb8a5
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1371804

Change-Id: I99560d361860d3c4d1e83f7b8ac219d57824f817
2020-07-26 17:32:08 +00:00
Suren Baghdasaryan d7b4fcb8a5 lmkd: Add lmkd wakeup information into killinfo logs
Oftentimes while investigating bugreports it's unclear whether lmkd
was active between kills. To provide visibility into lmkd activity
adding the following fields into killinfo reports:
MsSinceEvent - number of msecs since the last PSI/vmpressure event
MsSincePrevWakeup - number of msecs since the previous wakeup
WakeupsSinceEvent - number of wakeups since the last PSI/vmpressure
event
SkippedWakeups - number of wakeups that were skipped due to an
incomplete kill

Bug: 162034541
Test: lmkd_unit_test
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I0356c27515132ff0dd309b59a8bf907acbd67cd8
2020-07-24 19:31:03 +00:00
Suren Baghdasaryan 6740aa67df lmkd: Set default kill timeout to limit waits for uninterruptible processes am: 7d1f4f0047 am: 93060362b5 am: 0b8b47057e am: ec0f9218de
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1358623

Change-Id: I790ab7f8d7a6a12310cc80b390ce4fe1f8af1efc
2020-07-11 03:41:10 +00:00
Suren Baghdasaryan ec0f9218de lmkd: Set default kill timeout to limit waits for uninterruptible processes am: 7d1f4f0047 am: 93060362b5 am: 0b8b47057e
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1358623

Change-Id: Ic644942e90748588e194ff05adf2d3f75397444e
2020-07-11 03:30:30 +00:00
Suren Baghdasaryan 0b8b47057e lmkd: Set default kill timeout to limit waits for uninterruptible processes am: 7d1f4f0047 am: 93060362b5
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1358623

Change-Id: I06968623ad7ea99ee61c001e367d3892249ed3a6
2020-07-11 03:18:24 +00:00
Suren Baghdasaryan 93060362b5 lmkd: Set default kill timeout to limit waits for uninterruptible processes am: 7d1f4f0047
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1358623

Change-Id: Iffcb4cbd88d44df216fce44c37ecace082df7d69
2020-07-11 03:07:04 +00:00
Suren Baghdasaryan 7d1f4f0047 lmkd: Set default kill timeout to limit waits for uninterruptible processes
When lmkd tries to kill a process in uninterruptible sleep state, it may
need to wait for a long time. To prevent this set the default kill timeout
to 100ms which should work for majority of the devices.

Bug: 160295034
Test: lmkd_unit_test
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: Ia280dc095df9ca8494278e0a75b976ed93fc04ae
2020-07-08 11:41:14 -07:00
Martin Liu bda126b5f8 [automerger skipped] lmkd: Fix do not kill perceptible apps due to low swap if above min wmark am: dfc73bc2fe -s ours am: 08d786c5bd -s ours am: a8465ae999 -s ours
am skip reason: Change-Id Ifc09c2a1fe7e21faa096988f471644f63951d81c with SHA-1 dfc73bc2fe is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/memory/lmkd/+/11699841

Change-Id: I095cd94b20056722e6ca315e0808da046bdf655c
2020-06-02 21:24:13 +00:00
Martin Liu 27300cc414 [automerger skipped] lmkd: Fix do not kill perceptible apps due to low swap if above min wmark am: dfc73bc2fe am: 62f4f4262e -s ours am: f9db70b71b -s ours
am skip reason: Change-Id Ifc09c2a1fe7e21faa096988f471644f63951d81c with SHA-1 dfc73bc2fe is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/memory/lmkd/+/11699841

Change-Id: Ib9274ae6500e8d51cc3d29c561080bae1b1ac6df
2020-06-02 21:23:44 +00:00
Martin Liu ff1290ee03 [automerger skipped] lmkd: Fix do not kill perceptible apps due to low swap if above min wmark am: dfc73bc2fe am: 62f4f4262e am: 8087e1104c -s ours
am skip reason: Change-Id Ifc09c2a1fe7e21faa096988f471644f63951d81c with SHA-1 3185c2d096 is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/memory/lmkd/+/11699841

Change-Id: Iea4f1212460c052817dbfdeba770fc2d60dd3c7a
2020-06-02 21:23:15 +00:00
Martin Liu a8465ae999 [automerger skipped] lmkd: Fix do not kill perceptible apps due to low swap if above min wmark am: dfc73bc2fe -s ours am: 08d786c5bd -s ours
am skip reason: Change-Id Ifc09c2a1fe7e21faa096988f471644f63951d81c with SHA-1 dfc73bc2fe is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/memory/lmkd/+/11699841

Change-Id: I01c65d9d30e12efd461b7dba263dc4194924c611
2020-06-02 21:12:09 +00:00
Martin Liu f9db70b71b [automerger skipped] lmkd: Fix do not kill perceptible apps due to low swap if above min wmark am: dfc73bc2fe am: 62f4f4262e -s ours
am skip reason: Change-Id Ifc09c2a1fe7e21faa096988f471644f63951d81c with SHA-1 3185c2d096 is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/memory/lmkd/+/11699841

Change-Id: Ib5b7c1a7267883095bba6f2f5dae064037b4f962
2020-06-02 21:11:19 +00:00
Martin Liu 8087e1104c lmkd: Fix do not kill perceptible apps due to low swap if above min wmark am: dfc73bc2fe am: 62f4f4262e
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/memory/lmkd/+/11699841

Change-Id: I3213442a2628581dedb0ccf753c70643d55acce0
2020-06-02 21:11:17 +00:00
Martin Liu 08d786c5bd [automerger skipped] lmkd: Fix do not kill perceptible apps due to low swap if above min wmark am: dfc73bc2fe -s ours
am skip reason: Change-Id Ifc09c2a1fe7e21faa096988f471644f63951d81c with SHA-1 3185c2d096 is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/memory/lmkd/+/11699841

Change-Id: Ied978dbd309a8876ed7a090120927b6818a70b80
2020-06-02 20:55:41 +00:00
Martin Liu 62f4f4262e lmkd: Fix do not kill perceptible apps due to low swap if above min wmark am: dfc73bc2fe
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/memory/lmkd/+/11699841

Change-Id: Iee2254c3047d939a82bbaf7de9e350ea1df4ea20
2020-06-02 20:55:29 +00:00
Martin Liu 57974b3394 lmkd: Fix do not kill perceptible apps due to low swap if above min wmark am: 3185c2d096 am: ff6ad5cd06 am: 3a2aeaba0e am: 6f4f82ffef
Original change: undetermined

Change-Id: I50f3861733a5e0386c460eac46f8c20ca653d35d
2020-06-02 18:06:32 +00:00
Martin Liu 6f4f82ffef lmkd: Fix do not kill perceptible apps due to low swap if above min wmark am: 3185c2d096 am: ff6ad5cd06 am: 3a2aeaba0e
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1321895

Change-Id: I7349628a326f0f8e6672462e604c0bf3e81c496c
2020-06-02 17:52:48 +00:00
Martin Liu 3a2aeaba0e lmkd: Fix do not kill perceptible apps due to low swap if above min wmark am: 3185c2d096 am: ff6ad5cd06
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1321895

Change-Id: I1533fc059bb1683e5bf9441a7b30e5e24e6f1f83
2020-06-02 17:27:00 +00:00
Martin Liu ff6ad5cd06 lmkd: Fix do not kill perceptible apps due to low swap if above min wmark am: 3185c2d096
Original change: undetermined

Change-Id: I1cb82bf5ff5da1dd29876354a54b2dd963088b37
2020-06-02 17:09:23 +00:00
Martin Liu dfc73bc2fe lmkd: Fix do not kill perceptible apps due to low swap if above min wmark
Fix code logic to obey our intetion of not killing perceptible apps
due to low swap if above min wmark.

Bug: 155709603
Test: boot
Signed-off-by: Martin Liu <liumartin@google.com>
Merged-In: Ifc09c2a1fe7e21faa096988f471644f63951d81c
Change-Id: Ifc09c2a1fe7e21faa096988f471644f63951d81c
2020-06-02 23:47:01 +08:00
Martin Liu 3185c2d096 lmkd: Fix do not kill perceptible apps due to low swap if above min wmark
Fix code logic to obey our intetion of not killing perceptible apps
due to low swap if above min wmark.

Bug: 155709603
Test: boot
Signed-off-by: Martin Liu <liumartin@google.com>
Merged-In: Ifc09c2a1fe7e21faa096988f471644f63951d81c
Change-Id: Ifc09c2a1fe7e21faa096988f471644f63951d81c
2020-06-02 23:43:49 +08:00
Automerger Merge Worker 49260e5a62 Merge "[automerger skipped] lmkd: Do not kill perceptible apps due to low swap if above min wmark am: 7afa463978 -s ours am: 5b4b3716e4 -s ours" into rvc-d1-dev-plus-aosp am: 3e6ee0722c -s ours
am skip reason: Change-Id I6beb4b55f8b4f7bc22818b5a7bdfa3adc6cd31c1 with SHA-1 7afa463978 is in history

Change-Id: Ic3a7b5b625680827593e81ff0971141f697f42a1
2020-05-21 00:46:28 +00:00
Automerger Merge Worker f2ed66473c Merge "[automerger skipped] lmkd: Do not kill perceptible apps due to low swap if above min wmark am: 7afa463978 am: 747c846a5a am: 0a55215fbe -s ours" into rvc-qpr-dev-plus-aosp 2020-05-21 00:46:14 +00:00
Suren Baghdasaryan 008e891d43 [automerger skipped] lmkd: Do not kill perceptible apps due to low swap if above min wmark am: 7afa463978 am: 747c846a5a am: 0a55215fbe -s ours
am skip reason: Change-Id I6beb4b55f8b4f7bc22818b5a7bdfa3adc6cd31c1 with SHA-1 48135c4cba is in history

Change-Id: I4dfc6fb05c99c903dbf0a303e6c146289f9530b9
2020-05-21 00:46:06 +00:00
Suren Baghdasaryan 7ebdd10ae6 [automerger skipped] lmkd: Do not kill perceptible apps due to low swap if above min wmark am: 7afa463978 am: 747c846a5a -s ours am: 4afbef0f6c -s ours
am skip reason: Change-Id I6beb4b55f8b4f7bc22818b5a7bdfa3adc6cd31c1 with SHA-1 48135c4cba is in history

Change-Id: Ibee74a42a7d9b5be5f288ba627f0914b21afe420
2020-05-21 00:46:03 +00:00
Automerger Merge Worker 3e6ee0722c Merge "[automerger skipped] lmkd: Do not kill perceptible apps due to low swap if above min wmark am: 7afa463978 -s ours am: 5b4b3716e4 -s ours" into rvc-d1-dev-plus-aosp 2020-05-21 00:36:14 +00:00
Suren Baghdasaryan c08f3f09b7 [automerger skipped] lmkd: Do not kill perceptible apps due to low swap if above min wmark am: 7afa463978 -s ours am: 5b4b3716e4 -s ours
am skip reason: Change-Id I6beb4b55f8b4f7bc22818b5a7bdfa3adc6cd31c1 with SHA-1 48135c4cba is in history

Change-Id: I991c035d1cf12e59b5975450b399a85d0af239ab
2020-05-21 00:36:10 +00:00
Suren Baghdasaryan 4afbef0f6c [automerger skipped] lmkd: Do not kill perceptible apps due to low swap if above min wmark am: 7afa463978 am: 747c846a5a -s ours
am skip reason: Change-Id I6beb4b55f8b4f7bc22818b5a7bdfa3adc6cd31c1 with SHA-1 48135c4cba is in history

Change-Id: I742875df19599c98274531e9d986f3a827529da5
2020-05-21 00:36:08 +00:00
Suren Baghdasaryan 0a55215fbe lmkd: Do not kill perceptible apps due to low swap if above min wmark am: 7afa463978 am: 747c846a5a
Change-Id: I546012e24b96df68eb303e3c940d2b8fc596c62b
2020-05-21 00:35:46 +00:00
Suren Baghdasaryan 747c846a5a lmkd: Do not kill perceptible apps due to low swap if above min wmark am: 7afa463978
Change-Id: Ib75f23cdd2fc21a32c8e2f6c303ad59ca531b026
2020-05-21 00:09:51 +00:00