lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 3 Apr 2018 08:29:39 +0000
From:   "Li,Rongqing" <lirongqing@...du.com>
To:     Michal Hocko <mhocko@...nel.org>
CC:     "hannes@...xchg.org" <hannes@...xchg.org>,
        "vdavydov.dev@...il.com" <vdavydov.dev@...il.com>,
        "cgroups@...r.kernel.org" <cgroups@...r.kernel.org>,
        "linux-mm@...ck.org" <linux-mm@...ck.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: re: [PATCH] mm: avoid the unnecessary waiting when force empty a
 cgroup



> -----邮件原件-----
> 发件人: Michal Hocko [mailto:mhocko@...nel.org]
> 发送时间: 2018年4月3日 16:05
> 收件人: Li,Rongqing <lirongqing@...du.com>
> 抄送: hannes@...xchg.org; vdavydov.dev@...il.com;
> cgroups@...r.kernel.org; linux-mm@...ck.org;
> linux-kernel@...r.kernel.org
> 主题: 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

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


-RongQing

> 
> > Signed-off-by: Li RongQing <lirongqing@...du.com>
> > ---
> >  mm/memcontrol.c | 8 ++++++--
> >  1 file changed, 6 insertions(+), 2 deletions(-)
> >
> > diff --git a/mm/memcontrol.c b/mm/memcontrol.c index
> > 9ec024b862ac..5258651bd4ec 100644
> > --- a/mm/memcontrol.c
> > +++ b/mm/memcontrol.c
> > @@ -2613,9 +2613,13 @@ static int mem_cgroup_force_empty(struct
> mem_cgroup *memcg)
> >  		progress = try_to_free_mem_cgroup_pages(memcg, 1,
> >  							GFP_KERNEL, true);
> >  		if (!progress) {
> > +			unsigned long num;
> > +
> > +			num = memcg_page_state(memcg, NR_WRITEBACK) +
> > +					memcg_page_state(memcg, NR_FILE_DIRTY);
> >  			nr_retries--;
> > -			/* maybe some writeback is necessary */
> > -			congestion_wait(BLK_RW_ASYNC, HZ/10);
> > +			if (num)
> > +				congestion_wait(BLK_RW_ASYNC, HZ/10);
> >  		}
> >
> >  	}
> > --
> > 2.11.0
> 
> --
> Michal Hocko
> SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ