linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] mm: improve proportional memcg protection
@ 2020-04-25 15:24 Yafang Shao
  2020-04-25 15:24 ` [PATCH 1/3] mm: move struct scan_control into internal.h Yafang Shao
                   ` (3 more replies)
  0 siblings, 4 replies; 19+ messages in thread
From: Yafang Shao @ 2020-04-25 15:24 UTC (permalink / raw)
  To: akpm, hannes, mhocko, guro, chris; +Cc: linux-mm, Yafang Shao

Since proportional memory.{min, low} reclaim is introduced in
commit 9783aa9917f8 ("mm, memcg: proportional memory.{low,min} reclaim"),
it have been proved that the proportional reclaim is hard to understand and
the issues caused by it is harder to understand.[1]. That dilemma faced by
us is caused by that the proportional reclaim mixed up memcg and the
reclaim context.

In proportional reclaim, the whole reclaim context - includes the memcg
to be reclaimed and the reclaimer, should be considered, rather than
memcg only.

To make it clear, a new member 'protection' is introduced in the reclaim
context (struct shrink_control) to replace mem_cgroup_protection(). This
one is set when we check whether the memcg is protected or not.

After this change, the issue pointed by me[1] - a really old left-over
value can slow down target reclaim - can be fixed, and I think it could
also avoid some potential race.

Patch #1 and patch #2 is the preparation of patch #3.

[1]. https://lore.kernel.org/linux-mm/20200423061629.24185-1-laoar.shao@gmail.com

Yafang Shao (3):
  mm: move struct scan_control into internal.h
  mm: add reclaim context as a new parameter in mem_cgroup_protected()
  mm: improvements on memcg protection functions

 include/linux/memcontrol.h |  34 -----------
 mm/internal.h              | 101 +++++++++++++++++++++++++++++++
 mm/memcontrol.c            |  66 +++++++++++++++------
 mm/vmscan.c                | 118 ++-----------------------------------
 4 files changed, 152 insertions(+), 167 deletions(-)

-- 
2.18.2



^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2020-04-28 12:42 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-25 15:24 [PATCH 0/3] mm: improve proportional memcg protection Yafang Shao
2020-04-25 15:24 ` [PATCH 1/3] mm: move struct scan_control into internal.h Yafang Shao
2020-04-25 15:24 ` [PATCH 2/3] mm: add reclaim context as a new parameter in mem_cgroup_protected() Yafang Shao
2020-04-25 15:24 ` [PATCH 3/3] mm: improvements on memcg protection functions Yafang Shao
2020-04-27  9:40   ` Michal Hocko
2020-04-27 10:09     ` Yafang Shao
2020-04-27 10:50       ` Michal Hocko
2020-04-27 11:06         ` Yafang Shao
2020-04-27 11:24           ` Michal Hocko
2020-04-27 11:32             ` Yafang Shao
2020-04-27 17:05 ` [PATCH 0/3] mm: improve proportional memcg protection Johannes Weiner
2020-04-28  1:45   ` Yafang Shao
2020-04-28  3:37     ` Johannes Weiner
2020-04-28  6:00       ` Yafang Shao
2020-04-28  8:05     ` Michal Hocko
2020-04-28  8:22       ` Yafang Shao
2020-04-28 10:43         ` Michal Hocko
2020-04-28 12:25           ` Yafang Shao
2020-04-28 12:42             ` Michal Hocko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox