mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
memcontrol: schedule throttling if we are congested
Memory allocations can induce swapping via kswapd or direct reclaim. If we are having IO done for us by kswapd and don't actually go into direct reclaim we may never get scheduled for throttling. So instead check to see if our cgroup is congested, and if so schedule the throttling. Before we return to user space the throttling stuff will only throttle if we actually required it. Signed-off-by: Tejun Heo <[email protected]> Signed-off-by: Josef Bacik <[email protected]> Acked-by: Johannes Weiner <[email protected]> Acked-by: Andrew Morton <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
parent
d09d8df3a2
commit
2cf855837b
7 changed files with 81 additions and 14 deletions
|
|
@ -5593,6 +5593,19 @@ out:
|
|||
return ret;
|
||||
}
|
||||
|
||||
int mem_cgroup_try_charge_delay(struct page *page, struct mm_struct *mm,
|
||||
gfp_t gfp_mask, struct mem_cgroup **memcgp,
|
||||
bool compound)
|
||||
{
|
||||
struct mem_cgroup *memcg;
|
||||
int ret;
|
||||
|
||||
ret = mem_cgroup_try_charge(page, mm, gfp_mask, memcgp, compound);
|
||||
memcg = *memcgp;
|
||||
mem_cgroup_throttle_swaprate(memcg, page_to_nid(page), gfp_mask);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* mem_cgroup_commit_charge - commit a page charge
|
||||
* @page: page to charge
|
||||
|
|
|
|||
Loading…
Reference in a new issue