Explanation of kernel: pick_next_rt_entity

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.