diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2014-10-17 01:51:40 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2014-10-17 01:51:40 +0000 |
commit | 408955add921fe3396cd06f800d7d8a066c9ab26 (patch) | |
tree | 91ae4f7a9012abb064041f158840bc8c3420206a /sys/kern/init_main.c | |
parent | 74fe337c10141c7b46dc14a8fc44882a404a47d6 (diff) |
redo the performance throttling in the kernel.
introduce a new sysctl, hw.perfpolicy, that governs the policy.
when set to anything other than manual, hw.setperf then becomes read only.
phessler was heading in this direction, but this is slightly different. :)
Diffstat (limited to 'sys/kern/init_main.c')
-rw-r--r-- | sys/kern/init_main.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index e9e5827fb4b..4d5b672a619 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: init_main.c,v 1.221 2014/10/13 22:42:22 deraadt Exp $ */ +/* $OpenBSD: init_main.c,v 1.222 2014/10/17 01:51:39 tedu Exp $ */ /* $NetBSD: init_main.c,v 1.84.4.1 1996/06/02 09:08:06 mrg Exp $ */ /* @@ -116,6 +116,11 @@ struct sigacts sigacts0; struct process *initprocess; struct proc *reaperproc; +#ifndef SMALL_KERNEL +extern struct timeout setperf_to; +void setperf_auto(void *); +#endif + int cmask = CMASK; extern struct user *proc0paddr; @@ -545,6 +550,10 @@ main(void *framep) start_init_exec = 1; wakeup((void *)&start_init_exec); +#ifndef SMALL_KERNEL + timeout_set(&setperf_to, setperf_auto, NULL); +#endif + /* * proc0: nothing to do, back to sleep */ |