From 947f401b3fa41ab4e6e6cdddf5f0f3a911a6aaeb Mon Sep 17 00:00:00 2001 From: tb Date: Mon, 2 Aug 2021 15:15:47 +0000 Subject: [PATCH] Don't call cpu_setperf() when reading hw.setperf. "makes perfect sense to me" chris ok gnezdo jca --- sys/kern/sched_bsd.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/kern/sched_bsd.c b/sys/kern/sched_bsd.c index f0bb6ef7228..3b0a0b2cfc7 100644 --- a/sys/kern/sched_bsd.c +++ b/sys/kern/sched_bsd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sched_bsd.c,v 1.67 2021/05/10 18:01:24 mpi Exp $ */ +/* $OpenBSD: sched_bsd.c,v 1.68 2021/08/02 15:15:47 tb Exp $ */ /* $NetBSD: kern_synch.c,v 1.37 1996/04/22 01:38:37 christos Exp $ */ /*- @@ -621,7 +621,10 @@ sysctl_hwsetperf(void *oldp, size_t *oldlenp, void *newp, size_t newlen) &perflevel, 0, 100); if (err) return err; - cpu_setperf(perflevel); + + if (newp != NULL) + cpu_setperf(perflevel); + return 0; } -- 2.20.1