Return-Path: Date: Tue, 23 Jan 2018 20:29:20 -0800 From: Eric Biggers To: Sasha Levin Cc: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" , Jiang Biao , Al Viro , Minchan Kim , Michal Hocko , "zhong.weidong@zte.com.cn" , Andrew Morton , Linus Torvalds Subject: Re: [PATCH AUTOSEL for 4.9 38/55] fs/mbcache.c: make count_objects() more robust Message-ID: <20180124042920.GA571@zzz.localdomain> References: <20180124041521.32223-1-alexander.levin@microsoft.com> <20180124041521.32223-38-alexander.levin@microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180124041521.32223-38-alexander.levin@microsoft.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: On Wed, Jan 24, 2018 at 04:15:49AM +0000, Sasha Levin wrote: > From: Jiang Biao > > [ Upstream commit d5dabd633922ac5ee5bcc67748f7defb8b211469 ] > > When running ltp stress test for 7*24 hours, vmscan occasionally emits > the following warning continuously: > > mb_cache_scan+0x0/0x3f0 negative objects to delete > nr=-9232265467809300450 > ... > > Tracing shows the freeable(mb_cache_count returns) is -1, which causes > the continuous accumulation and overflow of total_scan. > > This patch makes sure that mb_cache_count() cannot return a negative > value, which makes the mbcache shrinker more robust. > > Link: http://lkml.kernel.org/r/1511753419-52328-1-git-send-email-jiang.biao2@zte.com.cn > Signed-off-by: Jiang Biao > Cc: Al Viro > Cc: Minchan Kim > Cc: Michal Hocko > Cc: > Signed-off-by: Andrew Morton > Signed-off-by: Linus Torvalds > Signed-off-by: Sasha Levin > --- > fs/mbcache.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/fs/mbcache.c b/fs/mbcache.c > index c5bd19ffa326..35ab4187bfe1 100644 > --- a/fs/mbcache.c > +++ b/fs/mbcache.c > @@ -269,6 +269,9 @@ static unsigned long mb_cache_count(struct shrinker *shrink, > struct mb_cache *cache = container_of(shrink, struct mb_cache, > c_shrink); > > + /* Unlikely, but not impossible */ > + if (unlikely(cache->c_entry_count < 0)) > + return 0; > return cache->c_entry_count; > } This patch is broken and is reverted in linux-next, via ext4/dev: bbe45d2460da ("mbcache: revert "fs/mbcache.c: make count_objects() more robust"") Can you please update your "autosel" script/process/whatever to not select commits that are reverted?