Added kfilnd work queue parameters to allow tuning.
The wq_high_priority parameter enables the work queue to run
as high priority. Default is enabled.
The wq_cpu_intensive parameter enables the work queue to run
as cpu intensive. Default is disabled.
The wq_max_active parameter sets the max in-flight work items
of the work queue. Default is 512.
The prov_cpu_exclusive parameter enables reserving one of a
CPT's CPUs for the exlusive use of the kfabric provider.
Default is disabled.
Test-Parameters: trivial
HPE-bug-id: LUS-11605
Signed-off-by: Ron Gredvig <ron.gredvig@hpe.com>
Change-Id: Ic4db95787a864efca3ea1234953ce3ea828f3594
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51786
Reviewed-by: Ian Ziemba <ian.ziemba@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
#include "kfilnd_tn.h"
#include "kfilnd_dev.h"
-/* These are temp constants to get stuff to compile */
-#define KFILND_DEFAULT_DEVICE "eth0"
-
-/* Some constants which should be turned into tunables */
-#define KFILND_MAX_WORKER_THREADS 4
-#define KFILND_MAX_EVENT_QUEUE 100
-
-#define KFILND_WQ_FLAGS (WQ_MEM_RECLAIM | WQ_HIGHPRI | WQ_SYSFS)
struct workqueue_struct *kfilnd_wq;
struct dentry *kfilnd_debug_dir;
static int __init kfilnd_init(void)
{
int rc;
+ unsigned int flags;
kfilnd_debug_dir = debugfs_create_dir("kfilnd", NULL);
goto err;
}
- kfilnd_wq = alloc_workqueue("kfilnd_wq", KFILND_WQ_FLAGS,
- WQ_MAX_ACTIVE);
+ flags = WQ_MEM_RECLAIM | WQ_SYSFS;
+ if (wq_cpu_intensive)
+ flags = flags | WQ_CPU_INTENSIVE;
+ if (wq_high_priority)
+ flags = flags | WQ_HIGHPRI;
+
+ kfilnd_wq = alloc_workqueue("kfilnd_wq", flags, wq_max_active);
if (!kfilnd_wq) {
rc = -ENOMEM;
CERROR("Failed to allocated kfilnd work queue\n");
extern unsigned int tx_cq_scale_factor;
extern unsigned int eq_size;
extern unsigned int immediate_rx_buf_count;
+extern unsigned int prov_cpu_exclusive;
+extern unsigned int wq_high_priority;
+extern unsigned int wq_cpu_intensive;
+extern unsigned int wq_max_active;
int kfilnd_tunables_setup(struct lnet_ni *ni);
int kfilnd_tunables_init(void);
struct kfilnd_cq *kfilnd_cq = context;
struct kfilnd_cq_work *cq_work;
unsigned int i;
-
- for (i = 0; i < kfilnd_cq->cq_work_count; i++) {
+ unsigned int start_count;
+
+ /* kcxi provider queues on signaling vector (index 0 cpu),
+ * optionally don't queue kfilnd on that cpu
+ */
+ start_count = kfilnd_cq->cq_work_count > 1 &&
+ prov_cpu_exclusive ? 1 : 0;
+ for (i = start_count; i < kfilnd_cq->cq_work_count; i++) {
cq_work = &kfilnd_cq->cq_works[i];
queue_work_on(cq_work->work_cpu, kfilnd_wq, &cq_work->work);
}
MODULE_PARM_DESC(immediate_rx_buf_count,
"Number of immediate multi-receive buffers posted per CPT");
+unsigned int prov_cpu_exclusive;
+module_param(prov_cpu_exclusive, uint, 0644);
+MODULE_PARM_DESC(prov_cpu_exclusive,
+ "Enables kfabric provider exclusive use of CPT's base CPU. Disabled by default. Set > 0 to enable.");
+
+unsigned int wq_high_priority = 1;
+module_param(wq_high_priority, uint, 0444);
+MODULE_PARM_DESC(wq_high_priority,
+ "Enables work queue to run at high priority. Enabled by default. Set > 0 to enable.");
+
+unsigned int wq_cpu_intensive;
+module_param(wq_cpu_intensive, uint, 0444);
+MODULE_PARM_DESC(wq_cpu_intensive,
+ "Marks work queue as CPU intensive. Disabled by default. Set > 0 to enable.");
+
+unsigned int wq_max_active = 512;
+module_param(wq_max_active, uint, 0444);
+MODULE_PARM_DESC(wq_max_active,
+ "Max work queue work items active per CPU. Default is 512. Valid values 0 to 512.");
+
/* Common LND network tunables. */
static int credits = 256;
module_param(credits, int, 0444);
return -EINVAL;
}
+ if (wq_max_active > WQ_MAX_ACTIVE)
+ wq_max_active = WQ_MAX_ACTIVE;
+
if (auth_key < 1) {
CERROR("Authorization key cannot be less than 1");
return -EINVAL;