Index | Thread | Search

From:
Martin Pieuchot <mpi@openbsd.org>
Subject:
Re: Avoid sending two IPIs to idle CPUs on wakeup
To:
Christian Ludwig <christian_ludwig@genua.de>
Cc:
tech@openbsd.org
Date:
Mon, 5 Feb 2024 16:15:51 +0100

Download raw body.

Thread
On 02/02/24(Fri) 16:24, Christian Ludwig wrote:
> When waking up a process on an idle remote CPU, do not kick the remote
> side twice. In fact the remote CPU's scheduling context priority is
> invalid when the idle thread runs.

ok mpi@


> ---
>  sys/kern/kern_sched.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/sys/kern/kern_sched.c b/sys/kern/kern_sched.c
> index 731c615284d..0d5731fe07a 100644
> --- a/sys/kern/kern_sched.c
> +++ b/sys/kern/kern_sched.c
> @@ -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.34.1
>