summaryrefslogtreecommitdiff
path: root/mm/process_reclaim.c
AgeCommit message (Collapse)Author
2016-12-17lowmemorykiller: Introduce sysfs node for ALMK and PPR adj thresholdSuyog Sarda
The grouping of tasks based on oom_score_adj values change from one framework to another. This requires corresponding changes in the threshold values set for almk and per process reclaim. Introduce sysfs nodes to set threshold adj for process reclaim and adaptive LMK dynamically. Change-Id: Ib7565bfd5d2e93aa4ff8fdd20414cac0a0f38bf7 Signed-off-by: Suyog Sarda <ssarda@codeaurora.org> Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
2016-06-29mm: process_reclaim: use unbounded cpu workqueueShiraz Hashim
It is observed that in some cases process reclaim work doesn't get chance to run due to presence of RT scheduled on the same CPU. This is leading to user space freeze and a live-lock situation where RT itself is looping for a page to be present in swap cache while process reclaim work is unable to schedule and do the same. Schedule process reclaim work on unbounded cpu workqueue so that the work has opportunity to be scheduled on to other cpu. Change-Id: I6852f7e8d0a344ab5631b188627263f11414f27e Signed-off-by: Shiraz Hashim <shashim@codeaurora.org> Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
2016-06-29mm: process_reclaim: do not iterate over stale task structsVinayak Menon
swap_fn iterates through the threads of selected tasks after a rcu_read_unlock which is wrong. But we can't extend the rcu_read_lock since it will result in severe performance issues. So better avoid iterating over the threads. Just lock the group leader and use it further. Change-Id: I36269b1b6619315f33f6f3b49ec73571a66796f2 Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
2016-06-29mm: process_reclaim: fix reclaim skip on low efficiencyVinayak Menon
The logic used to skip reclaim on low efficiency results in process reclaim not triggering at all. Fix it by properly handling the skip_reclaim atomic variable. Change-Id: I119097bb9b1baf8f3e8d4afa0a6dc2c30c0de6e7 Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
2016-06-29mm: process reclaim: vmpressure based process reclaimVinayak Menon
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>