Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern If the workqueue is using a prio less than PRI_KERN...



details:   https://anonhg.NetBSD.org/src/rev/201ab4d3868f
branches:  trunk
changeset: 781930:201ab4d3868f
user:      matt <matt%NetBSD.org@localhost>
date:      Sun Oct 07 22:16:21 2012 +0000

description:
If the workqueue is using a prio less than PRI_KERNEL, make sure KTHREAD_TS
is used when creating the kthread.

diffstat:

 sys/kern/subr_workqueue.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (27 lines):

diff -r 8673d01866a4 -r 201ab4d3868f sys/kern/subr_workqueue.c
--- a/sys/kern/subr_workqueue.c Sun Oct 07 20:43:18 2012 +0000
+++ b/sys/kern/subr_workqueue.c Sun Oct 07 22:16:21 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: subr_workqueue.c,v 1.32 2011/10/23 21:41:23 jym Exp $  */
+/*     $NetBSD: subr_workqueue.c,v 1.33 2012/10/07 22:16:21 matt Exp $ */
 
 /*-
  * Copyright (c)2002, 2005, 2006, 2007 YAMAMOTO Takashi,
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_workqueue.c,v 1.32 2011/10/23 21:41:23 jym Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_workqueue.c,v 1.33 2012/10/07 22:16:21 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/cpu.h>
@@ -161,6 +161,8 @@
        cv_init(&q->q_cv, wq->wq_name);
        SIMPLEQ_INIT(&q->q_queue);
        ktf = ((wq->wq_flags & WQ_MPSAFE) != 0 ? KTHREAD_MPSAFE : 0);
+       if (wq->wq_prio < PRI_KERNEL)
+               ktf |= KTHREAD_TS;
        if (ci) {
                error = kthread_create(wq->wq_prio, ktf, ci, workqueue_worker,
                    wq, &q->q_worker, "%s/%u", wq->wq_name, ci->ci_index);



Home | Main Index | Thread Index | Old Index