[1/3] xfs_scrub: bump work_threads to include the controller thread
diff mbox series

Message ID 156944744378.300433.8796143133184996618.stgit@magnolia
State Superseded
Headers show
Series
  • xfs_scrub: deferred labelling to save time
Related show

Commit Message

Darrick J. Wong Sept. 25, 2019, 9:37 p.m. UTC
From: Darrick J. Wong <darrick.wong@oracle.com>

Bump @work_threads in the scrub phase setup function because we will
soon want the main thread (i.e. the one that coordinates workers) to be
factored into per-thread data structures.  We'll need this in an
upcoming patch to render error string prefixes to preallocated
per-thread buffers.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 scrub/xfs_scrub.c |    7 +++++++
 1 file changed, 7 insertions(+)

Comments

Eric Sandeen Oct. 21, 2019, 8:16 p.m. UTC | #1
On 9/25/19 4:37 PM, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Bump @work_threads in the scrub phase setup function because we will
> soon want the main thread (i.e. the one that coordinates workers) to be
> factored into per-thread data structures.  We'll need this in an
> upcoming patch to render error string prefixes to preallocated
> per-thread buffers.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

Reviewed-by: Eric Sandeen <sandeen@redhat.com>

Patch
diff mbox series

diff --git a/scrub/xfs_scrub.c b/scrub/xfs_scrub.c
index aa98caaa..3b347d86 100644
--- a/scrub/xfs_scrub.c
+++ b/scrub/xfs_scrub.c
@@ -458,6 +458,13 @@  run_scrub_phases(
 					&work_threads, &rshift);
 			if (!moveon)
 				break;
+
+			/*
+			 * The thread that starts the worker threads is also
+			 * allowed to contribute to the progress counters and
+			 * whatever other per-thread data we need to allocate.
+			 */
+			work_threads++;
 			moveon = progress_init_phase(ctx, progress_fp, phase,
 					max_work, rshift, work_threads);
 		} else {