- Properly initialize the base priority (td_base_pri) of thread0 to PVM
to match the desired priority in td_priority. Otherwise the first time thread0 used a borrowed priority it would drop down to PUSER instead of PVM. - Explicitly initialize the starting priority of new kprocs to PVM to avoid inheriting some random priority from thread0. MFC after: 2 weeks
This commit is contained in:
parent
22d19207e9
commit
fd05807822
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=217079
@ -462,7 +462,7 @@ proc0_init(void *dummy __unused)
|
||||
td->td_base_user_pri = PUSER;
|
||||
td->td_lend_user_pri = PRI_MAX;
|
||||
td->td_priority = PVM;
|
||||
td->td_base_pri = PUSER;
|
||||
td->td_base_pri = PVM;
|
||||
td->td_oncpu = 0;
|
||||
td->td_flags = TDF_INMEM|TDP_KTHREAD;
|
||||
td->td_cpuset = cpuset_thread0();
|
||||
|
@ -117,14 +117,15 @@ kproc_create(void (*func)(void *), void *arg,
|
||||
|
||||
/* call the processes' main()... */
|
||||
cpu_set_fork_handler(td, func, arg);
|
||||
thread_lock(td);
|
||||
TD_SET_CAN_RUN(td);
|
||||
sched_prio(td, PVM);
|
||||
sched_user_prio(td, PUSER);
|
||||
|
||||
/* Delay putting it on the run queue until now. */
|
||||
if (!(flags & RFSTOPPED)) {
|
||||
thread_lock(td);
|
||||
if (!(flags & RFSTOPPED))
|
||||
sched_add(td, SRQ_BORING);
|
||||
thread_unlock(td);
|
||||
}
|
||||
thread_unlock(td);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user