Suren Baghdasaryan
aced711991
lmkd: Do not re-initialize lmkd when persistent properties are loaded
...
When a device boots, lmkd starts before persistent properties are loaded,
therefore if experiments set any flags, the corresponding persistent
properties will trigger change notifications when they are first loaded
during boot.
In order to prevent lmkd from re-initializing on every property load,
mark persistent property change by setting lmkd.reinit to 0 and delay
lmkd re-initialization until sys.boot_completed=1 when all properties
are set and only one re-initialization will capture them all. On devices
with no experiment flags being set lmkd.reinit will be undefined at the
boot completion time and re-initialization will not be triggered at all.
Bug: 194316048
Test: adb shell device_config put lmkd_native thrashing_limit_critical 350
Test: adb shell device_config put lmkd_native thrashing_limit 100
Test: adb reboot; adb -b all logcat | grep lmkd
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: Iba34fc719a18d58b890549c7415bec869d471901
Merged-In: Iba34fc719a18d58b890549c7415bec869d471901
2021-09-01 16:12:55 +00:00
Suren Baghdasaryan
b91ecaa3e8
lmkd: Add support for persist.device_config.lmkd_native.* properties
...
Allow persist.device_config.lmkd_native.* to override ro.lmk.*
properties to enable experiments with lmkd configuration properties.
Experiments will be able to set appropriate
persist.device_config.lmkd_native.<name> property which will issue
"lmkd --reinit" command to reinitialize lmkd with new parameters.
Bug: 194316048
Test: adb shell device_config put lmkd_native thrashing_limit_critical 350
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: Ia48fd51eab126d307a1604530b642e86cf250688
Merged-In: Ia48fd51eab126d307a1604530b642e86cf250688
2021-09-01 16:08:01 +00:00
Suren Baghdasaryan
0e64eadc21
lmkd: Do not re-initialize lmkd when persistent properties are loaded
...
When a device boots, lmkd starts before persistent properties are loaded,
therefore if experiments set any flags, the corresponding persistent
properties will trigger change notifications when they are first loaded
during boot.
In order to prevent lmkd from re-initializing on every property load,
mark persistent property change by setting lmkd.reinit to 0 and delay
lmkd re-initialization until sys.boot_completed=1 when all properties
are set and only one re-initialization will capture them all. On devices
with no experiment flags being set lmkd.reinit will be undefined at the
boot completion time and re-initialization will not be triggered at all.
Bug: 194316048
Test: adb shell device_config put lmkd_native thrashing_limit_critical 350
Test: adb shell device_config put lmkd_native thrashing_limit 100
Test: adb reboot; adb -b all logcat | grep lmkd
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: Iba34fc719a18d58b890549c7415bec869d471901
2021-09-01 00:56:35 -07:00
Suren Baghdasaryan
7a9a02a838
lmkd: Add support for persist.device_config.lmkd_native.* properties am: d0a800402c am: c51f018a6d am: 345fb264a4 am: deb55f8395 am: bb587fdfff
...
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1785437
Change-Id: I3720e7f4b467e15f86fc0a323df53e994b62a75d
2021-08-31 20:44:31 +00:00
Suren Baghdasaryan
bb587fdfff
lmkd: Add support for persist.device_config.lmkd_native.* properties am: d0a800402c am: c51f018a6d am: 345fb264a4 am: deb55f8395
...
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1785437
Change-Id: I276d1ebbd0b6b00cc439e3f9832e6382c3aae4e2
2021-08-31 20:24:45 +00:00
Suren Baghdasaryan
deb55f8395
lmkd: Add support for persist.device_config.lmkd_native.* properties am: d0a800402c am: c51f018a6d am: 345fb264a4
...
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1785437
Change-Id: Ib92c5fa0fb55359762419021c1de551b68ffdc55
2021-08-31 20:12:10 +00:00
Suren Baghdasaryan
345fb264a4
lmkd: Add support for persist.device_config.lmkd_native.* properties am: d0a800402c am: c51f018a6d
...
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1785437
Change-Id: I370b9988d5d94b56069c59656dd47e9f96c0546b
2021-08-31 20:03:28 +00:00
Suren Baghdasaryan
c51f018a6d
lmkd: Add support for persist.device_config.lmkd_native.* properties am: d0a800402c
...
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1785437
Change-Id: Ib77d4ce588ec31631e6721130ea0a163afe83bed
2021-08-31 19:52:44 +00:00
Suren Baghdasaryan
d0a800402c
lmkd: Add support for persist.device_config.lmkd_native.* properties
...
Allow persist.device_config.lmkd_native.* to override ro.lmk.*
properties to enable experiments with lmkd configuration properties.
Experiments will be able to set appropriate
persist.device_config.lmkd_native.<name> property which will issue
"lmkd --reinit" command to reinitialize lmkd with new parameters.
Bug: 194316048
Test: adb shell device_config put lmkd_native thrashing_limit_critical 350
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: Ia48fd51eab126d307a1604530b642e86cf250688
2021-08-31 09:20:46 -07:00
Xin Li
f9eb6a6d61
[automerger skipped] Mark sc-dev-plus-aosp-without-vendor@7634622 as merged am: 597d5d2b61 -s ours am: 18ecbf78ce -s ours am: 6ef245e3f1 -s ours am: f382dcde47 -s ours
...
am skip reason: Merged-In I905d1733efec72c8e2745cff51cec0547ea57fea with SHA-1 e4689257db is already in history
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/memory/lmkd/+/15567898
Change-Id: Ia668e856d72cdef5156f0626dc3c385062c0ae22
2021-08-14 07:18:20 +00:00
Xin Li
f382dcde47
[automerger skipped] Mark sc-dev-plus-aosp-without-vendor@7634622 as merged am: 597d5d2b61 -s ours am: 18ecbf78ce -s ours am: 6ef245e3f1 -s ours
...
am skip reason: Merged-In I905d1733efec72c8e2745cff51cec0547ea57fea with SHA-1 e4689257db is already in history
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/memory/lmkd/+/15567898
Change-Id: I8ef72961d52f0021d99fd82b979b0c4751c3ccc4
2021-08-14 06:57:10 +00:00
Xin Li
6ef245e3f1
[automerger skipped] Mark sc-dev-plus-aosp-without-vendor@7634622 as merged am: 597d5d2b61 -s ours am: 18ecbf78ce -s ours
...
am skip reason: Merged-In I905d1733efec72c8e2745cff51cec0547ea57fea with SHA-1 e4689257db is already in history
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/memory/lmkd/+/15567898
Change-Id: Id107b539c97dad962d78aaecb833474975a74f4e
2021-08-14 06:42:20 +00:00
Xin Li
18ecbf78ce
[automerger skipped] Mark sc-dev-plus-aosp-without-vendor@7634622 as merged am: 597d5d2b61 -s ours
...
am skip reason: Merged-In I905d1733efec72c8e2745cff51cec0547ea57fea with SHA-1 e4689257db is already in history
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/memory/lmkd/+/15567898
Change-Id: I59ff94ac3052c99c55017f8e2421d3424d8b5862
2021-08-14 06:29:57 +00:00
Xin Li
597d5d2b61
Mark sc-dev-plus-aosp-without-vendor@7634622 as merged
...
Merged-In: I905d1733efec72c8e2745cff51cec0547ea57fea
Change-Id: If3648949cabbd47830dabc09b8c293d3c2ee274b
2021-08-14 06:04:15 +00:00
Suren Baghdasaryan
3991bfc445
lmkd: Add thrashing and max_thrashing into killinfo reports am: 39b54809fb am: 145613c986 am: 31b3e7a5aa am: 93704f46a8 am: bae82dbe32
...
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1790959
Change-Id: Ie1186acebfec3d00d4b0c9059c1a81a82044811a
2021-08-12 03:29:55 +00:00
Suren Baghdasaryan
bae82dbe32
lmkd: Add thrashing and max_thrashing into killinfo reports am: 39b54809fb am: 145613c986 am: 31b3e7a5aa am: 93704f46a8
...
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1790959
Change-Id: I4c5f923e07301ebd6ae446542e6ae0ca054aa87c
2021-08-12 03:16:15 +00:00
Suren Baghdasaryan
93704f46a8
lmkd: Add thrashing and max_thrashing into killinfo reports am: 39b54809fb am: 145613c986 am: 31b3e7a5aa
...
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1790959
Change-Id: Ifebe0b2dd132eb629a3cf7f5f0cf691a27df58db
2021-08-12 02:40:56 +00:00
Suren Baghdasaryan
31b3e7a5aa
lmkd: Add thrashing and max_thrashing into killinfo reports am: 39b54809fb am: 145613c986
...
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1790959
Change-Id: I76aec795719c4eec2eff0bb0b4b7c4f9a1d1e650
2021-08-12 02:26:14 +00:00
Suren Baghdasaryan
145613c986
lmkd: Add thrashing and max_thrashing into killinfo reports am: 39b54809fb
...
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1790959
Change-Id: Ia780dc3b3b96fdcbd48cb72dff62cf52d33c7a0d
2021-08-12 02:10:36 +00:00
Suren Baghdasaryan
39b54809fb
lmkd: Add thrashing and max_thrashing into killinfo reports
...
Due to the increased importance of thrashing limits, include current and
max thrashing levels into killinfo reports.
Bug: 195979894
Test: lmkd_unit_test
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I36f947e45e03a4d845d18881e137e4b242aacb65
2021-08-09 15:10:46 -07:00
George Burgess IV
4009e8ed09
lmkd: fix potential NULL pointer dereference am: e849f1414e am: 047e6e30e7 am: e4689257db am: 29fdb80cf1
...
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1787727
Change-Id: Iefa8b5b2277c3fa9996a394c528eec99080ba036
2021-08-05 18:08:41 +00:00
George Burgess IV
29fdb80cf1
lmkd: fix potential NULL pointer dereference am: e849f1414e am: 047e6e30e7 am: e4689257db
...
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1787727
Change-Id: I6e059ac33f76da60ff49fafcb81836c89b83c1a4
2021-08-05 18:00:26 +00:00
George Burgess IV
e4689257db
lmkd: fix potential NULL pointer dereference am: e849f1414e am: 047e6e30e7
...
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1787727
Change-Id: I905d1733efec72c8e2745cff51cec0547ea57fea
2021-08-05 17:51:22 +00:00
George Burgess IV
047e6e30e7
lmkd: fix potential NULL pointer dereference am: e849f1414e
...
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1787727
Change-Id: I1b048df607f8503bcc93d68c44b061dfd148a2d2
2021-08-05 17:33:24 +00:00
George Burgess IV
e849f1414e
lmkd: fix potential NULL pointer dereference
...
`ki` appears to be potentially NULL. Output bogus values if it is.
Caught by the static analyzer:
> system/memory/lmkd/lmkd.cpp:2171:66: warning: Access to field
'kill_reason' results in a dereference of a null pointer (loaded from
variable 'ki') [clang-analyzer-core.NullDereference]
Bug: None
Test: TreeHugger
Change-Id: Iae26855528e1f7fec8f1455e06c7e813a732dc75
2021-08-05 06:59:42 +00:00
Suren Baghdasaryan
ca2e036052
lmkd: Add a tracepoint for each kill with kill parameters am: 34928bb817 am: a2394fb247 am: dc2e03adf9 am: 0a4989190e
...
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1782391
Change-Id: I7a4b1b28fadabf952558aa8c3063ec78068b8ba4
2021-08-03 16:49:13 +00:00
Suren Baghdasaryan
0a4989190e
lmkd: Add a tracepoint for each kill with kill parameters am: 34928bb817 am: a2394fb247 am: dc2e03adf9
...
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1782391
Change-Id: Ifc0f708f92163cd49657a7a4fce3dd918c4e19bf
2021-08-03 16:34:55 +00:00
Suren Baghdasaryan
dc2e03adf9
lmkd: Add a tracepoint for each kill with kill parameters am: 34928bb817 am: a2394fb247
...
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1782391
Change-Id: I80cdfcc2f323b16ea9f3518ac2b317be6c7b3f2a
2021-08-03 16:19:23 +00:00
Suren Baghdasaryan
a2394fb247
lmkd: Add a tracepoint for each kill with kill parameters am: 34928bb817
...
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1782391
Change-Id: I805fa72d4784775bfc9c148a957417654a26d3c8
2021-08-03 16:04:54 +00:00
Suren Baghdasaryan
34928bb817
lmkd: Add a tracepoint for each kill with kill parameters
...
Add a trace for each kill that includes pid, kill reason, oom_adj_score,
min_oom_score and max_thrashing statistics at the time of the kill.
Bug: 195085238
Test: generate kills while tracing and observer the new tracepoints
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: Ic2014adc08f5e5dd4aacd415970332618bd15250
2021-07-30 12:59:15 -07:00
Suren Baghdasaryan
176a05294e
lmkd: Add current and max thrashing levels in LMK_MEMORY_STATS reports am: 81bb801dd2 am: 78e7e0d352 am: f926a1c499
...
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/memory/lmkd/+/15365195
Change-Id: Ie89fcb99555930708d8a7cd23fc2694bf4c0589f
2021-07-28 15:15:33 +00:00
Suren Baghdasaryan
f926a1c499
lmkd: Add current and max thrashing levels in LMK_MEMORY_STATS reports am: 81bb801dd2 am: 78e7e0d352
...
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/memory/lmkd/+/15365195
Change-Id: I0b1b7a067dfc4eb3a10b9cc8cf2a29d5986b9ca6
2021-07-28 15:11:37 +00:00
Suren Baghdasaryan
78e7e0d352
lmkd: Add current and max thrashing levels in LMK_MEMORY_STATS reports am: 81bb801dd2
...
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/memory/lmkd/+/15365195
Change-Id: I33801e8e2a818fe65007180083689369e7a61400
2021-07-28 15:02:10 +00:00
Suren Baghdasaryan
55faec3c2b
[automerger skipped] lmkd: Add current and max thrashing levels in LMK_MEMORY_STATS reports am: e16047516d am: 74c1874aa2 -s ours am: 6deecd4aa5 -s ours am: 6d9f35b05b -s ours
...
am skip reason: Merged-In I8a34dc41e7f03668bfad4ac2cbcb5d2570a10752 with SHA-1 81bb801dd2 is already in history
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1776906
Change-Id: I09098b69f500b1f6f447aa205014a9c673fabc2f
2021-07-27 01:52:29 +00:00
Suren Baghdasaryan
cfe5140a92
[automerger skipped] Revert "lmkd: Disable critical thrashing limit by default" am: 1ef4718aed am: ccd7f3f735 -s ours am: ee01679a16 -s ours am: 52a3387084 -s ours
...
am skip reason: Merged-In I15be5b3d67a71b68bca6dea9c2d5b4aa54d6c260 with SHA-1 dded82877f is already in history
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1776905
Change-Id: If7c006cdb559b5ac29df6507f4cdfbe160b6b42e
2021-07-27 01:52:28 +00:00
Suren Baghdasaryan
6d9f35b05b
[automerger skipped] lmkd: Add current and max thrashing levels in LMK_MEMORY_STATS reports am: e16047516d am: 74c1874aa2 -s ours am: 6deecd4aa5 -s ours
...
am skip reason: Merged-In I8a34dc41e7f03668bfad4ac2cbcb5d2570a10752 with SHA-1 81bb801dd2 is already in history
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1776906
Change-Id: I4bffa51a467430085fbd4dd320abae904066932e
2021-07-27 01:51:43 +00:00
Suren Baghdasaryan
52a3387084
[automerger skipped] Revert "lmkd: Disable critical thrashing limit by default" am: 1ef4718aed am: ccd7f3f735 -s ours am: ee01679a16 -s ours
...
am skip reason: Merged-In I15be5b3d67a71b68bca6dea9c2d5b4aa54d6c260 with SHA-1 dded82877f is already in history
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1776905
Change-Id: I8657928669e56c47e182ce8d85855e13b5990e84
2021-07-27 01:51:42 +00:00
Suren Baghdasaryan
e06b23a3bf
lmkd: Add current and max thrashing levels in LMK_MEMORY_STATS reports am: 81bb801dd2 am: 559c0d11a8 am: a4eab2c49d
...
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/memory/lmkd/+/15365195
Change-Id: Ia8bed51c04f132731e0d5dfeb2f47e9cae545386
2021-07-26 19:45:26 +00:00
Suren Baghdasaryan
a4eab2c49d
lmkd: Add current and max thrashing levels in LMK_MEMORY_STATS reports am: 81bb801dd2 am: 559c0d11a8
...
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/memory/lmkd/+/15365195
Change-Id: I09bd22b7fa59b4248d66f3fb288dd8a200d7ced9
2021-07-26 19:03:50 +00:00
Suren Baghdasaryan
6deecd4aa5
[automerger skipped] lmkd: Add current and max thrashing levels in LMK_MEMORY_STATS reports am: e16047516d am: 74c1874aa2 -s ours
...
am skip reason: Merged-In I8a34dc41e7f03668bfad4ac2cbcb5d2570a10752 with SHA-1 81bb801dd2 is already in history
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1776906
Change-Id: I2831e9f8024f7809373cb2d3499c112f5f125c51
2021-07-26 18:18:39 +00:00
Suren Baghdasaryan
ee01679a16
[automerger skipped] Revert "lmkd: Disable critical thrashing limit by default" am: 1ef4718aed am: ccd7f3f735 -s ours
...
am skip reason: Merged-In I15be5b3d67a71b68bca6dea9c2d5b4aa54d6c260 with SHA-1 dded82877f is already in history
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1776905
Change-Id: I0fe9b16c095298e4b9836f5e5b06d813f57e7f22
2021-07-26 18:18:38 +00:00
Suren Baghdasaryan
74c1874aa2
lmkd: Add current and max thrashing levels in LMK_MEMORY_STATS reports am: e16047516d
...
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1776906
Change-Id: Idf1f7e4011c25bf645eda165cc0604ff324597a7
2021-07-26 18:03:10 +00:00
Suren Baghdasaryan
ccd7f3f735
Revert "lmkd: Disable critical thrashing limit by default" am: 1ef4718aed
...
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1776905
Change-Id: I813228ae2107df1ee31a18ffae4853e01bcad5fd
2021-07-26 18:03:09 +00:00
Suren Baghdasaryan
f83d6ddb60
lmkd: Add current and max thrashing levels in LMK_MEMORY_STATS reports am: 81bb801dd2 am: 26484a3e2a
...
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/memory/lmkd/+/15365195
Change-Id: I94a1b9f1f63d5b3c16a4d280cef56a0322acb689
2021-07-23 22:01:39 +00:00
Suren Baghdasaryan
559c0d11a8
lmkd: Add current and max thrashing levels in LMK_MEMORY_STATS reports am: 81bb801dd2
...
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/memory/lmkd/+/15365195
Change-Id: If9fbee8fab4c2abf05ec288382deb9432f6ada6d
2021-07-23 21:42:14 +00:00
Suren Baghdasaryan
26484a3e2a
lmkd: Add current and max thrashing levels in LMK_MEMORY_STATS reports am: 81bb801dd2
...
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/memory/lmkd/+/15365195
Change-Id: Iabab46933ec756a84a2a7135936bd3e7dd2d6f01
2021-07-23 21:41:50 +00:00
Suren Baghdasaryan
e16047516d
lmkd: Add current and max thrashing levels in LMK_MEMORY_STATS reports
...
Thrashing threshold tuning requires collecting thrashing level data from
the field and correlating these levels with other indications of device
being non-responsive.
Include current and max thrashing levels in the lmkd kill reports. Max
thrashing level captures the highest level seen since the last kill report.
Bug: 194433891
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I8a34dc41e7f03668bfad4ac2cbcb5d2570a10752
Merged-In: I8a34dc41e7f03668bfad4ac2cbcb5d2570a10752
2021-07-23 19:11:36 +00:00
Suren Baghdasaryan
1ef4718aed
Revert "lmkd: Disable critical thrashing limit by default"
...
This reverts commit e1ffef4e36 .
Reason for revert: Restore the default thrashing limits to prevent unresponsive devices.
Bug: 194199500
Change-Id: I15be5b3d67a71b68bca6dea9c2d5b4aa54d6c260
Merged-In: I15be5b3d67a71b68bca6dea9c2d5b4aa54d6c260
2021-07-23 12:01:55 -07:00
Suren Baghdasaryan
81bb801dd2
lmkd: Add current and max thrashing levels in LMK_MEMORY_STATS reports
...
Thrashing threshold tuning requires collecting thrashing level data from
the field and correlating these levels with other indications of device
being non-responsive.
Include current and max thrashing levels in the lmkd kill reports. Max
thrashing level captures the highest level seen since the last kill report.
Bug: 194433891
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I8a34dc41e7f03668bfad4ac2cbcb5d2570a10752
2021-07-22 16:51:46 -07:00
Suren Baghdasaryan
bab5a11509
Revert "lmkd: Disable critical thrashing limit by default" am: dded82877f am: d042af50d1 am: c121feb993
...
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/memory/lmkd/+/15362664
Change-Id: If9dc727ef94cb0c1fbdced7ae176078531afc136
2021-07-22 23:51:22 +00:00