summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-07-10 03:20:13 -0400
committerIan Moffett <ian@osmora.org>2025-07-10 03:20:13 -0400
commitd7c7f87432aa2d20eefd3b4f38a78eba5e7373a0 (patch)
treef25aa1cb5c82ff0cced4b19022d284f60e69be2c /sys
parente2754bbe4f77b0d1d7270e9bd19af5c6e09c5739 (diff)
kernel: sched: Greatly simplify yield logic
The purpose of yielding to the scheduler is to tell it you want to preempt early in order to not starve processes while waiting for I/O. We can trigger the timer earlier on for stability as a ~10 usec delay should not be too terrible. Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/kern_sched.c19
1 files changed, 0 insertions, 19 deletions
diff --git a/sys/kern/kern_sched.c b/sys/kern/kern_sched.c
index 774ba71..30036c0 100644
--- a/sys/kern/kern_sched.c
+++ b/sys/kern/kern_sched.c
@@ -258,27 +258,8 @@ sched_enter(void)
void
sched_yield(void)
{
- struct proc *td;
- struct cpu_info *ci = this_cpu();
-
- if ((td = ci->curtd) == NULL) {
- return;
- }
-
- td->rested = true;
-
- /* FIXME: Hang yielding when waited on */
- if (ISSET(td->flags, PROC_WAITED)) {
- return;
- }
-
- ci->curtd = NULL;
md_inton();
sched_oneshot(false);
-
- md_hlt();
- md_intoff();
- ci->curtd = td;
}
void