summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2019-07-05 12:10:10 +0000
committerkettenis <kettenis@openbsd.org>2019-07-05 12:10:10 +0000
commitae8374b9171f55e4b2456a89c96c72574d7dfca7 (patch)
tree8ebec2fbf2c34176b81243b8e26e83086261e429
parentFix manual openssl(1) dgst (diff)
downloadwireguard-openbsd-ae8374b9171f55e4b2456a89c96c72574d7dfca7.tar.xz
wireguard-openbsd-ae8374b9171f55e4b2456a89c96c72574d7dfca7.zip
Use multi-threaded task queues to prevent deadlocks in the case where a
tasks sleeps and expects to be woken up by a task that will be submitted to the same task queue. That scenario happens in the output hotplug code. We probably should spend some time on tuning the number of threads but let's make things work correctly first. Based on some serious debugging done by Sven M. Hallberg. ok jsg@
-rw-r--r--sys/dev/pci/drm/drm_linux.c8
-rw-r--r--sys/dev/pci/drm/i915/intel_hotplug.c1
2 files changed, 4 insertions, 5 deletions
diff --git a/sys/dev/pci/drm/drm_linux.c b/sys/dev/pci/drm/drm_linux.c
index 0b86912cb72..1c5405071ca 100644
--- a/sys/dev/pci/drm/drm_linux.c
+++ b/sys/dev/pci/drm/drm_linux.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: drm_linux.c,v 1.38 2019/06/09 12:58:30 kettenis Exp $ */
+/* $OpenBSD: drm_linux.c,v 1.39 2019/07/05 12:10:10 kettenis Exp $ */
/*
* Copyright (c) 2013 Jonathan Gray <jsg@openbsd.org>
* Copyright (c) 2015, 2016 Mark Kettenis <kettenis@openbsd.org>
@@ -1399,15 +1399,15 @@ drm_linux_init(void)
{
if (system_wq == NULL) {
system_wq = (struct workqueue_struct *)
- taskq_create("drmwq", 1, IPL_HIGH, 0);
+ taskq_create("drmwq", 4, IPL_HIGH, 0);
}
if (system_unbound_wq == NULL) {
system_unbound_wq = (struct workqueue_struct *)
- taskq_create("drmubwq", 1, IPL_HIGH, 0);
+ taskq_create("drmubwq", 4, IPL_HIGH, 0);
}
if (system_long_wq == NULL) {
system_long_wq = (struct workqueue_struct *)
- taskq_create("drmlwq", 1, IPL_HIGH, 0);
+ taskq_create("drmlwq", 4, IPL_HIGH, 0);
}
if (taskletq == NULL)
diff --git a/sys/dev/pci/drm/i915/intel_hotplug.c b/sys/dev/pci/drm/i915/intel_hotplug.c
index 0ed2bad1348..9a801813023 100644
--- a/sys/dev/pci/drm/i915/intel_hotplug.c
+++ b/sys/dev/pci/drm/i915/intel_hotplug.c
@@ -619,7 +619,6 @@ void intel_hpd_init_work(struct drm_i915_private *dev_priv)
INIT_WORK(&dev_priv->hotplug.hotplug_work, i915_hotplug_work_func);
INIT_WORK(&dev_priv->hotplug.dig_port_work, i915_digport_work_func);
INIT_WORK(&dev_priv->hotplug.poll_init_work, i915_hpd_poll_init_work);
- dev_priv->hotplug.poll_init_work.tq = systq;
INIT_DELAYED_WORK(&dev_priv->hotplug.reenable_work,
intel_hpd_irq_storm_reenable_work);
}