Planning for domains and cpu scheduler / group groups helps simplify the process of scheduling tasks, such as:
- load balancing tasks for each processor.
- Choosing a processor to launch a new task.
- choosing a processor to perform the sleep task when it wakes up.
It has an advantage twice:
He organizes the processor very well in the system in groups and hierarchies.
It organizes the processor in such a way that it is useful. All cpus that share the l2 cache belongs to the same domain. All cpus shared by l3 cache
belong to a higher level domain that covers all domains that share the l2 cache.
The benefits that you see in a tree-like data structure are similar here to the benefits of domains and scheduler groups.
Refer to the following chart
_________sd1________ / \ ---------------------- l3 cache ---------------------- --------- ---------- l2 cache l2 cache --------- ---------- cpu0 cpu1 cpu2 cpu3 \_______/ \________/ sd0 sd0 ________sd1_________ / \ ---------------------- l3 cache ---------------------- --------- ---------- l2 cache l2 cache --------- ---------- cpu4 cpu5 cpu6 cpu7 \_______/ \________/ sd0 sd0
What you see above is the domain hierarchy of the scheduler. sd1 includes sd0s which are sd1.group schedulers. Every CPU has a domain hierarchy scheduler associated with it. For instance,
cpu0-> s.o. = sd0; sd0-> parent = sd1.This path through the linked list, we can iterate over all the scheduler domains to which the processor belongs.
How does this help?
balancing 1.load: say cpu0 is inactive and ready to pull tasks on to facilitate any other burdened processor. In the above approach, it first checks whether another processor belonging to the first level planning domain should be freed. Here, cpu1.If so it accepts tasks from cpu1, otherwise it goes to the top level domain sd1.If he chooses to transfer the task from cpu1, this is the best because the contents of the cache can be used, a common cache. No need to retrieve from memory again. This is the first advantage: schedule domains are formed on the basis of the advantages that the equipment should provide.
If he goes to sd1, he checks sd1 'groups', as sd0s.Here is the next advantage. He needs information about the schedule group alone and will not worry about the individual processor in it.it checks if load (sd0 [cpu2, cpu3])> load (sd0 [cpu0, cpu1]) only if this is true, does this mean again that cpu2 / 3 is more loaded. If there was no domain or scheduler groups, we would need to see the states of cpu2 and cpu3 in two iterations instead of the 1st iteration, as we are now.
Now we scale this problem and the solution for 128 processors! Imagine what a mess it would be if you had nothing to say which processor would best offload, in the worst case scenario, you would have to sort through all 128 processors.
But with a scheduler domain or groups, let's say you split 128 cpus into groups of 16 processors, you will have 8 groups. This is the busiest, so it will be 8 iterations, then you will find out the busiest group, then go down. The other 16 iterations .so the worst case
8 + 16 = 24 iterations. And this decrease occurs with only one level of the domain schedule. Imagine if you had more levels, you would have made the iteration number even lower.
In short, domains and planner groups are “dividing and owning,” but defeating as much as possible is a more useful “planning solution for related materials.”
I sent a message if someone in the future wants to read it.