Commit Graph

6 Commits

Author SHA1 Message Date
syphyr 688ad4c9cd Revert "lowmemorykiller: Introduce sysfs node for ALMK and PPR adj threshold"
This reverts commit b0c67828b5.
2019-07-27 22:09:43 +02:00
Suyog Sarda b0c67828b5 lowmemorykiller: Introduce sysfs node for ALMK and PPR adj threshold
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-07-06 23:07:02 -07:00
Shiraz Hashim b1b162e675 mm: process_reclaim: use unbounded cpu workqueue
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>
2015-06-11 12:23:28 +05:30
Vinayak Menon 31dd00feaa mm: process_reclaim: do not iterate over stale task structs
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>
2015-05-22 18:42:45 +05:30
Vinayak Menon c27bb1e574 mm: process_reclaim: fix reclaim skip on low efficiency
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>
2015-05-08 18:43:43 +05:30
Vinayak Menon 17429185a5 mm: process reclaim: vmpressure based process reclaim
With this patch, anon pages of incative 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>
2015-04-16 11:00:47 -07:00