[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240717091451.111158-2-jacky_gam_2001@163.com>
Date: Wed, 17 Jul 2024 17:14:50 +0800
From: Ping Gan <jacky_gam_2001@....com>
To: hare@...e.de,
sagi@...mberg.me,
hch@....de,
kch@...dia.com,
linux-nvme@...ts.infradead.org,
linux-kernel@...r.kernel.org
Cc: ping.gan@...l.com,
Ping Gan <jacky_gam_2001@....com>
Subject: [PATCH v2 1/2] nvmet-tcp: add unbound_wq support for nvmet-tcp
To define a module parameter use_unbound_wq to enable unbound
workqueue to handle TCP's IO.
Signed-off-by: Ping Gan <jacky_gam_2001@....com>
Reviewed-by: Hannes Reinecke <hare@...e.de>
---
drivers/nvme/target/tcp.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/nvme/target/tcp.c b/drivers/nvme/target/tcp.c
index 5bff0d5464d1..f71d56843e1a 100644
--- a/drivers/nvme/target/tcp.c
+++ b/drivers/nvme/target/tcp.c
@@ -73,6 +73,10 @@ device_param_cb(idle_poll_period_usecs, &set_param_ops,
MODULE_PARM_DESC(idle_poll_period_usecs,
"nvmet tcp io_work poll till idle time period in usecs: Default 0");
+static bool use_unbound_wq;
+module_param(use_unbound_wq, bool, 0444);
+MODULE_PARM_DESC(use_unbound_wq, "use unbound workqueue to handle IO request: Default false");
+
#ifdef CONFIG_NVME_TARGET_TCP_TLS
/*
* TLS handshake timeout
@@ -2196,9 +2200,13 @@ static const struct nvmet_fabrics_ops nvmet_tcp_ops = {
static int __init nvmet_tcp_init(void)
{
int ret;
+ unsigned int flags;
+
+ flags = WQ_MEM_RECLAIM | WQ_HIGHPRI;
+ if (use_unbound_wq)
+ flags |= (WQ_UNBOUND | WQ_SYSFS);
- nvmet_tcp_wq = alloc_workqueue("nvmet_tcp_wq",
- WQ_MEM_RECLAIM | WQ_HIGHPRI, 0);
+ nvmet_tcp_wq = alloc_workqueue("nvmet_tcp_wq", flags, 0);
if (!nvmet_tcp_wq)
return -ENOMEM;
--
2.26.2
Powered by blists - more mailing lists