mm: memcontrol: drain memcg stock on force_empty
Subsystems (3)
PATCH 1/1 mm: memcontrol: drain memcg stock on force_empty
From: Junaid Shahid <[email protected]>
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.
--- mm/memcontrol.c | 3 +++ 1 file changed, 3 insertions(+)
mm/memcontrol.c +3 -0
@@ -2841,6 +2841,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;
Signature · 1 line
2.17.0.441.gb46fe60e1d-goog
Quoted 8 lines · Shakeel Butt
From: Junaid Shahid <[email protected]>
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_emptyinterface might be triggering unneeded memcg reclaims.Signed-off-by Junaid Shahid <[email protected]>
This should be "Junaid Shahid <[email protected]>".
mm/memcontrol.c static int mem_cgroup_force_empty(struct mem_cgroup
Quoted 10 lines
Signed-off-by Shakeel Butt <[email protected]>--- mm/memcontrol.c | 3 +++ 1 file changed, 3 insertions(+)mm/memcontrol.c +0
-0@@ -2841,6 +2841,9 @@ static int mem_cgroup_force_empty(struct mem_cgroup
*memcg)
Quoted 10 lines
mm/memcontrol.c +3
-1/* 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; --2.17.0.441.gb46fe60e1d-goog
Quoted 9 lines · Shakeel Butt
From: Junaid Shahid <[email protected]>
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_emptyinterface might be triggering unneeded memcg reclaims.Signed-off-by Junaid Shahid <[email protected]>Signed-off-by Shakeel Butt <[email protected]>
Quoted 20 lines
--- mm/memcontrol.c | 3 +++ 1 file changed, 3 insertions(+)mm/memcontrol.c +3
-0@@ -2841,6 +2841,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;Signature · 1 line
2.17.0.441.gb46fe60e1d-goog
Signature · 2 lines
Michal Hocko SUSE Labs