-/* $OpenBSD: apmd.c,v 1.64 2014/07/22 22:09:36 tedu Exp $ */
+/* $OpenBSD: apmd.c,v 1.65 2014/07/26 10:48:59 mpi Exp $ */
/*
* Copyright (c) 1995, 1996 John T. Kohl
#define PERFDEC 20
#define PERFMIN 0
#define PERFMAX 100
-#define PERFINCTHRES 50
-#define PERFDECTHRES 60
+#define PERFINCTHRES 10
+#define PERFDECTHRES 30
extern char *__progname;
syslog(LOG_INFO, "cannot read hw.setperf");
if (forcehi || (avg_idle < PERFINCTHRES && perf < PERFMAX)) {
- perf = PERFMAX;
+ perf += PERFINC;
+ if (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 = 0;
- sts.tv_nsec = 200000000;
+ sts.tv_sec = 1;
perf_status(&pinfo, ncpu);
}
- apmtimeout += 1;
+ apmtimeout += sts.tv_sec;
if ((rv = kevent(kq, NULL, 0, ev, 1, &sts)) < 0)
break;