@@ -979,6 +979,7 @@
unsigned long *cost)
{
struct pstate_data *pstate = &all_cpu_data[dev->id]->pstate;
+ struct cpu_cacheinfo *cacheinfo = get_cpu_cacheinfo(dev->id);
/*
* The smaller the perf-to-frequency scaling factor, the larger the IPC
@@ -991,6 +992,13 @@
* of the same type in different "utilization bins" is different.
*/
*cost = div_u64(100ULL * INTEL_PSTATE_CORE_SCALING, pstate->scaling) + freq;
+ /*
+ * Inrease the cost slightly for CPUs able to access L3 to avoid litting
+ * it up too eagerly in case some other CPUs of the same type cannot
+ * access it.
+ */
+ if (cacheinfo->num_levels >= 3)
+ (*cost)++;
return 0;
}