]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: introduce xfs_inodegc_push()
authorDave Chinner <dchinner@redhat.com>
Thu, 16 Jun 2022 14:44:32 +0000 (07:44 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Thu, 23 Jun 2022 20:34:38 +0000 (13:34 -0700)
commit0273efa0e4fd3af71c74a050dd0c6073873ce7ed
treee7560efb5d4a0c421381ba29bc44fc9dc704d89b
parent4518b14a6570649bbbff9b266a21bda2557fab3c
xfs: introduce xfs_inodegc_push()

The current blocking mechanism for pushing the inodegc queue out to
disk can result in systems becoming unusable when there is a long
running inodegc operation. This is because the statfs()
implementation currently issues a blocking flush of the inodegc
queue and a significant number of common system utilities will call
statfs() to discover something about the underlying filesystem.

This can result in userspace operations getting stuck on inodegc
progress, and when trying to remove a heavily reflinked file on slow
storage with a full journal, this can result in delays measuring in
hours.

Avoid this problem by adding "push" function that expedites the
flushing of the inodegc queue, but doesn't wait for it to complete.

Convert xfs_fs_statfs() and xfs_qm_scall_getquota() to use this
mechanism so they don't block but still ensure that queued
operations are expedited.

Fixes: d9fa3782d696 ("xfs: per-cpu deferred inode inactivation queues")
Reported-by: Chris Dunlop <chris@onthe.net.au>
Signed-off-by: Dave Chinner <dchinner@redhat.com>
[djwong: fix _getquota_next to use _inodegc_push too]
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
fs/xfs/xfs_icache.c
fs/xfs/xfs_icache.h
fs/xfs/xfs_qm_syscalls.c
fs/xfs/xfs_super.c
fs/xfs/xfs_trace.h