diff options
Diffstat (limited to 'kernel/sched/core.c')
-rw-r--r-- | kernel/sched/core.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 55a1c07045ff..3c7b90bcbe4e 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c | |||
@@ -810,7 +810,7 @@ static inline unsigned int uclamp_bucket_base_value(unsigned int clamp_value) | |||
810 | return UCLAMP_BUCKET_DELTA * uclamp_bucket_id(clamp_value); | 810 | return UCLAMP_BUCKET_DELTA * uclamp_bucket_id(clamp_value); |
811 | } | 811 | } |
812 | 812 | ||
813 | static inline unsigned int uclamp_none(int clamp_id) | 813 | static inline enum uclamp_id uclamp_none(enum uclamp_id clamp_id) |
814 | { | 814 | { |
815 | if (clamp_id == UCLAMP_MIN) | 815 | if (clamp_id == UCLAMP_MIN) |
816 | return 0; | 816 | return 0; |
@@ -826,7 +826,7 @@ static inline void uclamp_se_set(struct uclamp_se *uc_se, | |||
826 | } | 826 | } |
827 | 827 | ||
828 | static inline unsigned int | 828 | static inline unsigned int |
829 | uclamp_idle_value(struct rq *rq, unsigned int clamp_id, | 829 | uclamp_idle_value(struct rq *rq, enum uclamp_id clamp_id, |
830 | unsigned int clamp_value) | 830 | unsigned int clamp_value) |
831 | { | 831 | { |
832 | /* | 832 | /* |
@@ -842,7 +842,7 @@ uclamp_idle_value(struct rq *rq, unsigned int clamp_id, | |||
842 | return uclamp_none(UCLAMP_MIN); | 842 | return uclamp_none(UCLAMP_MIN); |
843 | } | 843 | } |
844 | 844 | ||
845 | static inline void uclamp_idle_reset(struct rq *rq, unsigned int clamp_id, | 845 | static inline void uclamp_idle_reset(struct rq *rq, enum uclamp_id clamp_id, |
846 | unsigned int clamp_value) | 846 | unsigned int clamp_value) |
847 | { | 847 | { |
848 | /* Reset max-clamp retention only on idle exit */ | 848 | /* Reset max-clamp retention only on idle exit */ |
@@ -853,8 +853,8 @@ static inline void uclamp_idle_reset(struct rq *rq, unsigned int clamp_id, | |||
853 | } | 853 | } |
854 | 854 | ||
855 | static inline | 855 | static inline |
856 | unsigned int uclamp_rq_max_value(struct rq *rq, unsigned int clamp_id, | 856 | enum uclamp_id uclamp_rq_max_value(struct rq *rq, enum uclamp_id clamp_id, |
857 | unsigned int clamp_value) | 857 | unsigned int clamp_value) |
858 | { | 858 | { |
859 | struct uclamp_bucket *bucket = rq->uclamp[clamp_id].bucket; | 859 | struct uclamp_bucket *bucket = rq->uclamp[clamp_id].bucket; |
860 | int bucket_id = UCLAMP_BUCKETS - 1; | 860 | int bucket_id = UCLAMP_BUCKETS - 1; |
@@ -874,7 +874,7 @@ unsigned int uclamp_rq_max_value(struct rq *rq, unsigned int clamp_id, | |||
874 | } | 874 | } |
875 | 875 | ||
876 | static inline struct uclamp_se | 876 | static inline struct uclamp_se |
877 | uclamp_tg_restrict(struct task_struct *p, unsigned int clamp_id) | 877 | uclamp_tg_restrict(struct task_struct *p, enum uclamp_id clamp_id) |
878 | { | 878 | { |
879 | struct uclamp_se uc_req = p->uclamp_req[clamp_id]; | 879 | struct uclamp_se uc_req = p->uclamp_req[clamp_id]; |
880 | #ifdef CONFIG_UCLAMP_TASK_GROUP | 880 | #ifdef CONFIG_UCLAMP_TASK_GROUP |
@@ -906,7 +906,7 @@ uclamp_tg_restrict(struct task_struct *p, unsigned int clamp_id) | |||
906 | * - the system default clamp value, defined by the sysadmin | 906 | * - the system default clamp value, defined by the sysadmin |
907 | */ | 907 | */ |
908 | static inline struct uclamp_se | 908 | static inline struct uclamp_se |
909 | uclamp_eff_get(struct task_struct *p, unsigned int clamp_id) | 909 | uclamp_eff_get(struct task_struct *p, enum uclamp_id clamp_id) |
910 | { | 910 | { |
911 | struct uclamp_se uc_req = uclamp_tg_restrict(p, clamp_id); | 911 | struct uclamp_se uc_req = uclamp_tg_restrict(p, clamp_id); |
912 | struct uclamp_se uc_max = uclamp_default[clamp_id]; | 912 | struct uclamp_se uc_max = uclamp_default[clamp_id]; |
@@ -918,7 +918,7 @@ uclamp_eff_get(struct task_struct *p, unsigned int clamp_id) | |||
918 | return uc_req; | 918 | return uc_req; |
919 | } | 919 | } |
920 | 920 | ||
921 | unsigned int uclamp_eff_value(struct task_struct *p, unsigned int clamp_id) | 921 | enum uclamp_id uclamp_eff_value(struct task_struct *p, enum uclamp_id clamp_id) |
922 | { | 922 | { |
923 | struct uclamp_se uc_eff; | 923 | struct uclamp_se uc_eff; |
924 | 924 | ||
@@ -942,7 +942,7 @@ unsigned int uclamp_eff_value(struct task_struct *p, unsigned int clamp_id) | |||
942 | * for each bucket when all its RUNNABLE tasks require the same clamp. | 942 | * for each bucket when all its RUNNABLE tasks require the same clamp. |
943 | */ | 943 | */ |
944 | static inline void uclamp_rq_inc_id(struct rq *rq, struct task_struct *p, | 944 | static inline void uclamp_rq_inc_id(struct rq *rq, struct task_struct *p, |
945 | unsigned int clamp_id) | 945 | enum uclamp_id clamp_id) |
946 | { | 946 | { |
947 | struct uclamp_rq *uc_rq = &rq->uclamp[clamp_id]; | 947 | struct uclamp_rq *uc_rq = &rq->uclamp[clamp_id]; |
948 | struct uclamp_se *uc_se = &p->uclamp[clamp_id]; | 948 | struct uclamp_se *uc_se = &p->uclamp[clamp_id]; |
@@ -980,7 +980,7 @@ static inline void uclamp_rq_inc_id(struct rq *rq, struct task_struct *p, | |||
980 | * enforce the expected state and warn. | 980 | * enforce the expected state and warn. |
981 | */ | 981 | */ |
982 | static inline void uclamp_rq_dec_id(struct rq *rq, struct task_struct *p, | 982 | static inline void uclamp_rq_dec_id(struct rq *rq, struct task_struct *p, |
983 | unsigned int clamp_id) | 983 | enum uclamp_id clamp_id) |
984 | { | 984 | { |
985 | struct uclamp_rq *uc_rq = &rq->uclamp[clamp_id]; | 985 | struct uclamp_rq *uc_rq = &rq->uclamp[clamp_id]; |
986 | struct uclamp_se *uc_se = &p->uclamp[clamp_id]; | 986 | struct uclamp_se *uc_se = &p->uclamp[clamp_id]; |
@@ -1019,7 +1019,7 @@ static inline void uclamp_rq_dec_id(struct rq *rq, struct task_struct *p, | |||
1019 | 1019 | ||
1020 | static inline void uclamp_rq_inc(struct rq *rq, struct task_struct *p) | 1020 | static inline void uclamp_rq_inc(struct rq *rq, struct task_struct *p) |
1021 | { | 1021 | { |
1022 | unsigned int clamp_id; | 1022 | enum uclamp_id clamp_id; |
1023 | 1023 | ||
1024 | if (unlikely(!p->sched_class->uclamp_enabled)) | 1024 | if (unlikely(!p->sched_class->uclamp_enabled)) |
1025 | return; | 1025 | return; |
@@ -1034,7 +1034,7 @@ static inline void uclamp_rq_inc(struct rq *rq, struct task_struct *p) | |||
1034 | 1034 | ||
1035 | static inline void uclamp_rq_dec(struct rq *rq, struct task_struct *p) | 1035 | static inline void uclamp_rq_dec(struct rq *rq, struct task_struct *p) |
1036 | { | 1036 | { |
1037 | unsigned int clamp_id; | 1037 | enum uclamp_id clamp_id; |
1038 | 1038 | ||
1039 | if (unlikely(!p->sched_class->uclamp_enabled)) | 1039 | if (unlikely(!p->sched_class->uclamp_enabled)) |
1040 | return; | 1040 | return; |
@@ -1044,7 +1044,7 @@ static inline void uclamp_rq_dec(struct rq *rq, struct task_struct *p) | |||
1044 | } | 1044 | } |
1045 | 1045 | ||
1046 | static inline void | 1046 | static inline void |
1047 | uclamp_update_active(struct task_struct *p, unsigned int clamp_id) | 1047 | uclamp_update_active(struct task_struct *p, enum uclamp_id clamp_id) |
1048 | { | 1048 | { |
1049 | struct rq_flags rf; | 1049 | struct rq_flags rf; |
1050 | struct rq *rq; | 1050 | struct rq *rq; |
@@ -1077,9 +1077,9 @@ static inline void | |||
1077 | uclamp_update_active_tasks(struct cgroup_subsys_state *css, | 1077 | uclamp_update_active_tasks(struct cgroup_subsys_state *css, |
1078 | unsigned int clamps) | 1078 | unsigned int clamps) |
1079 | { | 1079 | { |
1080 | enum uclamp_id clamp_id; | ||
1080 | struct css_task_iter it; | 1081 | struct css_task_iter it; |
1081 | struct task_struct *p; | 1082 | struct task_struct *p; |
1082 | unsigned int clamp_id; | ||
1083 | 1083 | ||
1084 | css_task_iter_start(css, 0, &it); | 1084 | css_task_iter_start(css, 0, &it); |
1085 | while ((p = css_task_iter_next(&it))) { | 1085 | while ((p = css_task_iter_next(&it))) { |
@@ -1187,7 +1187,7 @@ static int uclamp_validate(struct task_struct *p, | |||
1187 | static void __setscheduler_uclamp(struct task_struct *p, | 1187 | static void __setscheduler_uclamp(struct task_struct *p, |
1188 | const struct sched_attr *attr) | 1188 | const struct sched_attr *attr) |
1189 | { | 1189 | { |
1190 | unsigned int clamp_id; | 1190 | enum uclamp_id clamp_id; |
1191 | 1191 | ||
1192 | /* | 1192 | /* |
1193 | * On scheduling class change, reset to default clamps for tasks | 1193 | * On scheduling class change, reset to default clamps for tasks |
@@ -1224,7 +1224,7 @@ static void __setscheduler_uclamp(struct task_struct *p, | |||
1224 | 1224 | ||
1225 | static void uclamp_fork(struct task_struct *p) | 1225 | static void uclamp_fork(struct task_struct *p) |
1226 | { | 1226 | { |
1227 | unsigned int clamp_id; | 1227 | enum uclamp_id clamp_id; |
1228 | 1228 | ||
1229 | for_each_clamp_id(clamp_id) | 1229 | for_each_clamp_id(clamp_id) |
1230 | p->uclamp[clamp_id].active = false; | 1230 | p->uclamp[clamp_id].active = false; |
@@ -1246,7 +1246,7 @@ static void uclamp_fork(struct task_struct *p) | |||
1246 | static void __init init_uclamp(void) | 1246 | static void __init init_uclamp(void) |
1247 | { | 1247 | { |
1248 | struct uclamp_se uc_max = {}; | 1248 | struct uclamp_se uc_max = {}; |
1249 | unsigned int clamp_id; | 1249 | enum uclamp_id clamp_id; |
1250 | int cpu; | 1250 | int cpu; |
1251 | 1251 | ||
1252 | mutex_init(&uclamp_mutex); | 1252 | mutex_init(&uclamp_mutex); |
@@ -6921,7 +6921,7 @@ static inline void alloc_uclamp_sched_group(struct task_group *tg, | |||
6921 | struct task_group *parent) | 6921 | struct task_group *parent) |
6922 | { | 6922 | { |
6923 | #ifdef CONFIG_UCLAMP_TASK_GROUP | 6923 | #ifdef CONFIG_UCLAMP_TASK_GROUP |
6924 | int clamp_id; | 6924 | enum uclamp_id clamp_id; |
6925 | 6925 | ||
6926 | for_each_clamp_id(clamp_id) { | 6926 | for_each_clamp_id(clamp_id) { |
6927 | uclamp_se_set(&tg->uclamp_req[clamp_id], | 6927 | uclamp_se_set(&tg->uclamp_req[clamp_id], |
@@ -7179,7 +7179,7 @@ static void cpu_util_update_eff(struct cgroup_subsys_state *css) | |||
7179 | struct uclamp_se *uc_parent = NULL; | 7179 | struct uclamp_se *uc_parent = NULL; |
7180 | struct uclamp_se *uc_se = NULL; | 7180 | struct uclamp_se *uc_se = NULL; |
7181 | unsigned int eff[UCLAMP_CNT]; | 7181 | unsigned int eff[UCLAMP_CNT]; |
7182 | unsigned int clamp_id; | 7182 | enum uclamp_id clamp_id; |
7183 | unsigned int clamps; | 7183 | unsigned int clamps; |
7184 | 7184 | ||
7185 | css_for_each_descendant_pre(css, top_css) { | 7185 | css_for_each_descendant_pre(css, top_css) { |