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: <20171127023912.GB27255@bbox>
Date:   Mon, 27 Nov 2017 11:39:12 +0900
From:   Minchan Kim <minchan@...nel.org>
To:     Jiang Biao <jiang.biao2@....com.cn>
Cc:     akpm@...ux-foundation.org, mhocko@...e.com, hannes@...xchg.org,
        hillf.zj@...baba-inc.com, ying.huang@...el.com,
        mgorman@...hsingularity.net, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org, zhong.weidong@....com.cn
Subject: Re: [PATCH] mm/vmscan: make do_shrink_slab more robust.

Hello,

On Mon, Nov 27, 2017 at 09:37:30AM +0800, Jiang Biao wrote:
> When running ltp stress test for 7*24 hours, the kernel occasionally
> complains the following warning continuously,
> 
> mb_cache_shrink_scan+0x0/0x3f0 negative objects to delete
> nr=-9222526086287711848
> mb_cache_shrink_scan+0x0/0x3f0 negative objects to delete
> nr=-9222420761333860545
> mb_cache_shrink_scan+0x0/0x3f0 negative objects to delete
> nr=-9222287677544280360
> ...
> 
> The tracing result shows the freeable(mb_cache_shrink_scan returns)
> is -1, which causes the continuous accumulation and overflow of
> total_scan.

Good catch.

> 
> This patch make do_shrink_slab more robust when
> shrinker->count_objects return negative freeable.

Shrinker.h says count_objects should return 0 if there are no
freeable objects, not -1.

So if something returns -1, changing it with returning 0 would
be more proper fix.

Thanks.


> 
> Signed-off-by: Jiang Biao <jiang.biao2@....com.cn>
> ---
>  mm/vmscan.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index eb2f031..3ea28f0 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -323,7 +323,7 @@ static unsigned long do_shrink_slab(struct shrink_control *shrinkctl,
>  	long scanned = 0, next_deferred;
>  
>  	freeable = shrinker->count_objects(shrinker, shrinkctl);
> -	if (freeable == 0)
> +	if (freeable <= 0)
>  		return 0;
>  
>  	/*
> -- 
> 2.7.4
> 
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@...ck.org.  For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@...ck.org"> email@...ck.org </a>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ