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:11:03 +0000	[thread overview]
Message-ID: <2AD939572F25A448A3AE3CAEA61328C2375076CC@BC-MAIL-M28.internal.baidu.com> (raw)
In-Reply-To: <20180323122902.GR23100@dhcp22.suse.cz>



> -----邮件原件-----
> 发件人: linux-kernel-owner@vger.kernel.org
> [mailto:linux-kernel-owner@vger.kernel.org] 代表 Michal Hocko
> 发送时间: 2018年3月23日 20:29
> 收件人: 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 Fri 23-03-18 12:04:16, Li,Rongqing wrote:
> [...]
> > shrink_slab does not reclaim any memory, but take lots of time to
> > count lru
> >
> > maybe we can use the returning of shrink_slab to control if next
> > shrink_slab should be called?
> 
> How? Different memcgs might have different amount of shrinkable memory.
> 

maybe there is not a easy way to implement it

in this case, shrink_slab call many times list_lru_count_one, which is calling list_lru_count_one, which use spinlock, maybe replace spinlock with RCU, to optimize


-RongQing


> > Or define a slight list_lru_empty to check if sb->s_dentry_lru is
> > empty before calling list_lru_shrink_count, like below
> 
> Does it really help to improve numbers?
> 
> > diff --git a/fs/super.c b/fs/super.c
> > index 672538ca9831..954c22338833 100644
> > --- a/fs/super.c
> > +++ b/fs/super.c
> > @@ -130,8 +130,10 @@ static unsigned long super_cache_count(struct
> shrinker *shrink,
> >         if (sb->s_op && sb->s_op->nr_cached_objects)
> >                 total_objects = sb->s_op->nr_cached_objects(sb, sc);
> >
> > -       total_objects += list_lru_shrink_count(&sb->s_dentry_lru, sc);
> > -       total_objects += list_lru_shrink_count(&sb->s_inode_lru, sc);
> > +       if (!list_lru_empty(sb->s_dentry_lru))
> > +               total_objects +=
> list_lru_shrink_count(&sb->s_dentry_lru, sc);
> > +       if (!list_lru_empty(sb->s_inode_lru))
> > +               total_objects +=
> > + list_lru_shrink_count(&sb->s_inode_lru, sc);
> >
> >         total_objects = vfs_pressure_ratio(total_objects);
> >         return total_objects;
> 
> --
> Michal Hocko
> SUSE Labs

  reply	other threads:[~2018-03-27  6:11 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 [this message]
2018-03-23 10:34 ` Michal Hocko
2018-03-27  6:17   ` 答复: " Li,Rongqing

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=2AD939572F25A448A3AE3CAEA61328C2375076CC@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