OSDN Git Service

xfs: move inode flush to the sync workqueue
authorDarrick J. Wong <darrick.wong@oracle.com>
Sun, 12 Apr 2020 20:11:10 +0000 (13:11 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Thu, 16 Apr 2020 16:07:42 +0000 (09:07 -0700)
commitf0f7a674d4df1510d8ca050a669e1420cf7d7fab
treea6c6b8ee0d2135cd9a0261eef500574a9e094a1a
parentc142932c29e533ee892f87b44d8abc5719edceec
xfs: move inode flush to the sync workqueue

Move the inode dirty data flushing to a workqueue so that multiple
threads can take advantage of a single thread's flushing work.  The
ratelimiting technique used in bdd4ee4 was not successful, because
threads that skipped the inode flush scan due to ratelimiting would
ENOSPC early, which caused occasional (but noticeable) changes in
behavior and sporadic fstest regressions.

Therefore, make all the writer threads wait on a single inode flush,
which eliminates both the stampeding hordes of flushers and the small
window in which a write could fail with ENOSPC because it lost the
ratelimit race after even another thread freed space.

Fixes: c6425702f21e ("xfs: ratelimit inode flush on buffered write ENOSPC")
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
fs/xfs/xfs_mount.h
fs/xfs/xfs_super.c