linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Li,Rongqing" <lirongqing@baidu.com>
To: Michal Hocko <mhocko@kernel.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"cgroups@vger.kernel.org" <cgroups@vger.kernel.org>,
	"hannes@cmpxchg.org" <hannes@cmpxchg.org>,
	Andrey Ryabinin <aryabinin@virtuozzo.com>
Subject: 答复: [PATCH] mm/memcontrol.c: speed up to force empty a memory cgroup
Date: Tue, 27 Mar 2018 06:17:55 +0000	[thread overview]
Message-ID: <2AD939572F25A448A3AE3CAEA61328C237507761@BC-MAIL-M28.internal.baidu.com> (raw)
In-Reply-To: <20180323103407.GP23100@dhcp22.suse.cz>



> -----邮件原件-----
> 发件人: Michal Hocko [mailto:mhocko@kernel.org]
> 发送时间: 2018年3月23日 18:34
> 收件人: Li,Rongqing <lirongqing@baidu.com>
> 抄送: linux-kernel@vger.kernel.org; linux-mm@kvack.org;
> cgroups@vger.kernel.org; hannes@cmpxchg.org; Andrey Ryabinin
> <aryabinin@virtuozzo.com>
> 主题: Re: [PATCH] mm/memcontrol.c: speed up to force empty a memory
> cgroup
> 
> On Mon 19-03-18 16:29:30, Li RongQing wrote:
> > mem_cgroup_force_empty() tries to free only 32 (SWAP_CLUSTER_MAX)
> > pages on each iteration, if a memory cgroup has lots of page cache, it
> > will take many iterations to empty all page cache, so increase the
> > reclaimed number per iteration to speed it up. same as in
> > mem_cgroup_resize_limit()
> >
> > a simple test show:
> >
> >   $dd if=aaa  of=bbb  bs=1k count=3886080
> >   $rm -f bbb
> >   $time echo 100000000 >/cgroup/memory/test/memory.limit_in_bytes
> >
> > Before: 0m0.252s ===> after: 0m0.178s
> 
> One more note. I have only now realized that increasing the patch size might
> have another negative side effect. Memcg reclaim bails out early when the
> required target has been reclaimed and so we might skip memcgs in the
> hierarchy and could end up hamering one child in the hierarchy much more
> than others. Our current code is not ideal and we workaround this by a
> smaller target and caching the last reclaimed memcg so the imbalance is not
> so visible at least.
> 
> This is not something that couldn't be fixed and maybe 1M chunk would be
> acceptable as well. I dunno. Let's focus on the main bottleneck first before we
> start doing these changes though.

Can we select chunk size based on resize memory?

Chunksize = (memory.usage_in_bytes- memory.limit_in_bytes)/1024

Chunksize=max(Chunksize, 1M)

-RongQing

> --
> Michal Hocko
> SUSE Labs

      reply	other threads:[~2018-03-27  6:18 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-19  8:29 Li RongQing
2018-03-19  8:53 ` Michal Hocko
2018-03-19 10:00   ` 答复: " Li,Rongqing
2018-03-19 10:37     ` Michal Hocko
2018-03-19 10:51       ` 答复: " Li,Rongqing
2018-03-19 17:51         ` David Rientjes
2018-03-20  8:39           ` Michal Hocko
2018-03-20 20:29             ` David Rientjes
2018-03-20 22:08               ` Andrey Ryabinin
2018-03-20 22:15                 ` David Rientjes
2018-03-20 22:35                   ` Andrey Ryabinin
2018-03-20 22:45                     ` David Rientjes
2018-03-21  9:59                     ` Michal Hocko
2018-03-23  2:58         ` Li,Rongqing
2018-03-23 10:08           ` Michal Hocko
2018-03-23 12:04             ` 答复: " Li,Rongqing
2018-03-23 12:29               ` Michal Hocko
2018-03-27  6:11                 ` 答复: " Li,Rongqing
2018-03-23 10:34 ` Michal Hocko
2018-03-27  6:17   ` Li,Rongqing [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2AD939572F25A448A3AE3CAEA61328C237507761@BC-MAIL-M28.internal.baidu.com \
    --to=lirongqing@baidu.com \
    --cc=aryabinin@virtuozzo.com \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox