msm-4.14/include/linux/simple_lmk.h
Sultan Alsawaf c2bf2617ab
simple_lmk: Make reclaim deterministic
The 20 ms delay in the reclaim thread is a hacky fudge factor that can
cause Simple LMK to behave wildly differently depending on the
circumstances of when it is invoked. When kswapd doesn't get enough CPU
time to finish up and go back to sleep within 20 ms, Simple LMK performs
superfluous reclaims.

This is suboptimal, so make Simple LMK more deterministic by eliminating
the delay and instead queuing up reclaim requests from kswapd.

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

23 lines
486 B
C

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