xfs
[Top] [All Lists]

Re: [patch] Fix broken inode clustering

To: David Chinner <dgc@xxxxxxx>
Subject: Re: [patch] Fix broken inode clustering
From: Lachlan McIlroy <lachlan@xxxxxxx>
Date: Fri, 09 Nov 2007 12:09:35 +1100
Cc: xfs-oss <xfs@xxxxxxxxxxx>, xfs-dev <xfs-dev@xxxxxxx>
In-reply-to: <20071108003848.GA66820511@xxxxxxx>
References: <20071108003848.GA66820511@xxxxxxx>
Reply-to: lachlan@xxxxxxx
Sender: xfs-bounce@xxxxxxxxxxx
User-agent: Thunderbird 2.0.0.6 (X11/20070728)
Looks good Dave.

David Chinner wrote:
The radix tree based inode caches did away with the inode cluster hashes,
replacing them with a bunch of masking and gang lookups on the radix tree.

This masking got broken when moving the code to per-ag radix trees and
indexing by agino # rather than straight inode number. The result is
clustered inode writeback does not cluster and things can go extremely
slowly when there are lots of inodes to write.

The following patch fixes this up by comparing agino # of the inode
found to the index of the cluster we are looking for.

Signed-off-by: Dave Chinner <dgc@xxxxxxx>
Tested-by: Torsten Kaiser <just.for.lkml@xxxxxxxxxxxxxx>

---
 fs/xfs/xfs_iget.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: 2.6.x-xfs-new/fs/xfs/xfs_iget.c
===================================================================
--- 2.6.x-xfs-new.orig/fs/xfs/xfs_iget.c        2007-11-02 13:44:46.000000000 
+1100
+++ 2.6.x-xfs-new/fs/xfs/xfs_iget.c     2007-11-07 13:08:42.534440675 +1100
@@ -248,7 +248,7 @@ finish_inode:
        icl = NULL;
        if (radix_tree_gang_lookup(&pag->pag_ici_root, (void**)&iq,
                                                        first_index, 1)) {
-               if ((iq->i_ino & mask) == first_index)
+               if ((XFS_INO_TO_AGINO(mp, iq->i_ino) & mask) == first_index)
                        icl = iq->i_cluster;
        }




<Prev in Thread] Current Thread [Next in Thread>