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-prev] [day] [month] [year] [list]
Message-ID: <20180323122902.GR23100@dhcp22.suse.cz>
Date:   Fri, 23 Mar 2018 13:29:02 +0100
From:   Michal Hocko <mhocko@...nel.org>
To:     "Li,Rongqing" <lirongqing@...du.com>
Cc:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-mm@...ck.org" <linux-mm@...ck.org>,
        "cgroups@...r.kernel.org" <cgroups@...r.kernel.org>,
        "hannes@...xchg.org" <hannes@...xchg.org>,
        Andrey Ryabinin <aryabinin@...tuozzo.com>
Subject: 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.

> 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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ