- if (nthreads > ncpus)
- factor_now = (ncpus * LOAD_SCALE) / (nthreads + 1);
- else
- factor_now = (ncpus - nthreads) * LOAD_SCALE;
+ assert(load_now[TH_BUCKET_RUN] >= 0);
+ assert(load_now[TH_BUCKET_FIXPRI] >= 0);
+
+ /* Ignore the current thread, which is a running fixpri thread */
+
+ uint32_t nthreads = load_now[TH_BUCKET_RUN] - 1;
+ uint32_t nfixpri = load_now[TH_BUCKET_FIXPRI] - 1;
+
+ KERNEL_DEBUG_CONSTANT_IST(KDEBUG_TRACE,
+ MACHDBG_CODE(DBG_MACH_SCHED, MACH_SCHED_LOAD) | DBG_FUNC_NONE,
+ load_now[TH_BUCKET_FIXPRI] - 1, load_now[TH_BUCKET_SHARE_FG],
+ load_now[TH_BUCKET_SHARE_BG], load_now[TH_BUCKET_SHARE_UT], 0);