[PATCH v2 1/2] nvmet-tcp: add unbound_wq support for nvmet-tcp
Ping Gan
jacky_gam_2001 at 163.com
Wed Jul 17 02:14:50 PDT 2024
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 at 163.com>
Reviewed-by: Hannes Reinecke <hare at suse.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
More information about the Linux-nvme
mailing list