77122e5780
With new psi monitor support in the kernel lmkd can use it to register custom pressure levels. Add lmkd support for psi monitors when they are provided by the kernel and use them by default. When kernel does not support psi lmkd will fall back to vmpressure usage. Add ability to poll memory status after the initial psi event is triggered because kernel throttles psi memory pressure events to one per PSI tracking window (currently set to 1sec). Current implementation polls every 200ms for 1sec duration after the initial event is triggered. If ro.lmk.use_psi is set to false psi logic will be disabled even when psi is supported in kernel. Bug: 111308141 Test: lmkd_unit_test Change-Id: I685774b176f393bab7412161773f5c9af51e0163 Signed-off-by: Suren Baghdasaryan <surenb@google.com>
53 lines
980 B
Text
53 lines
980 B
Text
cc_binary {
|
|
name: "lmkd",
|
|
|
|
srcs: ["lmkd.c"],
|
|
shared_libs: [
|
|
"libcutils",
|
|
"liblog",
|
|
"libprocessgroup",
|
|
"libpsi",
|
|
],
|
|
static_libs: [
|
|
"libstatslogc",
|
|
"libstatssocket",
|
|
],
|
|
local_include_dirs: ["include"],
|
|
cflags: ["-Werror", "-DLMKD_TRACE_KILLS"],
|
|
init_rc: ["lmkd.rc"],
|
|
product_variables: {
|
|
use_lmkd_stats_log: {
|
|
cflags: [
|
|
"-DLMKD_LOG_STATS"
|
|
],
|
|
},
|
|
},
|
|
logtags: ["event.logtags"],
|
|
}
|
|
|
|
cc_library_static {
|
|
name: "libstatslogc",
|
|
srcs: ["statslog.c"],
|
|
cflags: [
|
|
"-Wall",
|
|
"-Werror",
|
|
],
|
|
shared_libs: [
|
|
"liblog",
|
|
],
|
|
static_libs: ["libstatssocket",],
|
|
}
|
|
|
|
cc_library_static {
|
|
name: "liblmkd_utils",
|
|
srcs: ["liblmkd_utils.c"],
|
|
shared_libs: [
|
|
"libcutils",
|
|
],
|
|
export_include_dirs: ["include"],
|
|
cppflags: [
|
|
"-g",
|
|
"-Wall",
|
|
"-Werror",
|
|
]
|
|
}
|