diff options
| author | Vinayak Menon <vinmenon@codeaurora.org> | 2015-03-20 14:15:39 +0530 |
|---|---|---|
| committer | Kyle Yan <kyan@codeaurora.org> | 2016-06-29 15:11:26 -0700 |
| commit | 9caa3b38bbead2fc0e28554641880c02e0f6d649 (patch) | |
| tree | 4f17773f9b8d8361ddd4fba9076c8f6ef3d0615c /include/linux | |
| parent | 82b3ab03808f5934c784ed89bbe4625183525ad8 (diff) | |
mm: process reclaim: vmpressure based process reclaim
With this patch, anon pages of inactive tasks can be reclaimed,
depending on memory pressure. Memory pressure is detected
using vmpressure events. 'N' best tasks in terms of anon
size is selected and pages proportional to their tasksize
is reclaimed. The total number of pages reclaimed at each
run of the swap work, can be tuned from userspace, the
default being SWAP_CLUSTER_MAX * 32.
The patch also adds tracepoints to debug and tune the
feature.
echo 1 > /sys/module/process_reclaim/parameters/enable_process_reclaim
to enable the feature.
echo <pages> > /sys/module/process_reclaim/parameters/per_swap_size,
to set the number of pages reclaimed in each scan.
/sys/module/process_reclaim/parameters/reclaim_avg_efficiency, provides
the average efficiency (scan to reclaim ratio) of the algorithm.
/sys/module/process_reclaim/parameters/swap_eff_win, to set the window
period (in unit of number of times reclaim is triggered) to detect
low efficiency runs.
/sys/module/process_reclaim/parameters/swap_opt_eff, to set the optimal
efficiency threshold for low efficiency detection.
Change-Id: I895986f10c997d1715761eaaadc4bbbee60db9d2
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/mm.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h index a56812f21657..cbe9b794c714 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -2329,5 +2329,19 @@ void __init setup_nr_node_ids(void); static inline void setup_nr_node_ids(void) {} #endif +#ifdef CONFIG_PROCESS_RECLAIM +struct reclaim_param { + struct vm_area_struct *vma; + /* Number of pages scanned */ + int nr_scanned; + /* max pages to reclaim */ + int nr_to_reclaim; + /* pages reclaimed */ + int nr_reclaimed; +}; +extern struct reclaim_param reclaim_task_anon(struct task_struct *task, + int nr_to_reclaim); +#endif + #endif /* __KERNEL__ */ #endif /* _LINUX_MM_H */ |
