public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* REVIEW:  fix xfs_repair phase 4 ag_stride with prefetch
@ 2007-08-03  3:13 Barry Naujok
  2007-08-10  6:08 ` Timothy Shimmin
  0 siblings, 1 reply; 2+ messages in thread
From: Barry Naujok @ 2007-08-03  3:13 UTC (permalink / raw)
  To: xfs@oss.sgi.com, xfs-dev

[-- Attachment #1: Type: text/plain, Size: 861 bytes --]


AG stride testing was performed on a system with ample amounts
of memory, so prefetching with AG stride during Phase 4 was
missed. The attached patch fixes this.

32 AGs, ag_stride = 4:

Phase 3 - for each AG...
         - scan and clear agi unlinked lists...
         - process known inodes and perform inode discovery...
         - agno = 0
         - agno = 4
         - agno = 8
         - agno = 12
         - agno = 16
         - agno = 20
         - agno = 24
         - agno = 28

which is correct... but in Phase 4:

Phase 4 - check for duplicate blocks...
         - setting up duplicate extent list...
         - check for inodes claiming duplicate blocks...
         - agno = 0
         - agno = 1
         - agno = 2
         - agno = 5
         - agno = 6
         - agno = 4
         - agno = 7
         - agno = 3

[-- Attachment #2: fix_ag_stride --]
[-- Type: application/octet-stream, Size: 1069 bytes --]

Index: repair/xfsprogs/repair/phase4.c
===================================================================
--- repair.orig/xfsprogs/repair/phase4.c	2007-07-24 15:34:39.000000000 +1000
+++ repair/xfsprogs/repair/phase4.c	2007-08-03 12:04:38.201176283 +1000
@@ -137,6 +137,7 @@
 	xfs_mount_t		*mp)
 {
 	int 			i, j;
+	xfs_agnumber_t 		agno;
 	work_queue_t		*queues;
 	prefetch_args_t		*pf_args[2];
 
@@ -153,12 +154,13 @@
 			/*
 			 * create one worker thread for each segment of the volume
 			 */
-			for (i = 0; i < thread_count; i++) {
+			for (i = 0, agno = 0; i < thread_count; i++) {
 				create_work_queue(&queues[i], mp, 1);
 				pf_args[0] = NULL;
-				for (j = i; j < mp->m_sb.sb_agcount; j += ag_stride) {
-					pf_args[0] = start_inode_prefetch(j, 0, pf_args[0]);
-					queue_work(&queues[i], process_ag_func, j, pf_args[0]);
+				for (j = 0; j < ag_stride && agno < mp->m_sb.sb_agcount;
+						j++, agno++) {
+					pf_args[0] = start_inode_prefetch(agno, 0, pf_args[0]);
+					queue_work(&queues[i], process_ag_func, agno, pf_args[0]);
 				}
 			}
 			/*

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

end of thread, other threads:[~2007-08-10  6:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-03  3:13 REVIEW: fix xfs_repair phase 4 ag_stride with prefetch Barry Naujok
2007-08-10  6:08 ` Timothy Shimmin

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