文章目錄
- 1、初始化帶寬 init_rt_bandwidth
- 1.1、init_rt_bandwidth
- 2、定時器處理
- 2.1、sched_rt_period_timer
- 2.2、do_sched_rt_period_timer
- 3、總結
1、初始化帶寬 init_rt_bandwidth
rt_runtime : 一個時間周期內的運行時間,超過則限流,默認值為0.95ms
-
1、init_rt_bandwidth函數在創建分配RT任務組的時候調用,
- 將rt_bandwidth結構體的相關字段進行初始化:
- 設置好時間周期rt_period和運行時間限制rt_runtime,都設置成默認值;
-
2、在enqueue_rt_entity將RT調度實體入列時,最終觸發start_rt_bandwidth函數執行
- 當高精度定時器到期時調用do_sched_rt_period_timer函數;
-
3、do_sched_rt_period_timer函數,會去判斷該RT運行隊列的累計運行時間rt_time與設置的限制運行時間rt_runtime之間的大小關系,以確定是否限流的操作。
- 如果已經進行了限流操作,