2.6.4.1 带宽控制 - 数据结构
/* file: kernel/sched/sched.h */
struct cfs_bandwidth {
#ifdef CONFIG_CFS_BANDWIDTH
raw_spinlock_t lock;
/* 一个周期的时长 */
ktime_t period;
/* 一个周期内的时间限额 */
u64 quota;
/* 本周期内剩下的可用时间 */
u64 runtime;
s64 hierarchical_quota;
u8 idle;
u8 period_active;
u8 slack_started;
/* 高精度定时器,每个period内定时更新runtime */
struct hrtimer period_timer;
/* 回收时间的定时器 */
struct hrtimer slack_timer;
/* 所有throttled的cfs_rq挂到该链表上,在定时器的回调函数中遍历该链表执行unthrottle操作
*/
struct list_head throttled_cfs_rq;
/* Statistics: */
int nr_periods;
int nr_throttled;
u64 throttled_time;
#endif
};Last updated