DM-Devel Archive mirror
 help / color / mirror / Atom feed
From: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
To: dm-devel@lists.linux.dev, Mike Snitzer <snitzer@kernel.org>
Cc: Tejun Heo <tj@kernel.org>, Damien Le Moal <dlemoal@kernel.org>,
	Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Subject: [PATCH] dm zoned: Drop the WQ_UNBOUND flag for the chunk workqueue
Date: Wed, 10 Apr 2024 17:45:31 +0900	[thread overview]
Message-ID: <20240410084531.2134621-1-shinichiro.kawasaki@wdc.com> (raw)

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@kernel.org>
Fixes: 5797b1c18919 ("workqueue: Implement system-wide nr_active enforcement for unbound workqueues")
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
---
 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


             reply	other threads:[~2024-04-10  8:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-10  8:45 Shin'ichiro Kawasaki [this message]
2024-04-10 17:51 ` [PATCH] dm zoned: Drop the WQ_UNBOUND flag for the chunk workqueue Tejun Heo
2024-04-11  4:38   ` Shinichiro Kawasaki
2024-04-12 17:25     ` Tejun Heo
2024-04-15  2:24       ` Shinichiro Kawasaki
2024-04-23  0:43         ` Tejun Heo
2024-04-23 16:31           ` Tejun Heo
2024-04-24  0:36             ` Shinichiro Kawasaki
2024-04-24  3:35               ` Tejun Heo
2024-04-25 11:14                 ` Shinichiro Kawasaki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240410084531.2134621-1-shinichiro.kawasaki@wdc.com \
    --to=shinichiro.kawasaki@wdc.com \
    --cc=dlemoal@kernel.org \
    --cc=dm-devel@lists.linux.dev \
    --cc=snitzer@kernel.org \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).