diff options
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r-- | include/linux/sched.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 044c023875e8..80235bcd05f2 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -283,6 +283,18 @@ struct vtime { | |||
283 | u64 gtime; | 283 | u64 gtime; |
284 | }; | 284 | }; |
285 | 285 | ||
286 | /* | ||
287 | * Utilization clamp constraints. | ||
288 | * @UCLAMP_MIN: Minimum utilization | ||
289 | * @UCLAMP_MAX: Maximum utilization | ||
290 | * @UCLAMP_CNT: Utilization clamp constraints count | ||
291 | */ | ||
292 | enum uclamp_id { | ||
293 | UCLAMP_MIN = 0, | ||
294 | UCLAMP_MAX, | ||
295 | UCLAMP_CNT | ||
296 | }; | ||
297 | |||
286 | struct sched_info { | 298 | struct sched_info { |
287 | #ifdef CONFIG_SCHED_INFO | 299 | #ifdef CONFIG_SCHED_INFO |
288 | /* Cumulative counters: */ | 300 | /* Cumulative counters: */ |
@@ -314,6 +326,10 @@ struct sched_info { | |||
314 | # define SCHED_FIXEDPOINT_SHIFT 10 | 326 | # define SCHED_FIXEDPOINT_SHIFT 10 |
315 | # define SCHED_FIXEDPOINT_SCALE (1L << SCHED_FIXEDPOINT_SHIFT) | 327 | # define SCHED_FIXEDPOINT_SCALE (1L << SCHED_FIXEDPOINT_SHIFT) |
316 | 328 | ||
329 | /* Increase resolution of cpu_capacity calculations */ | ||
330 | # define SCHED_CAPACITY_SHIFT SCHED_FIXEDPOINT_SHIFT | ||
331 | # define SCHED_CAPACITY_SCALE (1L << SCHED_CAPACITY_SHIFT) | ||
332 | |||
317 | struct load_weight { | 333 | struct load_weight { |
318 | unsigned long weight; | 334 | unsigned long weight; |
319 | u32 inv_weight; | 335 | u32 inv_weight; |
@@ -562,6 +578,25 @@ struct sched_dl_entity { | |||
562 | struct hrtimer inactive_timer; | 578 | struct hrtimer inactive_timer; |
563 | }; | 579 | }; |
564 | 580 | ||
581 | #ifdef CONFIG_UCLAMP_TASK | ||
582 | /* Number of utilization clamp buckets (shorter alias) */ | ||
583 | #define UCLAMP_BUCKETS CONFIG_UCLAMP_BUCKETS_COUNT | ||
584 | |||
585 | /* | ||
586 | * Utilization clamp for a scheduling entity | ||
587 | * @value: clamp value "assigned" to a se | ||
588 | * @bucket_id: bucket index corresponding to the "assigned" value | ||
589 | * | ||
590 | * The bucket_id is the index of the clamp bucket matching the clamp value | ||
591 | * which is pre-computed and stored to avoid expensive integer divisions from | ||
592 | * the fast path. | ||
593 | */ | ||
594 | struct uclamp_se { | ||
595 | unsigned int value : bits_per(SCHED_CAPACITY_SCALE); | ||
596 | unsigned int bucket_id : bits_per(UCLAMP_BUCKETS); | ||
597 | }; | ||
598 | #endif /* CONFIG_UCLAMP_TASK */ | ||
599 | |||
565 | union rcu_special { | 600 | union rcu_special { |
566 | struct { | 601 | struct { |
567 | u8 blocked; | 602 | u8 blocked; |
@@ -642,6 +677,10 @@ struct task_struct { | |||
642 | #endif | 677 | #endif |
643 | struct sched_dl_entity dl; | 678 | struct sched_dl_entity dl; |
644 | 679 | ||
680 | #ifdef CONFIG_UCLAMP_TASK | ||
681 | struct uclamp_se uclamp[UCLAMP_CNT]; | ||
682 | #endif | ||
683 | |||
645 | #ifdef CONFIG_PREEMPT_NOTIFIERS | 684 | #ifdef CONFIG_PREEMPT_NOTIFIERS |
646 | /* List of struct preempt_notifier: */ | 685 | /* List of struct preempt_notifier: */ |
647 | struct hlist_head preempt_notifiers; | 686 | struct hlist_head preempt_notifiers; |