Re: [PATCH] mm: avoid the unnecessary waiting when force empty a cgroup

From: Michal Hocko
Date: Tue Apr 03 2018 - 04:40:32 EST


On Tue 03-04-18 08:29:39, Li,Rongqing wrote:
>
>
> > -----éäåä-----
> > åää: Michal Hocko [mailto:mhocko@xxxxxxxxxx]
> > åéæé: 2018å4æ3æ 16:05
> > æää: Li,Rongqing <lirongqing@xxxxxxxxx>
> > æé: hannes@xxxxxxxxxxx; vdavydov.dev@xxxxxxxxx;
> > cgroups@xxxxxxxxxxxxxxx; linux-mm@xxxxxxxxx;
> > linux-kernel@xxxxxxxxxxxxxxx
> > äé: Re: [PATCH] mm: avoid the unnecessary waiting when force empty a
> > cgroup
> >
> > On Tue 03-04-18 15:12:09, Li RongQing wrote:
> > > The number of writeback and dirty page can be read out from memcg, the
> > > unnecessary waiting can be avoided by these counts
> >
> > This changelog doesn't explain the problem and how the patch fixes it.
>
> If a process in a memory cgroup takes some RSS, when force empty this
> memory cgroup, congestion_wait will be called unconditionally, there
> is 0.5 seconds delay

OK, so the problem is that force_empty hits congestion_wait too much?
Why do we have no progress from try_to_free_mem_cgroup_pages?

> If use this patch, nearly no delay.
>
>
> > Why do wee another throttling when we do already throttle in the reclaim
> > path?
>
> Do you mean we should remove congestion_wait(BLK_RW_ASYNC, HZ/10)
> from mem_cgroup_force_empty, since try_to_free_mem_cgroup_pages
> [shrink_inactive_list] has called congestion_wait

If it turns unnecessary, which is quite possible then yes. As I've said
we already throttle when seeing pages under writeback. If that is not
sufficient then we should investigate why.

Please also note that force_empty is considered deprecated. Do you have
any usecase which led you to fixing it?
--
Michal Hocko
SUSE Labs