msm-4.14/include/linux/simple_lmk.h
Sultan Alsawaf 08eda9b371
simple_lmk: Use vmpressure notifier to trigger kills
Using kswapd's scan depth to trigger task kills is inconsistent and
unreliable. When memory pressure quickly spikes, the kswapd scan depth
trigger fails to kick off Simple LMK fast enough, causing severe lag.
Additionally, kswapd could stop scanning prematurely before reaching the
desired scan depth to trigger Simple LMK, which could also cause stalls.

To remedy this, use the vmpressure framework instead, since it provides
more consistent and accurate readings on memory pressure. This is not
very tunable though, so remove CONFIG_ANDROID_SIMPLE_LMK_AGGRESSION.
Triggering Simple LMK to kill when the reported memory pressure is 100
should yield good results on all setups.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-04-06 13:20:18 +07:00

19 lines
368 B
C

/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (C) 2019-2020 Sultan Alsawaf <sultan@kerneltoast.com>.
*/
#ifndef _SIMPLE_LMK_H_
#define _SIMPLE_LMK_H_
struct mm_struct;
#ifdef CONFIG_ANDROID_SIMPLE_LMK
void simple_lmk_mm_freed(struct mm_struct *mm);
#else
static inline void simple_lmk_mm_freed(struct mm_struct *mm)
{
}
#endif
#endif /* _SIMPLE_LMK_H_ */