Thread (32 messages) 32 messages, 2 authors, 2021-08-09

Re: [PATCH 12/14] xfs: use background worker pool when transactions can't get free space

From: Dave Chinner <david@fromorbit.com>
Date: 2021-08-05 05:42:05

On Wed, Aug 04, 2021 at 07:07:28PM -0700, Darrick J. Wong wrote:
From: Darrick J. Wong <djwong@kernel.org>

In xfs_trans_alloc, if the block reservation call returns ENOSPC, we
call xfs_blockgc_free_space with a NULL icwalk structure to try to free
space.  Each frontend thread that encounters this situation starts its
own walk of the inode cache to see if it can find anything, which is
wasteful since we don't have any additional selection criteria.  For
this one common case, create a function that reschedules all pending
background work immediately and flushes the workqueue so that the scan
can run in parallel.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 fs/xfs/xfs_icache.c |   28 ++++++++++++++++++++++++++++
 fs/xfs/xfs_icache.h |    1 +
 fs/xfs/xfs_trace.h  |    1 +
 fs/xfs/xfs_trans.c  |    5 +----
 4 files changed, 31 insertions(+), 4 deletions(-)
Yup, looks a bit more efficient to do it this way.

Reviewed-by: Dave Chinner <redacted>

-- 
Dave Chinner
david@fromorbit.com
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help