mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
mm: memcontrol: drain memcg stock on force_empty
The per-cpu memcg stock can retain a charge of upto 32 pages. On a machine with large number of cpus, this can amount to a decent amount of memory. Additionally force_empty interface might be triggering unneeded memcg reclaims. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Junaid Shahid <[email protected]> Signed-off-by: Shakeel Butt <[email protected]> Acked-by: Michal Hocko <[email protected]> Cc: Greg Thelen <[email protected]> Cc: Johannes Weiner <[email protected]> Cc: Vladimir Davydov <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
bb4a7ea2b1
commit
d12c60f64c
1 changed files with 3 additions and 0 deletions
|
|
@ -2610,6 +2610,9 @@ static int mem_cgroup_force_empty(struct mem_cgroup *memcg)
|
|||
|
||||
/* we call try-to-free pages for make this cgroup empty */
|
||||
lru_add_drain_all();
|
||||
|
||||
drain_all_stock(memcg);
|
||||
|
||||
/* try to free all pages in this cgroup */
|
||||
while (nr_retries && page_counter_read(&memcg->memory)) {
|
||||
int progress;
|
||||
|
|
|
|||
Loading…
Reference in a new issue