diff options
author | mav <mav@FreeBSD.org> | 2018-02-02 18:04:57 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2018-02-02 18:04:57 +0000 |
commit | 3806fc30e4d00ce85f6786a5a9b3ea7f2ed15d07 (patch) | |
tree | cc0d20106e7432dc9b99d7ad4daebd15bb4a583d | |
parent | 2d870dc158a4bb94ef259f892fc23e1f9dfec8d7 (diff) | |
download | FreeBSD-src-3806fc30e4d00ce85f6786a5a9b3ea7f2ed15d07.zip FreeBSD-src-3806fc30e4d00ce85f6786a5a9b3ea7f2ed15d07.tar.gz |
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.
-rw-r--r-- | sys/kern/subr_gtaskqueue.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/kern/subr_gtaskqueue.c b/sys/kern/subr_gtaskqueue.c index b54e4b8..ab452e4 100644 --- a/sys/kern/subr_gtaskqueue.c +++ b/sys/kern/subr_gtaskqueue.c @@ -656,11 +656,11 @@ taskqgroup_attach_deferred(struct taskqgroup *qgroup, struct grouptask *gtask) 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, int stride) LIST_INSERT_HEAD(>ask_head, gtask, gt_list); } } - mtx_unlock(&qgroup->tqg_lock); while ((gtask = LIST_FIRST(>ask_head))) { |