From 2286c11fdedee6a9de522cebc12b77049c41c7be Mon Sep 17 00:00:00 2001 From: mpi Date: Wed, 28 Feb 2024 13:43:44 +0000 Subject: [PATCH] No need to kick a CPU twice when putting a thread on its runqueue. From Christian Ludwig, ok claudio@ --- sys/kern/kern_sched.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/kern/kern_sched.c b/sys/kern/kern_sched.c index 731c615284d..dd54f98d4b8 100644 --- a/sys/kern/kern_sched.c +++ b/sys/kern/kern_sched.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sched.c,v 1.94 2024/01/24 19:23:38 cheloha Exp $ */ +/* $OpenBSD: kern_sched.c,v 1.95 2024/02/28 13:43:44 mpi Exp $ */ /* * Copyright (c) 2007, 2008 Artur Grabowski * @@ -293,8 +293,7 @@ setrunqueue(struct cpu_info *ci, struct proc *p, uint8_t prio) if (cpuset_isset(&sched_idle_cpus, p->p_cpu)) cpu_unidle(p->p_cpu); - - if (prio < spc->spc_curpriority) + else if (prio < spc->spc_curpriority) need_resched(ci); } -- 2.20.1