Commit Graph

8 Commits

Author SHA1 Message Date
Carlos Galo 81a7c21087 lmkd: Introduce kill strategy based on direct reclaim length
Add kill reason for when the device is stuck in direct reclaim for
longer than the configurable threshold. Only allow configurable
threshold, and direct reclaim stuck detection, if memevents direct
reclaim monitoring is enabled.

Test: Verified direct reclaim stuck kill log with memory pressure test
Test: m
Bug: 244232958
Change-Id: I1156899874d2eb7e0f4b61597741087c110b3414
Signed-off-by: Carlos Galo <carlosgalo@google.com>
2024-03-22 16:21:30 -07:00
Matt Stephenson 18578a55d0 add min score option to PRESSURE_AFTER_KILL
Adjust lmk cycle after kill to honor an optional min score.

Test: cycle after kill under mem pressure honors specified score
Bug: 309380316
Change-Id: I9ab8e29b58846cc291acb2834638ddf7a7759eca
Signed-off-by: Matt Stephenson <stephensonmatt@google.com>
2023-12-11 22:35:50 +00:00
Mateus Azis bb87e41b6f Improve code formatting for lmkd's README.
Before: https://android.googlesource.com/platform/system/memory/lmkd/+/refs/heads/master/README.md
After: https://android.googlesource.com/platform/system/memory/lmkd/+/refs/changes/56/2497556/2/README.md

Test: N/A
Change-Id: Id7fa7d0ffb66590525a978e3ee716ee567ea9fd6
2023-03-20 09:38:06 -07:00
Jing Ji 5c48096d8d lmkd: Support to send unsolicited message to clients
For now the only unsolicited message from lmkd is the process
kills on memory pressure.

Bug: 136036078
Test: atest ApplicationExitInfoTest

Change-Id: I503fd6a45ebab5276460b0ab978ebb2b8431dc0d
Signed-off-by: Jing Ji <jji@google.com>
2019-12-12 08:53:04 -08:00
Suren Baghdasaryan 2f88e15c3a lmkd: Enable new kill strategy, add and adjust required system properties
Enable new kill strategy when PSI mode is used in combination with
ro.lmk.use_minfree_levels=false. Adjust ro.lmk.swap_free_low_percentage,
introduce ro.lmk.psi_partial_stall_ms and ro.lmk.psi_complete_stall_ms
system properties to support two levels of PSI events measuring partial
and complete stalls. Add ro.lmk.use_new_strategy system property to switch
to the old strategy if necessary.

Bug: 132642304
Test: lmkd_unit_test, ACT memory pressure tests
Change-Id: I6f1b65e19dbe9b58c862e5e4255270c82f0afb9a
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-09-30 16:54:27 +00:00
Suren Baghdasaryan af2be4c55d lmkd: Introduce kill strategy based on zone watermarks, swap and thrashing
Add new kill strategy which makes kill decisions based on which zone
watermark is breached, how much free swap space is still available and
what percentage of the file-backed page cache has been refaulted. This mode
is designed to be used only with PSI signals. It kills unconditionally when
a critical pressure event is received, therefore PSI stall for that event
should be set to a value representing a truly non-responding system
(currently set to 700ms out of 1sec spent in complete stall). New event
handler also controls polling interval based on current memory conditions.

Bug: 132642304
Test: lmkd_unit_test, ACT memory pressure tests
Change-Id: Ia213ef2bb06b245d651ebf2d813e944b4ae7565f
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-09-30 16:54:05 +00:00
Suren Baghdasaryan 65f04901ec 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
Change-Id: I6b51972951026854a079fcda33d6786b7ed035e4
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2018-04-15 02:29:57 -07:00
Suren Baghdasaryan 14b4465450 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