Author: sbruno
Date: Wed Oct 19 21:01:24 2016
New Revision: 307657
URL: https://svnweb.freebsd.org/changeset/base/307657

Log:
  Resolve whitespace diff to NextBSD.
  
  Check to see that the taskqueue thread count requires us to acutally
  iterate over the thread count to bind to cpus.
  
  Submitted by: mm...@nextbsd.org

Modified:
  head/sys/kern/subr_gtaskqueue.c

Modified: head/sys/kern/subr_gtaskqueue.c
==============================================================================
--- head/sys/kern/subr_gtaskqueue.c     Wed Oct 19 20:56:21 2016        
(r307656)
+++ head/sys/kern/subr_gtaskqueue.c     Wed Oct 19 21:01:24 2016        
(r307657)
@@ -52,7 +52,6 @@ static MALLOC_DEFINE(M_GTASKQUEUE, "task
 static void    gtaskqueue_thread_enqueue(void *);
 static void    gtaskqueue_thread_loop(void *arg);
 
-
 struct gtaskqueue_busy {
        struct gtask    *tb_running;
        TAILQ_ENTRY(gtaskqueue_busy) tb_link;
@@ -655,11 +654,11 @@ taskqgroup_attach_deferred(struct taskqg
        if (gtask->gt_irq != -1) {
                mtx_unlock(&qgroup->tqg_lock);
 
-                       CPU_ZERO(&mask);
-                       CPU_SET(cpu, &mask);
-                       intr_setaffinity(gtask->gt_irq, &mask);
+               CPU_ZERO(&mask);
+               CPU_SET(cpu, &mask);
+               intr_setaffinity(gtask->gt_irq, &mask);
 
-                       mtx_lock(&qgroup->tqg_lock);
+               mtx_lock(&qgroup->tqg_lock);
        }
        qgroup->tqg_queue[qid].tgc_cnt++;
 
@@ -789,6 +788,9 @@ taskqgroup_bind(struct taskqgroup *qgrou
         * Bind taskqueue threads to specific CPUs, if they have been assigned
         * one.
         */
+       if (qgroup->tqg_cnt == 1)
+               return;
+
        for (i = 0; i < qgroup->tqg_cnt; i++) {
                gtask = malloc(sizeof (*gtask), M_DEVBUF, M_WAITOK);
                GTASK_INIT(&gtask->bt_task, 0, 0, taskqgroup_binder, gtask);
@@ -855,7 +857,6 @@ _taskqgroup_adjust(struct taskqgroup *qg
                        LIST_INSERT_HEAD(&gtask_head, gtask, gt_list);
                }
        }
-
        mtx_unlock(&qgroup->tqg_lock);
 
        while ((gtask = LIST_FIRST(&gtask_head))) {
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to