public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm/vmscan: make do_shrink_slab more robust.
@ 2017-11-27  1:37 Jiang Biao
  2017-11-27  2:39 ` Minchan Kim
  0 siblings, 1 reply; 5+ messages in thread
From: Jiang Biao @ 2017-11-27  1:37 UTC (permalink / raw)
  To: akpm, mhocko, hannes, hillf.zj, minchan, ying.huang, mgorman
  Cc: linux-mm, linux-kernel, jiang.biao2, zhong.weidong

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.

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

Signed-off-by: Jiang Biao <jiang.biao2@zte.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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-11-27  8:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-27  1:37 [PATCH] mm/vmscan: make do_shrink_slab more robust Jiang Biao
2017-11-27  2:39 ` Minchan Kim
     [not found]   ` <201711271246270445123@zte.com.cn>
2017-11-27  5:16     ` Minchan Kim
     [not found]       ` <201711271427202879096@zte.com.cn>
2017-11-27  6:38         ` Minchan Kim
     [not found]           ` <201711271526547083632@zte.com.cn>
2017-11-27  8:27             ` Michal Hocko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox