On Tue, Oct 30, 2018 at 10:51:58AM -0700, Darrick J. Wong wrote: > On Tue, Oct 30, 2018 at 10:20:43PM +1100, Dave Chinner wrote: > > From: Dave Chinner <dchinner@xxxxxxxxxx> > > +static void > > +traverse_function( > > + struct workqueue *wq, > > + xfs_agnumber_t agno, > > + void *arg) > > +{ > > + struct ino_tree_node *irec; > > prefetch_args_t *pf_args = arg; > > + struct workqueue lwq; > > + struct xfs_mount *mp = wq->wq_ctx; > > + > > > > wait_for_inode_prefetch(pf_args); > > > > if (verbose) > > do_log(_(" - agno = %d\n"), agno); > > > > + /* > > + * The more AGs we have in flight at once, the fewer processing threads > > + * per AG. This means we don't overwhelm the machine with hundreds of > > + * threads when we start acting on lots of AGs at once. We just want > > + * enough that we can keep multiple CPUs busy across multiple AGs. > > + */ > > + workqueue_create_bound(&lwq, mp, ag_stride, 1000); > > Unlikely to happen, but do we need to check for errors here? > create_work_queue aborts repair if workqueue_create fails. Yup, will fix. -- Dave Chinner david@xxxxxxxxxxxxx