kernel_optimize_test/fs
Chinwen Chang ff9f47f6f0 mm: proc: smaps_rollup: do not stall write attempts on mmap_lock
smaps_rollup will try to grab mmap_lock and go through the whole vma list
until it finishes the iterating.  When encountering large processes, the
mmap_lock will be held for a longer time, which may block other write
requests like mmap and munmap from progressing smoothly.

There are upcoming mmap_lock optimizations like range-based locks, but the
lock applied to smaps_rollup would be the coarse type, which doesn't avoid
the occurrence of unpleasant contention.

To solve aforementioned issue, we add a check which detects whether anyone
wants to grab mmap_lock for write attempts.

Signed-off-by: Chinwen Chang <chinwen.chang@mediatek.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Steven Price <steven.price@arm.com>
Cc: Michel Lespinasse <walken@google.com>
Cc: Matthias Brugger <matthias.bgg@gmail.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Daniel Jordan <daniel.m.jordan@oracle.com>
Cc: Davidlohr Bueso <dbueso@suse.de>
Cc: Chinwen Chang <chinwen.chang@mediatek.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Song Liu <songliubraving@fb.com>
Cc: Jimmy Assarsson <jimmyassarsson@gmail.com>
Cc: Huang Ying <ying.huang@intel.com>
Cc: Daniel Kiss <daniel.kiss@arm.com>
Cc: Laurent Dufour <ldufour@linux.ibm.com>
Link: http://lkml.kernel.org/r/1597715898-3854-4-git-send-email-chinwen.chang@mediatek.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2020-10-13 18:38:31 -07:00
..
9p
adfs
affs
afs block-5.10-2020-10-12 2020-10-13 12:12:44 -07:00
autofs
befs
bfs
btrfs block-5.10-2020-10-12 2020-10-13 12:12:44 -07:00
cachefiles
ceph
cifs cifs: Fix incomplete memory allocation on setxattr path 2020-10-10 15:52:54 -07:00
coda
configfs
cramfs
crypto
debugfs
devpts
dlm dlm for 5.10 2020-10-13 08:59:39 -07:00
ecryptfs
efivarfs
efs
erofs erofs: remove unnecessary enum entries 2020-10-09 10:37:42 +08:00
exfat exfat: fix use of uninitialized spinlock on error path 2020-10-07 14:27:13 +09:00
exportfs
ext2
ext4
f2fs fscrypt updates for 5.10 2020-10-13 08:54:00 -07:00
fat
freevxfs
fscache
fuse block-5.10-2020-10-12 2020-10-13 12:12:44 -07:00
gfs2
hfs
hfsplus
hostfs
hpfs
hugetlbfs
iomap
isofs
jbd2
jffs2
jfs
kernfs
lockd
minix
nfs block-5.10-2020-10-12 2020-10-13 12:12:44 -07:00
nfs_common
nfsd
nilfs2
nls
notify
ntfs ntfs: add check for mft record size in superblock 2020-10-13 18:38:27 -07:00
ocfs2 ocfs2: fix potential soft lockup during fstrim 2020-10-13 18:38:27 -07:00
omfs
openpromfs
orangefs
overlayfs
proc mm: proc: smaps_rollup: do not stall write attempts on mmap_lock 2020-10-13 18:38:31 -07:00
pstore
qnx4
qnx6
quota Merge branch 'work.quota-compat' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2020-10-12 16:37:13 -07:00
ramfs
reiserfs
romfs
squashfs
sysfs
sysv
tracefs
ubifs block-5.10-2020-10-12 2020-10-13 12:12:44 -07:00
udf
ufs
unicode
vboxsf block-5.10-2020-10-12 2020-10-13 12:12:44 -07:00
verity
xfs
zonefs
aio.c Merge branch 'work.iov_iter' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2020-10-12 16:35:51 -07:00
anon_inodes.c
attr.c
bad_inode.c
binfmt_aout.c
binfmt_elf_fdpic.c
binfmt_elf.c
binfmt_em86.c
binfmt_flat.c
binfmt_misc.c
binfmt_script.c
block_dev.c block: add a bdget_part helper 2020-10-05 10:38:33 -06:00
buffer.c
char_dev.c
compat_binfmt_elf.c
coredump.c
d_path.c
dax.c
dcache.c
dcookies.c
direct-io.c fs: remove no longer used dio_end_io() 2020-10-07 12:17:59 +02:00
drop_caches.c
eventfd.c
eventpoll.c
exec.c
fcntl.c
fhandle.c
file_table.c
file.c
filesystems.c
fs_context.c
fs_parser.c fs_parse: mark fs_param_bad_value() as static 2020-10-13 18:38:27 -07:00
fs_pin.c
fs_struct.c
fs_types.c
fs-writeback.c block-5.10-2020-10-12 2020-10-13 12:12:44 -07:00
fsopen.c
init.c
inode.c
internal.h
io_uring.c io_uring-5.10-2020-10-12 2020-10-13 12:36:21 -07:00
io-wq.c
io-wq.h
ioctl.c
Kconfig
Kconfig.binfmt
libfs.c
locks.c
Makefile
mbcache.c
mount.h
mpage.c
namei.c
namespace.c Merge branch 'compat.mount' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2020-10-12 16:44:57 -07:00
no-block.c
nsfs.c
open.c
pipe.c Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2020-10-11 11:11:35 -07:00
pnode.c
pnode.h
posix_acl.c
proc_namespace.c
read_write.c Merge branch 'work.iov_iter' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2020-10-12 16:35:51 -07:00
readdir.c
select.c
seq_file.c
signalfd.c
splice.c Merge branch 'work.iov_iter' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2020-10-12 16:35:51 -07:00
stack.c
stat.c
statfs.c
super.c
sync.c
timerfd.c
userfaultfd.c
utimes.c
xattr.c fs/xattr.c: fix kernel-doc warnings for setxattr & removexattr 2020-10-13 18:38:27 -07:00