Commit 5797b1c18919 ("workqueue: Implement system-wide nr_active enforcement for unbound workqueues") modified the maximum number of active works that an unbound workqueue can handle to at most WQ_DFL_MIN_ACTIVE (8 by default). This commit thus limits the number of active dm-zoned chunk works that execute concurrently on a single NUMA node machine. This reduction results in garbage collection performance degradation which manifests itself with longer unmount time with the xfs file system on dm-zoned devices. To restore unmount duration with dm-zoned devices, drop the WQ_UNBOUND flag for the chunk workqueue, thus allowing more than WQ_DFL_MIN_ACTIVE chunk works. Though this change bounds all chunk works to the same CPU, it provides more parallelism and improved performance. The table below shows the average xfs unmount time of 10 times measurements, using a single NUMA node machine with 32 CPUs. The xfs volume was prepared on dm-zoned devices on top of an SMR HDD with 26GB dm-linear clip, then filled with data files before executing unmount. Kernel | Unmount time ---------------------+-------------- v6.8 | 29m 3s v6.9-rc2 | 34m 17s v6.9-rc2 + this fix | 27m 12s Suggested-by: Damien Le Moal <dlemoal@xxxxxxxxxx> Fixes: 5797b1c18919 ("workqueue: Implement system-wide nr_active enforcement for unbound workqueues") Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@xxxxxxx> --- drivers/md/dm-zoned-target.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/md/dm-zoned-target.c b/drivers/md/dm-zoned-target.c index 621794a9edd6..3d6383c7b9b2 100644 --- a/drivers/md/dm-zoned-target.c +++ b/drivers/md/dm-zoned-target.c @@ -900,8 +900,7 @@ static int dmz_ctr(struct dm_target *ti, unsigned int argc, char **argv) /* Chunk BIO work */ mutex_init(&dmz->chunk_lock); INIT_RADIX_TREE(&dmz->chunk_rxtree, GFP_NOIO); - dmz->chunk_wq = alloc_workqueue("dmz_cwq_%s", - WQ_MEM_RECLAIM | WQ_UNBOUND, 0, + dmz->chunk_wq = alloc_workqueue("dmz_cwq_%s", WQ_MEM_RECLAIM, 0, dmz_metadata_label(dmz->metadata)); if (!dmz->chunk_wq) { ti->error = "Create chunk workqueue failed"; -- 2.44.0