Date: Fri, 2 Feb 2018 18:03:14 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r328800 - stable/11/sys/kern Message-ID: <201802021803.w12I3EuF010818@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Fri Feb 2 18:03:14 2018 New Revision: 328800 URL: https://svnweb.freebsd.org/changeset/base/328800 Log: MFC r307567 (by sbruno): Assert that we're assigning a non-null taskqueue. ref: https://github.com/NextBSD/NextBSD/commit/535865d02c162e415d7436899cd6db5000a0cc7b Fix cpu assignment by assuring stride is non-zero, assert that all tasks have a valid taskqueue. ref: https://github.com/NextBSD/NextBSD/commit/db398176234fe3ce9f8e8b671f56000f8276feba Start cpu assignment from zero. ref: https://github.com/NextBSD/NextBSD/commit/d99d39b6b6c5dfac1eb440c41e36ebf4c897198e 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:12 2018 (r328799) +++ stable/11/sys/kern/subr_gtaskqueue.c Fri Feb 2 18:03:14 2018 (r328800) @@ -666,6 +666,7 @@ taskqgroup_attach_deferred(struct taskqgroup *qgroup, LIST_INSERT_HEAD(&qgroup->tqg_queue[qid].tgc_tasks, gtask, gt_list); + MPASS(qgroup->tqg_queue[qid].tgc_taskq != NULL); gtask->gt_taskqueue = qgroup->tqg_queue[qid].tgc_taskq; mtx_unlock(&qgroup->tqg_lock); } @@ -730,6 +731,7 @@ taskqgroup_attach_cpu_deferred(struct taskqgroup *qgro } qgroup->tqg_queue[qid].tgc_cnt++; LIST_INSERT_HEAD(&qgroup->tqg_queue[qid].tgc_tasks, gtask, gt_list); + MPASS(qgroup->tqg_queue[qid].tgc_taskq != NULL); gtask->gt_taskqueue = qgroup->tqg_queue[qid].tgc_taskq; mtx_unlock(&qgroup->tqg_lock); @@ -835,10 +837,10 @@ _taskqgroup_adjust(struct taskqgroup *qgroup, int cnt, */ cpu = old_cpu; for (i = old_cnt; i < cnt; i++) { - for (k = 0; k < qgroup->tqg_stride; k++) - cpu = CPU_NEXT(cpu); - taskqgroup_cpu_create(qgroup, i, cpu); + + for (k = 0; k < stride; k++) + cpu = CPU_NEXT(cpu); } mtx_lock(&qgroup->tqg_lock); qgroup->tqg_cnt = cnt; @@ -865,6 +867,15 @@ _taskqgroup_adjust(struct taskqgroup *qgroup, int cnt, taskqgroup_attach_deferred(qgroup, gtask); } +#ifdef INVARIANTS + mtx_lock(&qgroup->tqg_lock); + for (i = 0; i < qgroup->tqg_cnt; i++) { + MPASS(qgroup->tqg_queue[i].tgc_taskq != NULL); + LIST_FOREACH(gtask, &qgroup->tqg_queue[i].tgc_tasks, gt_list) + MPASS(gtask->gt_taskqueue != NULL); + } + mtx_unlock(&qgroup->tqg_lock); +#endif /* * If taskq thread count has been reduced. */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201802021803.w12I3EuF010818>