public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] Fix broken inode clustering
@ 2007-11-08  0:38 David Chinner
  2007-11-09  1:09 ` Lachlan McIlroy
  0 siblings, 1 reply; 2+ messages in thread
From: David Chinner @ 2007-11-08  0:38 UTC (permalink / raw)
  To: xfs-oss; +Cc: xfs-dev

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@sgi.com>
Tested-by: Torsten Kaiser <just.for.lkml@googlemail.com>

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch] Fix broken inode clustering
  2007-11-08  0:38 [patch] Fix broken inode clustering David Chinner
@ 2007-11-09  1:09 ` Lachlan McIlroy
  0 siblings, 0 replies; 2+ messages in thread
From: Lachlan McIlroy @ 2007-11-09  1:09 UTC (permalink / raw)
  To: David Chinner; +Cc: xfs-oss, xfs-dev

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@sgi.com>
> Tested-by: Torsten Kaiser <just.for.lkml@googlemail.com>
> 
> ---
>  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;
>  	}
>  
> 
> 
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-11-09  1:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-08  0:38 [patch] Fix broken inode clustering David Chinner
2007-11-09  1:09 ` Lachlan McIlroy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox