path: root/sys/sys/proc.h
diff options
authorJeff Roberson <jeff@FreeBSD.org>2019-12-15 21:26:50 +0000
committerJeff Roberson <jeff@FreeBSD.org>2019-12-15 21:26:50 +0000
commit686bcb5c14aba6e67524be84e125bfdd3514db9e (patch)
treeb10f0aa09f2e058a51defcaf01c077e1f19351fa /sys/sys/proc.h
parent1223b40ebaf44102da51bedbd20f79829177982e (diff)
schedlock 4/4
Don't hold the scheduler lock while doing context switches. Instead we unlock after selecting the new thread and switch within a spinlock section leaving interrupts and preemption disabled to prevent local concurrency. This means that mi_switch() is entered with the thread locked but returns without. This dramatically simplifies scheduler locking because we will not hold the schedlock while spinning on blocked lock in switch. This change has not been made to 4BSD but in principle it would be more straightforward. Discussed with: markj Reviewed by: kib Tested by: pho Differential Revision: https://reviews.freebsd.org/D22778
Notes: svn path=/head/; revision=355784
Diffstat (limited to 'sys/sys/proc.h')
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/sys/proc.h b/sys/sys/proc.h
index 6600cec2b951..680f6ebc9399 100644
--- a/sys/sys/proc.h
+++ b/sys/sys/proc.h
@@ -1075,7 +1075,7 @@ void killjobc(void);
int leavepgrp(struct proc *p);
int maybe_preempt(struct thread *td);
void maybe_yield(void);
-void mi_switch(int flags, struct thread *newtd);
+void mi_switch(int flags);
int p_candebug(struct thread *td, struct proc *p);
int p_cansee(struct thread *td, struct proc *p);
int p_cansched(struct thread *td, struct proc *p);