diff mbox series

[2/3] xfs: use unbounded workqueues for parallel work

Message ID 161142799399.2173328.8759691345812968430.stgit@magnolia (mailing list archive)
State New, archived
Headers show
Series xfs: speed up parallel workqueues | expand

Commit Message

Darrick J. Wong Jan. 23, 2021, 6:53 p.m. UTC
From: Darrick J. Wong <djwong@kernel.org>

Switch the pwork workqueue to unbounded, since the current user
(quotacheck) runs lengthy scans for each work item and we don't care
about dispatching the work on a warm cpu cache or anything like that.
Also set WQ_SYSFS so that we can monitor where the wq is running.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 fs/xfs/xfs_pwork.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Christoph Hellwig Jan. 24, 2021, 9:51 a.m. UTC | #1
On Sat, Jan 23, 2021 at 10:53:14AM -0800, Darrick J. Wong wrote:
> -	pctl->wq = alloc_workqueue("%s-%d", WQ_FREEZABLE, nr_threads, tag,
> -			current->pid);
> +	pctl->wq = alloc_workqueue("%s-%d", WQ_UNBOUND | WQ_SYSFS | WQ_FREEZABLE,
> +			nr_threads, tag, current->pid);

This adds an overly long line.


But more importantly I think xfs.txt needs to grow a section that we now
can tune XFS parameters through the workqueue sysfs files, especially as
right now I have no idea how to find those based on an actual device or
XFS mount I need to adjust the parameters for.
Darrick J. Wong Jan. 25, 2021, 11:18 p.m. UTC | #2
On Sun, Jan 24, 2021 at 09:51:50AM +0000, Christoph Hellwig wrote:
> On Sat, Jan 23, 2021 at 10:53:14AM -0800, Darrick J. Wong wrote:
> > -	pctl->wq = alloc_workqueue("%s-%d", WQ_FREEZABLE, nr_threads, tag,
> > -			current->pid);
> > +	pctl->wq = alloc_workqueue("%s-%d", WQ_UNBOUND | WQ_SYSFS | WQ_FREEZABLE,
> > +			nr_threads, tag, current->pid);
> 
> This adds an overly long line.

Changed.

> But more importantly I think xfs.txt needs to grow a section that we now
> can tune XFS parameters through the workqueue sysfs files, especially as
> right now I have no idea how to find those based on an actual device or
> XFS mount I need to adjust the parameters for.

Ok, I'll add a section.

--D
diff mbox series

Patch

diff --git a/fs/xfs/xfs_pwork.c b/fs/xfs/xfs_pwork.c
index 33fe952cdaf8..704a1c2af90c 100644
--- a/fs/xfs/xfs_pwork.c
+++ b/fs/xfs/xfs_pwork.c
@@ -70,8 +70,8 @@  xfs_pwork_init(
 #endif
 	trace_xfs_pwork_init(mp, nr_threads, current->pid);
 
-	pctl->wq = alloc_workqueue("%s-%d", WQ_FREEZABLE, nr_threads, tag,
-			current->pid);
+	pctl->wq = alloc_workqueue("%s-%d", WQ_UNBOUND | WQ_SYSFS | WQ_FREEZABLE,
+			nr_threads, tag, current->pid);
 	if (!pctl->wq)
 		return -ENOMEM;
 	pctl->work_fn = work_fn;