mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
- Assert sched_lock in upcall_remove() since it is needed there and all
callers already lock it there. - Lock sched_lock slightly earlier in kse_create() so that it covers kg_numupcalls.
This commit is contained in:
parent
63993cf011
commit
654e92bf10
1 changed files with 3 additions and 1 deletions
|
|
@ -111,6 +111,7 @@ void
|
|||
upcall_remove(struct thread *td)
|
||||
{
|
||||
|
||||
mtx_assert(&sched_lock, MA_OWNED);
|
||||
if (td->td_upcall != NULL) {
|
||||
td->td_upcall->ku_owner = NULL;
|
||||
upcall_unlink(td->td_upcall);
|
||||
|
|
@ -653,7 +654,9 @@ kse_create(struct thread *td, struct kse_create_args *uap)
|
|||
* not help performance.
|
||||
*/
|
||||
PROC_LOCK(p);
|
||||
mtx_lock_spin(&sched_lock);
|
||||
if (newkg->kg_numupcalls >= ncpus) {
|
||||
mtx_unlock_spin(&sched_lock);
|
||||
PROC_UNLOCK(p);
|
||||
upcall_free(newku);
|
||||
return (EPROCLIM);
|
||||
|
|
@ -675,7 +678,6 @@ kse_create(struct thread *td, struct kse_create_args *uap)
|
|||
* Make the new upcall available to the ksegrp.
|
||||
* It may or may not use it, but it's available.
|
||||
*/
|
||||
mtx_lock_spin(&sched_lock);
|
||||
PROC_UNLOCK(p);
|
||||
upcall_link(newku, newkg);
|
||||
if (mbx.km_quantum)
|
||||
|
|
|
|||
Loading…
Reference in a new issue