@@ -495,6 +499,8 @@ uint64_t mjoules_used; size_t len; int nonice; + /* GJ */ + int tload; /* Default mode for all AC states is adaptive. */ mode_ac = mode_none = MODE_HIADAPTIVE; @@ -734,12 +753,14 @@ } /* Adaptive mode; get the current CPU usage times. */ - if (read_usage_times(&load, nonice)) { + if (read_usage_times(&tload, nonice)) { if (vflag) warn("read_usage_times() failed"); continue; } + /* GJ - nsmt == hw.ncpu IFF > 4, else 1 */ + load = tload/nsmt; if (mode == MODE_ADAPTIVE) { if (load > cpu_running_mark) { if (load > 95 || load > cpu_running_mark * 2)