summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsephe <sephe@FreeBSD.org>2017-10-13 04:55:54 +0000
committerLuiz Souza <luiz@netgate.com>2018-02-19 14:51:48 -0300
commit39eb19ab2b6c1de1c3864ee90d8570fca27edaff (patch)
tree03436f3e88a9e8874eaa9c3d1312ae71da2ae259
parentcbd1eed96e34173b1f65e50333ea628a0db27366 (diff)
downloadFreeBSD-src-39eb19ab2b6c1de1c3864ee90d8570fca27edaff.zip
FreeBSD-src-39eb19ab2b6c1de1c3864ee90d8570fca27edaff.tar.gz
MFC 324487
hyperv/vmbus: Add tunable to pin/unpin event tasks. Event tasks are pinned to their respective CPU by default, in the same fashion as they were. Unpin the event tasks by setting hw.vmbus.pin_evttask to 0, if certain CPUs serve special purpose. Sponsored by: Microsoft (cherry picked from commit 9cb4809ce143d4b9253bda2ec391079de7ea3f2c)
-rw-r--r--sys/dev/hyperv/vmbus/vmbus.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/sys/dev/hyperv/vmbus/vmbus.c b/sys/dev/hyperv/vmbus/vmbus.c
index dc924d0..e8c683f 100644
--- a/sys/dev/hyperv/vmbus/vmbus.c
+++ b/sys/dev/hyperv/vmbus/vmbus.c
@@ -128,6 +128,13 @@ static void vmbus_event_proc_dummy(struct vmbus_softc *,
static struct vmbus_softc *vmbus_sc;
+SYSCTL_NODE(_hw, OID_AUTO, vmbus, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL,
+ "Hyper-V vmbus");
+
+static int vmbus_pin_evttask = 1;
+SYSCTL_INT(_hw_vmbus, OID_AUTO, pin_evttask, CTLFLAG_RDTUN,
+ &vmbus_pin_evttask, 0, "Pin event tasks to their respective CPU");
+
extern inthand_t IDTVEC(vmbus_isr);
static const uint32_t vmbus_version[] = {
@@ -905,10 +912,16 @@ vmbus_intr_setup(struct vmbus_softc *sc)
VMBUS_PCPU_GET(sc, event_tq, cpu) = taskqueue_create_fast(
"hyperv event", M_WAITOK, taskqueue_thread_enqueue,
VMBUS_PCPU_PTR(sc, event_tq, cpu));
- CPU_SETOF(cpu, &cpu_mask);
- taskqueue_start_threads_cpuset(
- VMBUS_PCPU_PTR(sc, event_tq, cpu), 1, PI_NET, &cpu_mask,
- "hvevent%d", cpu);
+ if (vmbus_pin_evttask) {
+ CPU_SETOF(cpu, &cpu_mask);
+ taskqueue_start_threads_cpuset(
+ VMBUS_PCPU_PTR(sc, event_tq, cpu), 1, PI_NET,
+ &cpu_mask, "hvevent%d", cpu);
+ } else {
+ taskqueue_start_threads(
+ VMBUS_PCPU_PTR(sc, event_tq, cpu), 1, PI_NET,
+ "hvevent%d", cpu);
+ }
/*
* Setup tasks and taskqueues to handle messages.
OpenPOWER on IntegriCloud