lkml.org 
[lkml]   [2018]   [Mar]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: 答复: 答复: 答 复: [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

\
 
 \ /
  Last update: 2018-03-23 13:29    [W:0.050 / U:0.200 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site