Merge of master-melb:xfs-cmds:29143a by kenmcd.
Declare AG stride variable
EXTERN int report_interval;
EXTERN __uint64_t *prog_rpt_done;
+EXTERN int ag_stride;
+
#endif /* _XFS_REPAIR_GLOBAL_H */
if (do_prefetch)
libxfs_lio_allocate();
}
- thread_init();
}
" - process known inodes and perform inode discovery...\n"));
set_progress_msg(PROG_FMT_PROCESS_INO, (__uint64_t) mp->m_sb.sb_icount);
- for (i = 0; i < mp->m_sb.sb_agcount; i++) {
- queue_work(parallel_p3_process_aginodes, mp, i);
+ if (ag_stride) {
+ int steps = (mp->m_sb.sb_agcount + ag_stride - 1) / ag_stride;
+ for (i = 0; i < steps; i++)
+ for (j = i; j < mp->m_sb.sb_agcount; j += ag_stride)
+ queue_work(parallel_p3_process_aginodes, mp, j);
+ } else {
+ for (i = 0; i < mp->m_sb.sb_agcount; i++)
+ parallel_p3_process_aginodes(mp, i);
}
wait_for_workers();
print_final_rpt();
do_log(_(" - check for inodes claiming duplicate blocks...\n"));
set_progress_msg(PROG_FMT_DUP_BLOCKS, (__uint64_t) mp->m_sb.sb_icount);
- for (i = 0; i < mp->m_sb.sb_agcount; i++) {
- /*
- * ok, now process the inodes -- signal 2-pass check per inode.
- * first pass checks if the inode conflicts with a known
- * duplicate extent. if so, the inode is cleared and second
- * pass is skipped. second pass sets the block bitmap
- * for all blocks claimed by the inode. directory
- * and attribute processing is turned OFF since we did that
- * already in phase 3.
- */
- queue_work(parallel_p4_process_aginodes, mp, i);
+
+ /*
+ * ok, now process the inodes -- signal 2-pass check per inode.
+ * first pass checks if the inode conflicts with a known
+ * duplicate extent. if so, the inode is cleared and second
+ * pass is skipped. second pass sets the block bitmap
+ * for all blocks claimed by the inode. directory
+ * and attribute processing is turned OFF since we did that
+ * already in phase 3.
+ */
+ if (ag_stride) {
+ int steps = (mp->m_sb.sb_agcount + ag_stride - 1) / ag_stride;
+ for (i = 0; i < steps; i++)
+ for (j = i; j < mp->m_sb.sb_agcount; j += ag_stride)
+ queue_work(parallel_p4_process_aginodes, mp, j);
+ } else {
+ for (i = 0; i < mp->m_sb.sb_agcount; i++)
+ parallel_p4_process_aginodes(mp, i);
}
+
wait_for_workers();
print_final_rpt();
"pfdir",
#define PREFETCH_AIO_CNT 6
"pfaio",
-#define THREAD_CNT 7
- "thread",
+#define AG_STRIDE 7
+ "ag_stride",
NULL
};
fs_has_extflgbit_allowed = 1;
pre_65_beta = 0;
fs_shared_allowed = 1;
+ ag_stride = 0;
+ thread_count = 0;
+ do_parallel = 0;
report_interval = PROG_RPT_DEFAULT;
/*
case PREFETCH_AIO_CNT:
libxfs_lio_aio_count = (int) strtol(val, 0, 0);
break;
- case THREAD_CNT:
- thread_count = (int) strtol(val, 0, 0);
+ case AG_STRIDE:
+ ag_stride = (int) strtol(val, 0, 0);
break;
default:
unknown('o', val);
max_symlink_blocks = howmany(MAXPATHLEN - 1, mp->m_sb.sb_blocksize);
inodes_per_cluster = XFS_INODE_CLUSTER_SIZE(mp) >> mp->m_sb.sb_inodelog;
+ if (ag_stride) {
+ do_parallel = 1;
+ thread_count = (mp->m_sb.sb_agcount + ag_stride - 1) / ag_stride;
+ thread_init();
+ }
+
if (do_parallel && report_interval) {
init_progress_rpt();
msgbuf = malloc(DURATION_BUF_SIZE);