From 24ad848078fcf32ba92421894c27fa8abb452209 Mon Sep 17 00:00:00 2001 From: David Gwynne Date: Mon, 9 Feb 2015 03:15:42 +0000 Subject: we want to defer work traditionally (in openbsd) handled in an interrupt context to a taskq running in a thread. however, there is a concern that if we do that then we allow accidental use of sleeping APIs in this work, which will make it harder to move the work back to interrupts in the future. guenther and kettenis came up with the idea of marking a proc with CANTSLEEP which the sleep paths can check and panic on. this builds on that so you create taskqs that run with CANTSLEEP set except when they need to sleep for more tasks to run. the taskq_create api is changed to take a flags argument so users can specify CANTSLEEP. MPSAFE is also passed via this flags field now. this means archs that defined IPL_MPSAFE to 0 can now create mpsafe taskqs too. lots of discussion at s2k15 ok guenther@ miod@ mpi@ tedu@ pelikan@ --- sys/dev/pci/qle.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/dev/pci/qle.c') diff --git a/sys/dev/pci/qle.c b/sys/dev/pci/qle.c index dfebf899200..71019cb03e1 100644 --- a/sys/dev/pci/qle.c +++ b/sys/dev/pci/qle.c @@ -1,4 +1,4 @@ -/* $OpenBSD: qle.c,v 1.33 2015/01/27 03:17:36 dlg Exp $ */ +/* $OpenBSD: qle.c,v 1.34 2015/02/09 03:15:41 dlg Exp $ */ /* * Copyright (c) 2013, 2014 Jonathan Matthew @@ -625,7 +625,7 @@ qle_attach(struct device *parent, struct device *self, void *aux) goto free_scratch; } - sc->sc_update_taskq = taskq_create(DEVNAME(sc), 1, IPL_BIO); + sc->sc_update_taskq = taskq_create(DEVNAME(sc), 1, IPL_BIO, 0); task_set(&sc->sc_update_task, qle_do_update, sc); /* wait a bit for link to come up so we can scan and attach devices */ -- cgit v1.2.3