Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Oct 2017 08:16:55 +0000 (UTC)
From:      Sepherosa Ziehau <sephe@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r324487 - head/sys/dev/hyperv/vmbus
Message-ID:  <201710100816.v9A8Gt6l061918@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: sephe
Date: Tue Oct 10 08:16:55 2017
New Revision: 324487
URL: https://svnweb.freebsd.org/changeset/base/324487

Log:
  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.
  
  MFC after:	3 days
  Sponsored by:	Microsoft

Modified:
  head/sys/dev/hyperv/vmbus/vmbus.c

Modified: head/sys/dev/hyperv/vmbus/vmbus.c
==============================================================================
--- head/sys/dev/hyperv/vmbus/vmbus.c	Tue Oct 10 08:07:05 2017	(r324486)
+++ head/sys/dev/hyperv/vmbus/vmbus.c	Tue Oct 10 08:16:55 2017	(r324487)
@@ -128,6 +128,13 @@ static void			vmbus_event_proc_dummy(struct vmbus_soft
 
 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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201710100816.v9A8Gt6l061918>