diff -r 291aa77e3052 sys/kern/kern_synch.c --- a/sys/kern/kern_synch.c Tue Oct 29 20:04:30 2024 +0000 +++ b/sys/kern/kern_synch.c Fri Nov 01 22:23:03 2024 +1100 @@ -506,11 +506,15 @@ void updatertime(lwp_t *l, const struct bintime *now) { static bool backwards = false; + struct bintime now2; + int s; if (__predict_false(l->l_flag & LW_IDLE)) return; - if (__predict_false(bintimecmp(now, &l->l_stime, <)) && !backwards) { + s = splhigh(); + binuptime(&now2); + if (__predict_false(bintimecmp(&now2, &l->l_stime, <)) && !backwards) { char caller[128]; #ifdef DDB @@ -533,13 +537,15 @@ updatertime(lwp_t *l, const struct binti l->l_name ? l->l_name : "", l->l_pflag, (intmax_t)l->l_stime.sec, l->l_stime.frac, - (intmax_t)now->sec, now->frac, + (intmax_t)now2.sec, now2.frac, caller); } - /* rtime += now - stime */ - bintime_add(&l->l_rtime, now); + /* rtime += now2 - stime */ + bintime_add(&l->l_rtime, &now2); bintime_sub(&l->l_rtime, &l->l_stime); + + splx(s); } /*