-/* $OpenBSD: apmd.c,v 1.63 2013/11/13 04:50:21 deraadt Exp $ */
+/* $OpenBSD: apmd.c,v 1.64 2014/07/22 22:09:36 tedu Exp $ */
/*
* Copyright (c) 1995, 1996 John T. Kohl
#define PERFDEC 20
#define PERFMIN 0
#define PERFMAX 100
-#define PERFINCTHRES 10
-#define PERFDECTHRES 30
+#define PERFINCTHRES 50
+#define PERFDECTHRES 60
extern char *__progname;
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;
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;