| 795 | } |
| 796 | |
| 797 | struct taskqgroup * |
| 798 | taskqgroup_create(const char *name, int cnt, int stride) |
| 799 | { |
| 800 | struct taskqgroup *qgroup; |
| 801 | int cpu, i, j; |
| 802 | |
| 803 | qgroup = malloc(sizeof(*qgroup), M_GTASKQUEUE, M_WAITOK | M_ZERO); |
| 804 | mtx_init(&qgroup->tqg_lock, "taskqgroup", NULL, MTX_DEF); |
| 805 | qgroup->tqg_name = name; |
| 806 | qgroup->tqg_cnt = cnt; |
| 807 | |
| 808 | for (cpu = i = 0; i < cnt; i++) { |
| 809 | taskqgroup_cpu_create(qgroup, i, cpu); |
| 810 | for (j = 0; j < stride; j++) |
| 811 | cpu = CPU_NEXT(cpu); |
| 812 | } |
| 813 | return (qgroup); |
| 814 | } |
| 815 | |
| 816 | void |
| 817 | taskqgroup_destroy(struct taskqgroup *qgroup) |
nothing calls this directly
no test coverage detected