Thread (47 messages) 47 messages, 2 authors, 2021-08-04

Re: [PATCH 14/20] xfs: parallelize inode inactivation

From: "Darrick J. Wong" <djwong@kernel.org>
Date: 2021-08-02 21:33:22

On Mon, Aug 02, 2021 at 10:55:32AM +1000, Dave Chinner wrote:
quoted hunk ↗ jump to hunk
On Thu, Jul 29, 2021 at 11:45:10AM -0700, Darrick J. Wong wrote:
quoted
From: Darrick J. Wong <djwong@kernel.org>

Split the inode inactivation work into per-AG work items so that we can
take advantage of parallelization.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 fs/xfs/libxfs/xfs_ag.c |   12 ++++++-
 fs/xfs/libxfs/xfs_ag.h |   10 +++++
 fs/xfs/xfs_icache.c    |   88 ++++++++++++++++++++++++++++--------------------
 fs/xfs/xfs_icache.h    |    2 +
 fs/xfs/xfs_mount.c     |    9 +----
 fs/xfs/xfs_mount.h     |    8 ----
 fs/xfs/xfs_super.c     |    2 -
 fs/xfs/xfs_trace.h     |   82 ++++++++++++++++++++++++++++++++-------------
 8 files changed, 134 insertions(+), 79 deletions(-)
....
quoted
--- a/fs/xfs/xfs_icache.c
+++ b/fs/xfs/xfs_icache.c
@@ -420,9 +420,11 @@ xfs_blockgc_queue(
  */
 static void
 xfs_inodegc_queue(
-	struct xfs_mount        *mp,
+	struct xfs_perag	*pag,
 	struct xfs_inode	*ip)
 {
+	struct xfs_mount        *mp = pag->pag_mount;
+
 	if (!test_bit(XFS_OPFLAG_INODEGC_RUNNING_BIT, &mp->m_opflags))
 		return;
 
@@ -431,8 +433,8 @@ xfs_inodegc_queue(
 		unsigned int	delay;
 
 		delay = xfs_gc_delay_ms(mp, ip, XFS_ICI_INODEGC_TAG);
-		trace_xfs_inodegc_queue(mp, delay);
-		queue_delayed_work(mp->m_gc_workqueue, &mp->m_inodegc_work,
+		trace_xfs_inodegc_queue(pag, delay);
+		queue_delayed_work(mp->m_gc_workqueue, &pag->pag_inodegc_work,
 				msecs_to_jiffies(delay));
 	}
 	rcu_read_unlock();
I think you missed this change in xfs_inodegc_queue():
@@ -492,7 +492,7 @@ xfs_inodegc_queue(
 		return;
 
 	rcu_read_lock();
-	if (radix_tree_tagged(&mp->m_perag_tree, XFS_ICI_INODEGC_TAG)) {
+	if (radix_tree_tagged(&pag->pag_ici_root, XFS_ICI_INODEGC_TAG)) {
Yep, I've rebased this series so many times that merge conflict
resolution mutations have crept in.  Fixed; thank you. :(

(And FWIW for v9 I moved this patch to be immediately after the patch
that changes xfs to use the radix tree tags; this reduces the churn in
struct xfs_mount somewhat.)

--D
 		unsigned int    delay;
 
 		delay = xfs_gc_delay_ms(pag, ip, XFS_ICI_INODEGC_TAG);

Cheers,

Dave.

-- 
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