1328 static struct sched_rt_entity * pick_next_rt_entity (struct RQ * rq, 1329 struct rt_rq * rt_rq) 1330 {1331 struct rt_prio_array * array = & rt_rq-> active;
// Retrieve the priority array of rt_rq, A runqueue array, with each priority level having one.
// Struct rt_prio_array active;
// Struct list_head queue [max_rt_prio]
1332 struct sched_rt_entity * Next = NULL; 1333
Struct list_head * queue;
1334 int idx;
1335 1336 idx = sched_find_first_bit (array-> Bitmap );
// Sched_find_first_bit () searches for the first non-zero Digit
1337 bug_on (idx> = max_rt_prio );
// If idx is greater than max_rt_prio, rasie error1338 1339 queue = array-> queue + idx;
// Very nice usage. Use the queue (list_head) in queue [idx] directly)
1340 next = list_entry (queue-> next, struct sched_rt_entity, run_list );
// Get the first element next of the queue. Note that the queue is dummy head and sched_rt_entity is retrieved.
1341 1342 return next; 1343}
Explanation of kernel: pick_next_rt_entity