The following is the code for the entity class for RT policy in linux scheduling.
struct sched_rt_entity {
struct list_head run_list;
unsigned long timeout;
unsigned int time_slice;
struct sched_rt_entity *back;
#ifdef CONFIG_RT_GROUP_SCHED
struct sched_rt_entity *parent;
/* rq on which this entity is (to be) queued: */
struct rt_rq *rt_rq;
/* rq "owned" by this entity/group: */
struct rt_rq *my_q;
#endif
};
What is data member back required when the list is already implemented.
I also do not understand how the group scheduling policy is implemented, particularly why there is a need of my_rq and rt_rq and who will parent point to.
Also what is the meaning of timeout data member.
P.S.:
I have lots and lots of such question, Can anyone suggest a good read.
When using group scheduling, there is not a single queue, but a tree of groups and their queues. For example, when two users have a scheduling group each, the overall group/queue might allocate 50 % CPU to each user’s group, while all the users’ programs are in their group’s queue and compete for that 50 %.
For a more detailed explanation of how the multiple queues work, see CFS group scheduling.
parentpoints to the entity one level up in the tree;rt_rqis the queue on which this entity runs, whilemy_qis the queue on which this entity’s children run.The
backfield is used as temporary storage in thedequeue_rt_stack()function to implement a stack, where we have a pointer to the lowest entity, but want to remove them beginning from the top-level one.timeoutis increased by the watchdog timer and used to check that the task does not hog the CPU for longer thanRLIMIT_RTTIME.There are no books about recent kernel changes.
Use the source, Luke.