sched/sched.h: add new function for changing cluster power 'weight'
authorLukasz Luba <l.luba@partner.samsung.com>
Tue, 30 Oct 2018 13:19:51 +0000 (14:19 +0100)
committerLukasz Luba <l.luba@partner.samsung.com>
Fri, 17 May 2019 07:15:41 +0000 (09:15 +0200)
This patch adds new interface for sched power which controls
power allocation for CPUs.

Signed-off-by: Lukasz Luba <l.luba@partner.samsung.com>
kernel/sched/sched.h

index 7c8dea6df31aa120d17a592cc9c549f7564934c3..725e0c19ae9699f38e53caaaad730164dd24b9bd 100644 (file)
@@ -2246,6 +2246,7 @@ unsigned long scale_irq_capacity(unsigned long util, unsigned long irq, unsigned
 #endif
 
 #define SCHED_POWER_FORCE_UPDATE_RT 0x01
+#define SCHED_POWER_CLUSTER_REQ 0x2
 #ifdef CONFIG_THERMAL
 struct update_sched_power {
        void (*func)(struct update_sched_power *, int, unsigned int, int, int);
@@ -2263,7 +2264,17 @@ static inline void sched_power_change_cpu_weight(int cpu, unsigned long weight,
        if (update)
                update->func(update, cpu, weight, flags, time);
 }
+
+static inline
+void sched_power_change_cluster_weight(int cpu, unsigned long weight, int flags)
+{
+       sched_power_change_cpu_weight(cpu, weight, flags |
+                                     SCHED_POWER_CLUSTER_REQ);
+}
 #else
 static inline void sched_power_change_cpu_weight(int cpu, unsigned int weight,
                                                 int flags) {}
+static inline
+void sched_power_change_cluster_weight(int cpu, unsigned int weight, int flags)
+{}
 #endif /* CONFIG_THERMAL */