diff options
author | 2014-09-26 08:55:59 +0000 | |
---|---|---|
committer | 2014-09-26 08:55:59 +0000 | |
commit | 55eb36cca6888f086c5ab8c8b2df77f8ea1f4c5d (patch) | |
tree | e712511b7124c73cc06653c434fbd15800cda740 | |
parent | fix the calculation of the number of items to prime the pool with (diff) | |
download | wireguard-openbsd-55eb36cca6888f086c5ab8c8b2df77f8ea1f4c5d.tar.xz wireguard-openbsd-55eb36cca6888f086c5ab8c8b2df77f8ea1f4c5d.zip |
now that mp setperf is fixed, let's try aggressive throttling again.
-rw-r--r-- | usr.sbin/apmd/apmd.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/usr.sbin/apmd/apmd.c b/usr.sbin/apmd/apmd.c index 53154f5b6ef..57976d84fff 100644 --- a/usr.sbin/apmd/apmd.c +++ b/usr.sbin/apmd/apmd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apmd.c,v 1.67 2014/09/15 19:08:22 miod Exp $ */ +/* $OpenBSD: apmd.c,v 1.68 2014/09/26 08:55:59 tedu Exp $ */ /* * Copyright (c) 1995, 1996 John T. Kohl @@ -65,8 +65,8 @@ int doperf = PERF_NONE; #define PERFDEC 20 #define PERFMIN 0 #define PERFMAX 100 -#define PERFINCTHRES 10 -#define PERFDECTHRES 30 +#define PERFINCTHRES 50 +#define PERFDECTHRES 60 extern char *__progname; @@ -339,9 +339,7 @@ perf_status(struct apm_power_info *pinfo, int ncpu) syslog(LOG_INFO, "cannot read hw.setperf"); if (forcehi || (avg_idle < PERFINCTHRES && perf < PERFMAX)) { - perf += PERFINC; - if (perf > PERFMAX) - perf = PERFMAX; + perf = PERFMAX; setperf(perf); } else if (avg_idle > PERFDECTHRES && perf > PERFMIN) { perf -= PERFDEC; @@ -642,11 +640,12 @@ main(int argc, char *argv[]) sts = ts; if (doperf == PERF_AUTO || doperf == PERF_COOL) { - sts.tv_sec = 1; + sts.tv_sec = 0; + sts.tv_nsec = 200000000; perf_status(&pinfo, ncpu); } - apmtimeout += sts.tv_sec; + apmtimeout += 1; if ((rv = kevent(kq, NULL, 0, ev, 1, &sts)) < 0) break; |