svn commit: r328801 - stable/11/sys/kern
Alexander Motin
mav at FreeBSD.org
Fri Feb 2 18:04:58 UTC 2018
Author: mav
Date: Fri Feb 2 18:04:57 2018
New Revision: 328801
URL: https://svnweb.freebsd.org/changeset/base/328801
Log:
MFC r307657 (by sbruno): 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.
Modified:
stable/11/sys/kern/subr_gtaskqueue.c
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/sys/kern/subr_gtaskqueue.c
==============================================================================
--- stable/11/sys/kern/subr_gtaskqueue.c Fri Feb 2 18:03:14 2018 (r328800)
+++ stable/11/sys/kern/subr_gtaskqueue.c Fri Feb 2 18:04:57 2018 (r328801)
@@ -656,11 +656,11 @@ taskqgroup_attach_deferred(struct taskqgroup *qgroup,
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++;
@@ -790,6 +790,9 @@ taskqgroup_bind(struct taskqgroup *qgroup)
* 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(>ask->bt_task, 0, 0, taskqgroup_binder, gtask);
@@ -856,7 +859,6 @@ _taskqgroup_adjust(struct taskqgroup *qgroup, int cnt,
LIST_INSERT_HEAD(>ask_head, gtask, gt_list);
}
}
-
mtx_unlock(&qgroup->tqg_lock);
while ((gtask = LIST_FIRST(>ask_head))) {
More information about the svn-src-all
mailing list