Index | Thread | Search

From:
Miod Vallat <miod@online.fr>
Subject:
Re: sched_unpeg_proc()
To:
Martin Pieuchot <mpi@openbsd.org>
Cc:
tech@openbsd.org
Date:
Mon, 8 Jul 2024 13:41:12 +0000

Download raw body.

Thread
> > > Index: kern/kern_smr.c
> > > ===================================================================
> > > RCS file: /cvs/src/sys/kern/kern_smr.c,v
> > > diff -u -p -r1.16 kern_smr.c
> > > --- kern/kern_smr.c	14 Aug 2022 01:58:27 -0000	1.16
> > > +++ kern/kern_smr.c	8 Jul 2024 10:00:15 -0000
> > > @@ -162,8 +162,8 @@ smr_grace_wait(void)
> > >  			continue;
> > >  		sched_peg_curproc(ci);
> > >  		KASSERT(ci->ci_schedstate.spc_smrgp == smrgp);
> > > +		sched_unpeg_curproc();
> > >  	}
> > > -	atomic_clearbits_int(&curproc->p_flag, P_CPUPEG);
> > 
> > Are you sure you want to move the unpeg call into the for() loop?
> 
> I need this in dumbsched because I modify the per-CPU `spc' descriptor
> and I need to undo the states before picking up the next CPU.

So that move should not be part of the commit introducing
sched_unpeg_curproc(), methinks.