there must be only one SYSINIT with SI_SUB_RUN_SCHEDULER+SI_ORDER_ANY order

SI_SUB_RUN_SCHEDULER+SI_ORDER_ANY should only be used to call
scheduler() function which turns the initial thread into swapper proper
and thus there is no further SYSINIT processing.
Other SYSINITs with SI_SUB_RUN_SCHEDULER+SI_ORDER_ANY may get ordered
after scheduler() and thus never executed.  That particular relative
order is semi-arbitrary.

Thus, change such places to use SI_ORDER_MIDDLE.
Also, use SI_ORDER_MIDDLE instead of correct, but less appealing,
SI_ORDER_ANY - 1.

MFC after:	1 week
This commit is contained in:
Andriy Gapon 2010-09-30 17:05:23 +00:00
parent 10b2a365a0
commit 7b9df13bcd
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=213305
3 changed files with 3 additions and 3 deletions

View File

@ -126,7 +126,7 @@ oktousecallout(void *data __unused)
{
calloutok = 1;
}
SYSINIT(gdbhack, SI_SUB_RUN_SCHEDULER, SI_ORDER_ANY, oktousecallout, NULL);
SYSINIT(gdbhack, SI_SUB_RUN_SCHEDULER, SI_ORDER_MIDDLE, oktousecallout, NULL);
static void
gdb_cnputc(struct consdev *cp, int c)

View File

@ -1035,5 +1035,5 @@ start_periodic_resettodr(void *arg __unused)
periodic_resettodr, NULL);
}
SYSINIT(periodic_resettodr, SI_SUB_RUN_SCHEDULER, SI_ORDER_ANY - 1,
SYSINIT(periodic_resettodr, SI_SUB_RUN_SCHEDULER, SI_ORDER_MIDDLE,
start_periodic_resettodr, NULL);

View File

@ -173,7 +173,7 @@ static void name ## _add_proc(void *dummy __unused) \
#name, CTLTYPE_LONG|CTLFLAG_RD|CTLFLAG_MPSAFE, \
ptr, 0, sysctl_dpcpu_long, "LU", descr); \
} \
SYSINIT(name, SI_SUB_RUN_SCHEDULER, SI_ORDER_ANY, name ## _add_proc, NULL);
SYSINIT(name, SI_SUB_RUN_SCHEDULER, SI_ORDER_MIDDLE, name ## _add_proc, NULL);
#define SCHED_STAT_DEFINE(name, descr) \
DPCPU_DEFINE(unsigned long, name); \