android_kernel_samsung_msm8976/fs
Dave Chinner 6099c02b78 sync: don't block the flusher thread waiting on IO
When sync does it's WB_SYNC_ALL writeback, it issues data Io and
then immediately waits for IO completion. This is done in the
context of the flusher thread, and hence completely ties up the
flusher thread for the backing device until all the dirty inodes
have been synced. On filesystems that are dirtying inodes constantly
and quickly, this means the flusher thread can be tied up for
minutes per sync call and hence badly affect system level write IO
performance as the page cache cannot be cleaned quickly.

We already have a wait loop for IO completion for sync(2), so cut
this out of the flusher thread and delegate it to wait_sb_inodes().
Hence we can do rapid IO submission, and then wait for it all to
complete.

Effect of sync on fsmark before the patch:

FSUse%        Count         Size    Files/sec     App Overhead
.....
     0       640000         4096      35154.6          1026984
     0       720000         4096      36740.3          1023844
     0       800000         4096      36184.6           916599
     0       880000         4096       1282.7          1054367
     0       960000         4096       3951.3           918773
     0      1040000         4096      40646.2           996448
     0      1120000         4096      43610.1           895647
     0      1200000         4096      40333.1           921048

And a single sync pass took:

  real    0m52.407s
  user    0m0.000s
  sys     0m0.090s

After the patch, there is no impact on fsmark results, and each
individual sync(2) operation run concurrently with the same fsmark
workload takes roughly 7s:

  real    0m6.930s
  user    0m0.000s
  sys     0m0.039s

IOWs, sync is 7-8x faster on a busy filesystem and does not have an
adverse impact on ongoing async data write operations.

Change-Id: I7747bd4bceb3079572695d3942294a6c7b265557
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit 7747bd4bceb3079572695d3942294a6c7b265557)
Git-commit: 4b946c51e6e52cbac1647d10dab7decefcb2b21d
Git-repo: https://android.googlesource.com/kernel/common.git
Signed-off-by: Kaushal Kumar <kaushalk@codeaurora.org>
2015-09-16 18:20:20 +05:30
..
9p
adfs fs: push sync_filesystem() down to the file system's remount_fs() 2015-09-16 18:20:11 +05:30
affs fs: push sync_filesystem() down to the file system's remount_fs() 2015-09-16 18:20:11 +05:30
afs
autofs4 autofs4 copy_dev_ioctl(): keep the value of ->size we'd used for allocation 2015-03-18 13:22:32 +01:00
befs fs: push sync_filesystem() down to the file system's remount_fs() 2015-09-16 18:20:11 +05:30
bfs
btrfs fs: push sync_filesystem() down to the file system's remount_fs() 2015-09-16 18:20:11 +05:30
cachefiles
ceph ceph: allow sync_read/write return partial successed size of read/write. 2014-01-09 12:24:25 -08:00
cifs fs: push sync_filesystem() down to the file system's remount_fs() 2015-09-16 18:20:11 +05:30
coda fs: push sync_filesystem() down to the file system's remount_fs() 2015-09-16 18:20:11 +05:30
configfs configfs: fix race between dentry put and lookup 2013-11-29 11:11:53 -08:00
cramfs fs: push sync_filesystem() down to the file system's remount_fs() 2015-09-16 18:20:11 +05:30
debugfs fs: push sync_filesystem() down to the file system's remount_fs() 2015-09-16 18:20:11 +05:30
devpts fs: push sync_filesystem() down to the file system's remount_fs() 2015-09-16 18:20:11 +05:30
dlm
ecryptfs fs: ecryptfs: readdir: constify actor 2015-09-16 18:20:14 +05:30
efivarfs
efs fs: push sync_filesystem() down to the file system's remount_fs() 2015-09-16 18:20:11 +05:30
exofs ore: Fix wrong math in allocation of per device BIO 2014-02-13 13:48:00 -08:00
exportfs constify ->actor 2015-09-16 18:20:09 +05:30
ext2 fs: push sync_filesystem() down to the file system's remount_fs() 2015-09-16 18:20:11 +05:30
ext3 fs: push sync_filesystem() down to the file system's remount_fs() 2015-09-16 18:20:11 +05:30
ext4 fs: push sync_filesystem() down to the file system's remount_fs() 2015-09-16 18:20:11 +05:30
f2fs fs: push sync_filesystem() down to the file system's remount_fs() 2015-09-16 18:20:11 +05:30
fat fs: push sync_filesystem() down to the file system's remount_fs() 2015-09-16 18:20:11 +05:30
freevxfs fs: push sync_filesystem() down to the file system's remount_fs() 2015-09-16 18:20:11 +05:30
fscache
fuse fs: push sync_filesystem() down to the file system's remount_fs() 2015-09-16 18:20:11 +05:30
gfs2 fs: push sync_filesystem() down to the file system's remount_fs() 2015-09-16 18:20:11 +05:30
hfs fs: push sync_filesystem() down to the file system's remount_fs() 2015-09-16 18:20:11 +05:30
hfsplus fs: push sync_filesystem() down to the file system's remount_fs() 2015-09-16 18:20:11 +05:30
hostfs
hpfs fs: push sync_filesystem() down to the file system's remount_fs() 2015-09-16 18:20:11 +05:30
hppfs
hugetlbfs cope with potentially long ->d_dname() output for shmem/hugetlb 2014-01-09 16:35:41 -08:00
isofs isofs: Fix unchecked printing of ER records 2015-01-08 09:58:15 -08:00
jbd
jbd2 This is the 3.10.67 stable release 2015-04-24 18:04:40 -07:00
jffs2 fs: push sync_filesystem() down to the file system's remount_fs() 2015-09-16 18:20:11 +05:30
jfs fs: push sync_filesystem() down to the file system's remount_fs() 2015-09-16 18:20:11 +05:30
lockd LOCKD: Fix a race when initialising nlmsvc_timeout 2015-01-27 07:52:33 -08:00
logfs
minix fs: push sync_filesystem() down to the file system's remount_fs() 2015-09-16 18:20:11 +05:30
ncpfs fs: push sync_filesystem() down to the file system's remount_fs() 2015-09-16 18:20:11 +05:30
nfs fs: push sync_filesystem() down to the file system's remount_fs() 2015-09-16 18:20:11 +05:30
nfs_common
nfsd constify ->actor 2015-09-16 18:20:09 +05:30
nilfs2 fs: push sync_filesystem() down to the file system's remount_fs() 2015-09-16 18:20:11 +05:30
nls
notify fsnotify: next_i is freed during fsnotify_unmount_inodes. 2015-01-27 07:52:33 -08:00
ntfs fs: push sync_filesystem() down to the file system's remount_fs() 2015-09-16 18:20:11 +05:30
ocfs2 fs: push sync_filesystem() down to the file system's remount_fs() 2015-09-16 18:20:11 +05:30
omfs
openpromfs fs: push sync_filesystem() down to the file system's remount_fs() 2015-09-16 18:20:11 +05:30
proc proc: make oom adjustment files user read-only 2015-09-16 18:20:13 +05:30
pstore fs: push sync_filesystem() down to the file system's remount_fs() 2015-09-16 18:20:11 +05:30
qnx4 fs: push sync_filesystem() down to the file system's remount_fs() 2015-09-16 18:20:11 +05:30
qnx6 fs: push sync_filesystem() down to the file system's remount_fs() 2015-09-16 18:20:11 +05:30
quota quota: provide interface for readding allocated space into reserved space 2015-01-29 17:40:57 -08:00
ramfs
reiserfs fs: push sync_filesystem() down to the file system's remount_fs() 2015-09-16 18:20:11 +05:30
romfs fs: push sync_filesystem() down to the file system's remount_fs() 2015-09-16 18:20:11 +05:30
squashfs Squashfs: Add LZ4 compression configuration option 2015-09-16 18:20:12 +05:30
sysfs
sysv fs: push sync_filesystem() down to the file system's remount_fs() 2015-09-16 18:20:11 +05:30
ubifs fs: push sync_filesystem() down to the file system's remount_fs() 2015-09-16 18:20:11 +05:30
udf fs: push sync_filesystem() down to the file system's remount_fs() 2015-09-16 18:20:11 +05:30
ufs fs: push sync_filesystem() down to the file system's remount_fs() 2015-09-16 18:20:11 +05:30
xfs fs: push sync_filesystem() down to the file system's remount_fs() 2015-09-16 18:20:11 +05:30
yaffs2 fs: yaffs2: initialize delayed workqueue before using it 2013-11-26 23:29:26 -08:00
Kconfig fs: yaffs: Import yaffs from Thu Dec 23 13:31:37 2010 +1300 2013-09-04 17:24:15 -07:00
Kconfig.binfmt
Makefile fs: yaffs: Import yaffs from Thu Dec 23 13:31:37 2010 +1300 2013-09-04 17:24:15 -07:00
aio.c aio: fix kernel memory disclosure in io_getevents() introduced in v3.10 2014-06-30 20:09:45 -07:00
anon_inodes.c
attr.c fs,userns: Change inode_capable to capable_wrt_inode_uidgid 2014-06-16 13:42:52 -07:00
bad_inode.c
binfmt_aout.c mm: remove free_area_cache 2014-02-07 13:49:41 -08:00
binfmt_elf.c This is the 3.10.73 stable release 2015-04-24 18:14:57 -07:00
binfmt_elf_fdpic.c
binfmt_em86.c
binfmt_flat.c
binfmt_misc.c
binfmt_script.c
binfmt_som.c
bio-integrity.c bio-integrity: Fix bio_integrity_verify segment start bug 2014-03-23 21:38:21 -07:00
bio.c platform: msm: fix PFT when using direct-io 2014-06-23 21:38:40 +03:00
block_dev.c mm: vmscan: take page buffers dirty and locked state into account 2014-12-11 15:12:10 +05:30
buffer.c This is the 3.10.67 stable release 2015-04-24 18:04:40 -07:00
char_dev.c
compat.c constify ->actor 2015-09-16 18:20:09 +05:30
compat_binfmt_elf.c binfmt_elf: add ELF_HWCAP2 to compat auxv entries 2015-03-19 14:52:32 -07:00
compat_ioctl.c fs: Add TTY PM IOCTLs to compat table 2014-07-30 10:25:00 -06:00
coredump.c coredump: fix the setting of PF_DUMPCORE 2014-07-31 12:53:50 -07:00
coredump.h
dcache.c vfs: fix bad hashing of dentries 2014-09-17 09:04:02 -07:00
dcookies.c fs/compat: fix lookup_dcookie() parameter handling 2014-02-13 13:48:00 -08:00
direct-io.c platform: msm: fix PFT when using direct-io 2014-06-23 21:38:40 +03:00
drop_caches.c
eventfd.c
eventpoll.c Revert "epoll: use freezable blocking call" 2014-08-29 14:20:41 -07:00
exec.c seccomp: implement SECCOMP_FILTER_FLAG_TSYNC 2015-03-19 14:52:56 -07:00
fcntl.c
fhandle.c vfs: read file_handle only once in handle_to_path. 2015-07-22 07:25:30 -07:00
file.c Merge upstream linux-stable v3.10.36 into msm-3.10 2014-04-23 16:23:49 -07:00
file_table.c don't bother with {get,put}_write_access() on non-regular files 2014-05-30 21:52:12 -07:00
filesystems.c
fs-writeback.c sync: don't block the flusher thread waiting on IO 2015-09-16 18:20:20 +05:30
fs_struct.c
generic_acl.c
inode.c fs: add {lock,unlock}_two_nondirectories for 3.18 backport 2015-09-16 18:20:19 +05:30
internal.h splice: don't pass the address of ->f_pos to methods 2013-06-20 19:02:45 +04:00
ioctl.c
ioprio.c block: Fix computation of merged request priority 2014-11-21 09:22:53 -08:00
libfs.c
locks.c locks: allow __break_lease to sleep even when break_time is 0 2014-05-13 13:59:44 +02:00
mbcache.c
mount.h vfs: Is mounted should be testing mnt_ns for NULL or error. 2014-02-06 11:08:16 -08:00
mpage.c
namei.c This is the 3.10.67 stable release 2015-04-24 18:04:40 -07:00
namespace.c umount: Disallow unprivileged mount force 2015-01-08 09:58:16 -08:00
no-block.c
open.c Merge upstream tag 'v3.10.49' into msm-3.10 2014-08-20 13:23:09 -07:00
pipe.c vfs: fix subtle use-after-free of pipe_inode_info 2013-12-11 22:36:26 -08:00
pnode.c
pnode.h
posix_acl.c posix_acl: handle NULL ACL in posix_acl_equiv_mode 2014-06-07 13:25:33 -07:00
proc_namespace.c
read_write.c Merge upstream linux-stable v3.10.36 into msm-3.10 2014-04-23 16:23:49 -07:00
readdir.c constify ->actor 2015-09-16 18:20:09 +05:30
select.c select: use freezable blocking call 2013-07-01 15:45:28 -07:00
seq_file.c fs/seq_file: Use vmalloc by default for allocations > PAGE_SIZE 2014-09-23 10:37:58 -06:00
signalfd.c
splice.c fuse: fix pipe_buf_operations 2014-02-13 13:47:59 -08:00
stack.c
stat.c quota: provide interface for readding allocated space into reserved space 2015-01-29 17:40:57 -08:00
statfs.c vfs: allow O_PATH file descriptors for fstatfs() 2013-10-18 07:45:44 -07:00
super.c This is the 3.10.67 stable release 2015-04-24 18:04:40 -07:00
sync.c
timerfd.c timerfd: support CLOCK_BOOTTIME clock 2014-06-13 12:06:03 -07:00
utimes.c
xattr.c
xattr_acl.c