Skip to content

Commit

Permalink
Resolve whitespace diff to NextBSD.
Browse files Browse the repository at this point in the history
Check to see that the taskqueue thread count requires us to acutally
iterate over the thread count to bind to cpus.

Submitted by:	[email protected]
  • Loading branch information
seanbruno committed Oct 19, 2016
1 parent 7272e5a commit a7e1406
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions sys/kern/subr_gtaskqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ static MALLOC_DEFINE(M_GTASKQUEUE, "taskqueue", "Task Queues");
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;
Expand Down Expand Up @@ -655,11 +654,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++;

Expand Down Expand Up @@ -789,6 +788,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(&gtask->bt_task, 0, 0, taskqgroup_binder, gtask);
Expand Down Expand Up @@ -855,7 +857,6 @@ _taskqgroup_adjust(struct taskqgroup *qgroup, int cnt, int stride)
LIST_INSERT_HEAD(&gtask_head, gtask, gt_list);
}
}

mtx_unlock(&qgroup->tqg_lock);

while ((gtask = LIST_FIRST(&gtask_head))) {
Expand Down

0 comments on commit a7e1406

Please sign in to comment.