]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: move inode flush to the sync workqueue
authorDarrick J. Wong <darrick.wong@oracle.com>
Wed, 26 Oct 2022 06:28:42 +0000 (11:58 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 29 Oct 2022 08:20:34 +0000 (10:20 +0200)
commit06940839ac8529cb6d5c198baa084784726b62ba
tree413cc13d3bd0354dc8ab7145dfd8b0101c73a9d7
parent29d94654444f49b7289a5129f37b12dbe081e385
xfs: move inode flush to the sync workqueue

commit e5c7b41c9a42f4e6db035aa9d453c4f557c11213 upstream.

[ Modify fs/xfs/xfs_super.c to include the changes at locations suitable for
 5.4-lts kernel ]

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: 8056c99cd46b ("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>
Acked-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Chandan Babu R <chandan.babu@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/xfs/xfs_mount.h
fs/xfs/xfs_super.c