On Tue 26-11-19 20:28:37, Yafang Shao wrote: > There's one case that the processes in a memcg are all exit (due to OOM > group or some other reasons), but the file page caches are still exist. > These file page caches may be protected by memory.min so can't be > reclaimed. If we can't success to restart the processes in this memcg or > don't want to make this memcg offline, then we want to drop the file page > caches. > The advantage of droping this file caches is it can avoid the reclaimer > (either kswapd or direct) scanning and reclaiming pages from all memcgs > exist in this system, because currently the reclaimer will fairly reclaim > pages from all memcgs if the system is under memory pressure. > The possible method to drop these file page caches is setting the > hard limit of this memcg to 0. Unfortunately this may invoke the OOM killer > and generates lots of outputs, that should not happen. > The OOM output is not expected by the admin if he or she wants to drop > the cahes and knows there're no processes in this memcg. > > If memcg is not populated, we should not invoke the OOM killer because > there's nothing to kill. Next time when you start a new process and if the > max is still bellow usage, the OOM killer will be invoked and your new > process is killed, so we can cosider it as lazy OOM, that is we have been > always doing in the kernel. > > Fixes: b6e6edcf ("mm: memcontrol: reclaim and OOM kill when shrinking memory.max below usage") > Signed-off-by: Yafang Shao <laoar.shao@xxxxxxxxx> > Cc: Johannes Weiner <hannes@xxxxxxxxxxx> > Cc: Michal Hocko <mhocko@xxxxxxxx> due to reasons explained repeatedly Nacked-by: Michal Hocko <mhocko@xxxxxxxx> And I really find it highly annoying that you keep ignoring the review feedback. -- Michal Hocko SUSE Labs