##summary
There is a struct rt_rq
in struct rq
. struct rt_rq
is used to store all
the realtime task in current struct rq
. which has a struct rt_prio_array active
.
1 | struct rq { |
for a rq
:
All the realtime tasks are stored by a bit map and a list array.
DECLARE_BITMAP(bitmap, MAX_RT_PRIO+1)
This is a bit map to show if a priority level has task to be selected.
One bit set to 1 means one or more task(s).struct list_head queue[MAX_RT_PRIO]
This is list array, each element is a list head.
All tasks are linked into different lists according their priority by
struct sched_rt_entity
‘sstruct list_head run_list
.
1 | 1001 struct sched_rt_entity { |
Each list has a corresponding bit in previous bitmap.
When we need pick a task, we find find the first bit in the map,
and then select one task from the corresponding list.
Q1: what is group_rt_rq? what is it used for?
CONFIG_RT_GROUP_SCHED??
Call Trac
1 | > pick_next_task |
##Data Structure
realtime runqueue struct rt_rq
1 | 332 /* Real-Time classes' related field in a runqueue: */ |
struct rt_prio_array
1 | 95 /* |
1 | 1001 struct sched_rt_entity { |
pick_next_task_rt
1 | 1323 static struct task_struct *pick_next_task_rt(struct rq *rq) |