linux/fs
Jiang Biao d5dabd6339 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>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-11-29 18:40:43 -08:00
..
9p Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
adfs Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
affs Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
afs Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
autofs4 autofs: don't fail mount for transient error 2017-11-17 16:10:02 -08:00
befs Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
bfs
btrfs Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
cachefiles mm: remove __GFP_COLD 2017-11-15 18:21:06 -08:00
ceph Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
cifs Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
coda Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
configfs
cramfs Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
crypto fscrypt: lots of cleanups, mostly courtesy by Eric Biggers 2017-11-14 11:35:15 -08:00
debugfs
devpts
dlm A couple of configfs cleanups: 2017-11-14 14:44:04 -08:00
ecryptfs Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
efivarfs
efs Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
exofs
exportfs
ext2 Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
ext4 Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
f2fs Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
fat Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
freevxfs Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
fscache AFS development 2017-11-16 11:41:22 -08:00
fuse Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
gfs2 Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
hfs Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
hfsplus Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
hostfs
hpfs Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
hugetlbfs mm, pagevec: remove cold parameter for pagevecs 2017-11-15 18:21:06 -08:00
isofs Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
jbd2 libnvdimm for 4.15 2017-11-17 09:51:57 -08:00
jffs2 Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
jfs Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
kernfs Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
lockd Lots of good bugfixes, including: 2017-11-18 11:22:04 -08:00
minix Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
ncpfs Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
nfs Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
nfs_common
nfsd Lots of good bugfixes, including: 2017-11-18 11:22:04 -08:00
nilfs2 Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
nls
notify Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
ntfs Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
ocfs2 Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
omfs
openpromfs Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
orangefs Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
overlayfs Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
proc proc: don't report kernel addresses in /proc/<pid>/stack 2017-11-27 16:45:56 -08:00
pstore treewide: Switch DEFINE_TIMER callbacks to struct timer_list * 2017-11-21 15:57:05 -08:00
qnx4 Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
qnx6 Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
quota Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs 2017-11-14 14:13:11 -08:00
ramfs
reiserfs Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
romfs Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
squashfs Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
sysfs Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
sysv Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
tracefs
ubifs Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
udf Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
ufs Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
xfs Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
Kconfig
Kconfig.binfmt
Makefile
aio.c Merge branch 'misc.compat' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2017-11-17 11:54:55 -08:00
anon_inodes.c
attr.c
bad_inode.c
binfmt_aout.c
binfmt_elf.c Merge branch 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm 2017-11-16 12:50:35 -08:00
binfmt_elf_fdpic.c Merge branch 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2017-11-17 12:54:01 -08:00
binfmt_em86.c
binfmt_flat.c
binfmt_misc.c
binfmt_script.c
block_dev.c Merge branch 'for-4.15/block' of git://git.kernel.dk/linux-block 2017-11-14 15:32:19 -08:00
buffer.c mm, pagevec: remove cold parameter for pagevecs 2017-11-15 18:21:06 -08:00
char_dev.c
compat.c
compat_binfmt_elf.c
compat_ioctl.c Merge branch 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2017-11-17 12:54:01 -08:00
coredump.c Merge branch 'misc.compat' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2017-11-17 11:54:55 -08:00
dax.c mm: replace pmd_write with pmd_access_permitted in fault + gup paths 2017-11-29 18:40:42 -08:00
dcache.c kmemcheck: remove annotations 2017-11-15 18:21:04 -08:00
dcookies.c
direct-io.c Merge branch 'for-4.15/block' of git://git.kernel.dk/linux-block 2017-11-14 15:32:19 -08:00
drop_caches.c
eventfd.c
eventpoll.c Merge branch 'akpm' (patches from Andrew) 2017-11-17 16:56:17 -08:00
exec.c exec: avoid RLIMIT_STACK races with prlimit() 2017-11-29 18:40:42 -08:00
fcntl.c fcntl: don't cap l_start and l_end values for F_GETLK64 in compat syscall 2017-11-15 08:08:36 -05:00
fhandle.c Merge branch 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2017-11-17 12:54:01 -08:00
file.c Merge branch 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2017-11-17 12:54:01 -08:00
file_table.c fs, mm: account filp cache to kmemcg 2017-11-15 18:21:04 -08:00
filesystems.c
fs-writeback.c Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
fs_pin.c
fs_struct.c
inode.c Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
internal.h fs: expose do_unlinkat for built-in callers 2017-11-10 08:48:46 -05:00
ioctl.c
iomap.c Merge branch 'work.iov_iter' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2017-11-17 12:08:18 -08:00
libfs.c Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
locks.c Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
mbcache.c fs/mbcache.c: make count_objects() more robust 2017-11-29 18:40:43 -08:00
mount.h
mpage.c
namei.c Merge branch 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2017-11-17 12:54:01 -08:00
namespace.c vfs: fix mounting a filesystem with i_version 2017-11-08 15:16:36 -05:00
no-block.c
nsfs.c Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
open.c
pipe.c pipe: add proc_dopipe_max_size() to safely assign pipe_max_size 2017-11-17 16:10:03 -08:00
pnode.c
pnode.h
posix_acl.c
proc_namespace.c Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
read_write.c Merge branch 'work.iov_iter' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2017-11-17 12:08:18 -08:00
readdir.c
select.c Merge branch 'misc.compat' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2017-11-17 11:54:55 -08:00
seq_file.c
signalfd.c Merge branch 'misc.compat' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2017-11-17 11:54:55 -08:00
splice.c
stack.c
stat.c
statfs.c Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
super.c Merge branch 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2017-11-17 12:54:01 -08:00
sync.c Merge branch 'for-4.15/block' of git://git.kernel.dk/linux-block 2017-11-14 15:32:19 -08:00
timerfd.c
userfaultfd.c userfaultfd: use mmgrab instead of open-coded increment of mm_count 2017-11-15 18:21:05 -08:00
utimes.c
xattr.c