On Thu, Aug 31, 2023 at 10:30:45AM -0500, Scott Cheloha wrote:
> We don't actually need these NULL-checks, my mistake.
> 
> sched_init_cpu() is only ever run once for a given cpu_info.
> 
> ok?

Yes please. OK claudio@
 
> Index: kern_sched.c
> ===================================================================
> RCS file: /cvs/src/sys/kern/kern_sched.c,v
> retrieving revision 1.87
> diff -u -p -r1.87 kern_sched.c
> --- kern_sched.c      29 Aug 2023 16:19:34 -0000      1.87
> +++ kern_sched.c      31 Aug 2023 15:24:02 -0000
> @@ -88,26 +88,15 @@ sched_init_cpu(struct cpu_info *ci)
>  
>       spc->spc_idleproc = NULL;
>  
> -     if (spc->spc_itimer == NULL) {
> -             spc->spc_itimer = clockintr_establish(&ci->ci_queue,
> -                 itimer_update);
> -             if (spc->spc_itimer == NULL) {
> -                     panic("%s: clockintr_establish itimer_update",
> -                         __func__);
> -             }
> -     }
> -     if (spc->spc_profclock == NULL) {
> -             spc->spc_profclock = clockintr_establish(&ci->ci_queue,
> -                 profclock);
> -             if (spc->spc_profclock == NULL)
> -                     panic("%s: clockintr_establish profclock", __func__);
> -     }
> -     if (spc->spc_roundrobin == NULL) {
> -             spc->spc_roundrobin = clockintr_establish(&ci->ci_queue,
> -                 roundrobin);
> -             if (spc->spc_roundrobin == NULL)
> -                     panic("%s: clockintr_establish roundrobin", __func__);
> -     }
> +     spc->spc_itimer = clockintr_establish(&ci->ci_queue, itimer_update);
> +     if (spc->spc_itimer == NULL)
> +             panic("%s: clockintr_establish itimer_update", __func__);
> +     spc->spc_profclock = clockintr_establish(&ci->ci_queue, profclock);
> +     if (spc->spc_profclock == NULL)
> +             panic("%s: clockintr_establish profclock", __func__);
> +     spc->spc_roundrobin = clockintr_establish(&ci->ci_queue, roundrobin);
> +     if (spc->spc_roundrobin == NULL)
> +             panic("%s: clockintr_establish roundrobin", __func__);
>  
>       kthread_create_deferred(sched_kthreads_create, ci);
>  

-- 
:wq Claudio

Reply via email to