All of lore.kernel.org
 help / color / mirror / Atom feed
* + fs-mbcache-make-count_objects-more-robust.patch added to -mm tree
@ 2017-11-27 23:53 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2017-11-27 23:53 UTC (permalink / raw)
  To: jiang.biao2, mhocko, minchan, viro, zhong.weidong, mm-commits


The patch titled
     Subject: fs/mbcache.c: make count_objects() more robust
has been added to the -mm tree.  Its filename is
     fs-mbcache-make-count_objects-more-robust.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/fs-mbcache-make-count_objects-more-robust.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/fs-mbcache-make-count_objects-more-robust.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Jiang Biao <jiang.biao2@zte.com.cn>
Subject: fs/mbcache.c: make count_objects() more robust

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 <jiang.biao2@zte.com.cn>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: <zhong.weidong@zte.com.cn>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 fs/mbcache.c |    3 +++
 1 file changed, 3 insertions(+)

diff -puN fs/mbcache.c~fs-mbcache-make-count_objects-more-robust fs/mbcache.c
--- a/fs/mbcache.c~fs-mbcache-make-count_objects-more-robust
+++ a/fs/mbcache.c
@@ -269,6 +269,9 @@ static unsigned long mb_cache_count(stru
 	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;
 }
 
_

Patches currently in -mm which might be from jiang.biao2@zte.com.cn are

fs-mbcache-make-count_objects-more-robust.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-11-27 23:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-27 23:53 + fs-mbcache-make-count_objects-more-robust.patch added to -mm tree akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.