<br><br><div class="gmail_quote">On Wed, Jan 9, 2013 at 4:03 PM, Bond <span dir="ltr">&lt;<a href="mailto:jamesbond.2k.g@gmail.com" target="_blank">jamesbond.2k.g@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
please see this question<br>
<a href="http://stackoverflow.com/questions/14229793/what-does-struct-sched-domain-stands-for-in-include-linux-sched-h-scheduling-do" target="_blank">http://stackoverflow.com/questions/14229793/what-does-struct-sched-domain-stands-for-in-include-linux-sched-h-scheduling-do</a><br>

<br>
I checked following<br>
<a href="http://lwn.net/Articles/169277/" target="_blank">http://lwn.net/Articles/169277/</a> and following<br>
<a href="http://www.kernel.org/doc/Documentation/scheduler/sched-domains.txt" target="_blank">http://www.kernel.org/doc/Documentation/scheduler/sched-domains.txt</a><br>
the first line of <a href="http://kernel.org" target="_blank">kernel.org</a> doc says<br>
.............  Each CPU has a &quot;base&quot; scheduling domain (struct<br>
sched_domain)..............<br>
and second para says<br>
&quot; each scheduling domain spans a number of CPUs (stored in the -&gt;span field).&quot;<br>
third para says<br>
&quot;  Each scheduling domain must have one or more CPU groups..................<br>
The intersection of cpumasks from any two of these groups<br>
MUST be the empty set.&quot;<br>
then some where in doc it says<br>
&quot;Balancing within a sched domain occurs between groups. That is, each group<br>
is treated as one entity.&quot; the doc in details talks about the implementation of<br>
<br>
scheduling domains and mentions that CPUs should belong to one of the<br>
scheduling domain in a way that<br>
cpumasks intersection should  be an  empty set<br>
<br>
The answer of the question that I want to know is<br>
why is a scheduling domain actually needed?<br>
<br>
_________________________________________<br><br></blockquote><div>CPU scheduling involving many configuration and factors.   </div><div><br></div><div><a href="https://www.cs.unm.edu/~eschulte/classes/cs587/data/10.1.1.59.6385.pdf">https://www.cs.unm.edu/~eschulte/classes/cs587/data/10.1.1.59.6385.pdf</a></div>
<div><br></div><div>Goto page 18 for definition of scheduler domain, and it says:</div><div><br></div><div>&quot;Each node in a system has a scheduler domain that points to its parent scheduler domain. A node might be</div>
<div>a uniprocessor system, an SMP system, or a node within a NUMA system.&quot;  </div><div><br></div><div>this complex hierarchies of CPU is normally associated with hardware physical proximity CPU (just one factors) or the speed of bus that connect between CPU.   Not all CPU are connected to all other CPU, but perhaps only two or 4 other CPU, and therefore, when u transfer data between CPU, it is necessary to build these proximities information into the kernel, to minimize costs of data transfer between CPU.</div>
<div><br></div><div>90% (or more) of supercomputers (with thousands of CPU) are run by Linux kernel, and clearly each CPU can only have a few neighboring CPU.   Other factors involved power-management:   when your processing usage goes down, u have to shut down the CPU - leaving only the bare minimum to be running.   Organizing in some hierarchies facilitate this scheduling algorithm.</div>
</div><div><br></div><a href="http://www.intel.com/technology/itj/2007/v11i4/9-process/6-linux-scheduler.htm">http://www.intel.com/technology/itj/2007/v11i4/9-process/6-linux-scheduler.htm</a><div><a href="http://www.cs.stonybrook.edu/~porter/courses/cse506/f12/slides/scheduling.pdf">http://www.cs.stonybrook.edu/~porter/courses/cse506/f12/slides/scheduling.pdf</a></div>
<div><a href="http://www.cs.stonybrook.edu/~porter/courses/cse506/f12/slides/scheduling2.pdf">http://www.cs.stonybrook.edu/~porter/courses/cse506/f12/slides/scheduling2.pdf</a></div><div><br></div><div>-- </div><div>Regards,<br>
Peter Teoh
</div>