-/* $OpenBSD: identcpu.c,v 1.145 2024/06/24 21:22:14 bluhm Exp $ */
+/* $OpenBSD: identcpu.c,v 1.146 2024/07/08 14:46:47 mpi Exp $ */
/* $NetBSD: identcpu.c,v 1.1 2003/04/26 18:39:28 fvdl Exp $ */
/*
ci->ci_hz_sensor.value = val;
}
- atomic_clearbits_int(&curproc->p_flag, P_CPUPEG);
+ sched_unpeg_curproc();
}
#endif
-/* $OpenBSD: kstat.c,v 1.2 2022/01/31 05:09:17 dlg Exp $ */
+/* $OpenBSD: kstat.c,v 1.3 2024/07/08 14:46:47 mpi Exp $ */
/*
* Copyright (c) 2020 David Gwynne <dlg@openbsd.org>
void
kstat_cpu_leave(void *p)
{
- atomic_clearbits_int(&curproc->p_flag, P_CPUPEG);
+ sched_unpeg_curproc();
}
void
-/* $OpenBSD: kern_sched.c,v 1.97 2024/07/08 13:17:12 claudio Exp $ */
+/* $OpenBSD: kern_sched.c,v 1.98 2024/07/08 14:46:47 mpi Exp $ */
/*
* Copyright (c) 2007, 2008 Artur Grabowski <art@openbsd.org>
*
SCHED_UNLOCK();
}
+void
+sched_unpeg_curproc(void)
+{
+ struct proc *p = curproc;
+
+ KASSERT(ISSET(p->p_flag, P_CPUPEG));
+
+ atomic_clearbits_int(&p->p_flag, P_CPUPEG);
+}
+
#ifdef MULTIPROCESSOR
void
sched_peg_curproc(ci);
cond_signal(&sb->cond);
- atomic_clearbits_int(&curproc->p_flag, P_CPUPEG);
+ sched_unpeg_curproc();
}
void
-/* $OpenBSD: kern_smr.c,v 1.16 2022/08/14 01:58:27 jsg Exp $ */
+/* $OpenBSD: kern_smr.c,v 1.17 2024/07/08 14:46:47 mpi Exp $ */
/*
* Copyright (c) 2019-2020 Visa Hankala
sched_peg_curproc(ci);
KASSERT(ci->ci_schedstate.spc_smrgp == smrgp);
}
- atomic_clearbits_int(&curproc->p_flag, P_CPUPEG);
+ sched_unpeg_curproc();
#endif /* MULTIPROCESSOR */
}
-/* $OpenBSD: sched.h,v 1.72 2024/06/03 12:48:25 claudio Exp $ */
+/* $OpenBSD: sched.h,v 1.73 2024/07/08 14:46:47 mpi Exp $ */
/* $NetBSD: sched.h,v 1.2 1999/02/28 18:14:58 ross Exp $ */
/*-
void cpu_idle_cycle(void);
void cpu_idle_leave(void);
void sched_peg_curproc(struct cpu_info *ci);
+void sched_unpeg_curproc(void);
void sched_barrier(struct cpu_info *ci);
int sysctl_hwsetperf(void *, size_t *, void *, size_t);