summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched/fair.c13
-rw-r--r--kernel/sched/features.h8
2 files changed, 21 insertions, 0 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 6b12c89315f6..8000639568c9 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -6487,6 +6487,19 @@ unsigned long capacity_curr_of(int cpu)
#define EAS_CPU_CNT 3
/*
+ * Returns the current capacity of cpu after applying both
+ * cpu and min freq scaling.
+ */
+unsigned long capacity_min_of(int cpu)
+{
+ if (!sched_feat(MIN_CAPACITY_CAPPING))
+ return 0;
+ return arch_scale_cpu_capacity(NULL, cpu) *
+ arch_scale_min_freq_capacity(NULL, cpu)
+ >> SCHED_CAPACITY_SHIFT;
+}
+
+/*
* energy_diff - supports the computation of the estimated energy impact in
* moving a "task"'s "util_delta" between different CPU candidates.
*/
diff --git a/kernel/sched/features.h b/kernel/sched/features.h
index c30c48fde7e6..3ad94cb2b4bf 100644
--- a/kernel/sched/features.h
+++ b/kernel/sched/features.h
@@ -78,3 +78,11 @@ SCHED_FEAT(ENERGY_AWARE, true)
#else
SCHED_FEAT(ENERGY_AWARE, false)
#endif
+
+/*
+ * Minimum capacity capping. Keep track of minimum capacity factor when
+ * minimum frequency available to a policy is modified.
+ * If enabled, this can be used to inform the scheduler about capacity
+ * restrictions.
+ */
+SCHED_FEAT(MIN_CAPACITY_CAPPING, false)