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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 12 Apr 2022 09:36:31 +0800
From:   "ying.huang@...el.com" <ying.huang@...el.com>
To:     Miaohe Lin <linmiaohe@...wei.com>, akpm@...ux-foundation.org,
        Christoph Hellwig <hch@...radead.org>
Cc:     songmuchun@...edance.com, hch@...radead.org, willy@...radead.org,
        linux-mm@...ck.org, linux-kernel@...r.kernel.org,
        Johannes Weiner <hannes@...xchg.org>
Subject: Re: [PATCH v2 7/9] mm/vmscan: take min_slab_pages into account when
 try to call shrink_node

On Sat, 2022-04-09 at 17:34 +0800, Miaohe Lin wrote:
> Since commit 6b4f7799c6a5 ("mm: vmscan: invoke slab shrinkers from
> shrink_zone()"), slab reclaim and lru page reclaim are done together
> in the shrink_node. So we should take min_slab_pages into account
> when try to call shrink_node.
> 

Looks reasonable to me, copying Johannes.

Hi, Christoph,

Should we check min_unmapped_pages and min_slab_pages in shrink_node()
to avoid reclaim LRU when necessary and vice versa?  This may be done
via another 2 scan_control flags.

Best Regards,
Huang, Ying

> Signed-off-by: Miaohe Lin <linmiaohe@...wei.com>
> ---
>  mm/vmscan.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index 53f1d0755b34..ba83d8f3e53e 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -4714,7 +4714,8 @@ static int __node_reclaim(struct pglist_data *pgdat, gfp_t gfp_mask, unsigned in
>  	noreclaim_flag = memalloc_noreclaim_save();
>  	set_task_reclaim_state(p, &sc.reclaim_state);
>  
> 
> 
> 
> -	if (node_pagecache_reclaimable(pgdat) > pgdat->min_unmapped_pages) {
> +	if (node_pagecache_reclaimable(pgdat) > pgdat->min_unmapped_pages ||
> +	    node_page_state_pages(pgdat, NR_SLAB_RECLAIMABLE_B) > pgdat->min_slab_pages) {
>  		/*
>  		 * Free memory by calling shrink node with increasing
>  		 * priorities until we have enough memory freed.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ