]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Simplify taskqgroup inititialization.
authorMark Johnston <markj@FreeBSD.org>
Mon, 30 Mar 2020 14:22:52 +0000 (14:22 +0000)
committerMark Johnston <markj@FreeBSD.org>
Mon, 30 Mar 2020 14:22:52 +0000 (14:22 +0000)
commit59d50fe5ef5e670a3b4a7565e2fccde0098da160
treedddf33e5f08173f217dc01b9b456b26dadecfd8e
parent9338f1896514ed02f9f8c857390cb65daae0f4a7
Simplify taskqgroup inititialization.

taskqgroup initialization was broken into two steps:

1. allocate the taskqgroup structure, at SI_SUB_TASKQ;
2. initialize taskqueues, start taskqueue threads, enqueue "binder"
   tasks to bind threads to specific CPUs, at SI_SUB_SMP.

Step 2 tries to handle the case where tasks have already been attached
to a queue, by migrating them to their intended queue.  In particular,
tasks can't be enqueued before step 2 has completed.  This breaks NFS
mountroot on systems using an iflib-based driver when EARLY_AP_STARTUP
is not defined, since mountroot happens before SI_SUB_SMP in this case.

Simplify initialization: do all initialization except for CPU binding at
SI_SUB_TASKQ.  This means that until CPU binding is completed, group
tasks may be executed on a CPU other than that to which they were bound,
but this should not be a problem for existing users of the taskqgroup
KPIs.

Reported by: sbruno
Tested by: bdragon, sbruno
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24188
sys/kern/subr_gtaskqueue.c
sys/net/iflib.c
sys/sys/gtaskqueue.h