Commit Graph

1373 Commits

Author SHA1 Message Date
Suren Baghdasaryan 823de4f6bf [automerger skipped] lmkd: Add support for persist.device_config.lmkd_native.* properties am: e7d82ee7e7 -s ours am: d941a3e7bb -s ours am: 2c71d517e3 -s ours
am skip reason: Merged-In Ia48fd51eab126d307a1604530b642e86cf250688 with SHA-1 d0a800402c is already in history

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

Change-Id: Ibf598f140c93fd5641f0ebd3760bc663fcf81f9f
2021-09-15 23:44:32 +00:00
Suren Baghdasaryan 73c23925e9 [automerger skipped] lmkd: Do not re-initialize lmkd when persistent properties are loaded am: fcb9cb6de4 -s ours am: d31d0d1eb2 -s ours
am skip reason: Merged-In Iba34fc719a18d58b890549c7415bec869d471901 with SHA-1 0e64eadc21 is already in history

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

Change-Id: I6cc22f296b196134c08141f2107ae934dbfcd0ea
2021-09-15 23:29:28 +00:00
Suren Baghdasaryan 2c71d517e3 [automerger skipped] lmkd: Add support for persist.device_config.lmkd_native.* properties am: e7d82ee7e7 -s ours am: d941a3e7bb -s ours
am skip reason: Merged-In Ia48fd51eab126d307a1604530b642e86cf250688 with SHA-1 d0a800402c is already in history

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

Change-Id: I082cf993722773f5e7366106df783b6edb978b36
2021-09-15 23:29:27 +00:00
Suren Baghdasaryan 0e07e4e3fb lmkd: Do not re-initialize lmkd when persistent properties are loaded am: fcb9cb6de4
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/memory/lmkd/+/15798712

Change-Id: I2bbf4b0887fbdcd2b4c23cdda94e5800acf588e7
2021-09-15 23:19:18 +00:00
Suren Baghdasaryan 32a2f953b0 lmkd: Add support for persist.device_config.lmkd_native.* properties am: e7d82ee7e7
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/memory/lmkd/+/15788312

Change-Id: I1cd180d62fb0f4553f6040b01417a73a6b0f4c70
2021-09-15 23:19:17 +00:00
Suren Baghdasaryan d31d0d1eb2 [automerger skipped] lmkd: Do not re-initialize lmkd when persistent properties are loaded am: fcb9cb6de4 -s ours
am skip reason: Merged-In Iba34fc719a18d58b890549c7415bec869d471901 with SHA-1 0e64eadc21 is already in history

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

Change-Id: I414d3c898dd7503119e37f9e7ad2a601c51cbbba
2021-09-15 23:18:00 +00:00
Suren Baghdasaryan d941a3e7bb [automerger skipped] lmkd: Add support for persist.device_config.lmkd_native.* properties am: e7d82ee7e7 -s ours
am skip reason: Merged-In Ia48fd51eab126d307a1604530b642e86cf250688 with SHA-1 d0a800402c is already in history

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

Change-Id: Ice7ea4aac70782659cc2009cea1e6614b13d85a9
2021-09-15 23:17:59 +00:00
Wei Wang 5ebb4d47ec lmkd: migrate process to FOREGROUND sched group before kill am: 0195bcdba7 am: a95efc0941 am: 50bf1dc40c am: 193b84cd38 am: fc109ed428
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1825954

Change-Id: I0eeb4905beaf38136433e3f9a4f1343c3c3114fe
2021-09-14 15:39:46 +00:00
Wei Wang fc109ed428 lmkd: migrate process to FOREGROUND sched group before kill am: 0195bcdba7 am: a95efc0941 am: 50bf1dc40c am: 193b84cd38
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1825954

Change-Id: I4f53520854d07eb4a58b455e0373bbb1edd178c4
2021-09-14 15:27:30 +00:00
Wei Wang 193b84cd38 lmkd: migrate process to FOREGROUND sched group before kill am: 0195bcdba7 am: a95efc0941 am: 50bf1dc40c
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1825954

Change-Id: I73a62f67750c64f87739d64ea0ba3f9010b94f70
2021-09-14 15:13:34 +00:00
Wei Wang 50bf1dc40c lmkd: migrate process to FOREGROUND sched group before kill am: 0195bcdba7 am: a95efc0941
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1825954

Change-Id: I675954885ae62c41b441865dffc8ce9e65529146
2021-09-14 15:03:43 +00:00
Wei Wang a95efc0941 lmkd: migrate process to FOREGROUND sched group before kill am: 0195bcdba7
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1825954

Change-Id: I9b572a9786cf5b7a583730654facca0e30bf57bb
2021-09-14 14:48:51 +00:00
Wei Wang 0195bcdba7 lmkd: migrate process to FOREGROUND sched group before kill
BG group may have settings such as cpu.shares impacting reclaim
performance. Let us migrate task to foreground sched group similarly to
cpuset group.

Test: Build
Bug: 199797672
Signed-off-by: Wei Wang <wvw@google.com>
Change-Id: I75ee9f3486a2c76e65267a98e39edff96a5e1673
2021-09-13 19:07:26 -07:00
Suren Baghdasaryan fcb9cb6de4 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-09 15:11:08 -07:00
Suren Baghdasaryan e7d82ee7e7 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-09 15:09:45 -07:00
Suren Baghdasaryan ee407e50fd lmkd: Do not re-initialize lmkd when persistent properties are loaded am: 0e64eadc21 am: e87dd04e20 am: 6ea9d83ddd am: ca40541bfc am: 0b427d1198
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1815756

Change-Id: I773ab64fad553a672ed418aaaf08cf328606548c
2021-09-02 00:59:11 +00:00
Suren Baghdasaryan 0b427d1198 lmkd: Do not re-initialize lmkd when persistent properties are loaded am: 0e64eadc21 am: e87dd04e20 am: 6ea9d83ddd am: ca40541bfc
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1815756

Change-Id: I94d996795e6fa035be6ca4733fbd561c5e1cb1a2
2021-09-02 00:44:57 +00:00
Suren Baghdasaryan ca40541bfc lmkd: Do not re-initialize lmkd when persistent properties are loaded am: 0e64eadc21 am: e87dd04e20 am: 6ea9d83ddd
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1815756

Change-Id: Ic7fc8573cfa282340d19c5430b18ca0333628309
2021-09-02 00:33:32 +00:00
Suren Baghdasaryan 6ea9d83ddd lmkd: Do not re-initialize lmkd when persistent properties are loaded am: 0e64eadc21 am: e87dd04e20
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1815756

Change-Id: I275bb50a28e949971d44b36c4133763200acce73
2021-09-02 00:18:56 +00:00
Suren Baghdasaryan e87dd04e20 lmkd: Do not re-initialize lmkd when persistent properties are loaded am: 0e64eadc21
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1815756

Change-Id: I9862d501675abeec5f4306e111d148bcc7ae8fb9
2021-09-01 23:58:43 +00:00
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