~ubuntu-branches/debian/wheezy/linux-2.6/wheezy

« back to all changes in this revision

Viewing changes to Documentation/scheduler/sched-domains.txt

  • Committer: Bazaar Package Importer
  • Author(s): Ben Hutchings, Ben Hutchings, Aurelien Jarno
  • Date: 2011-06-07 12:14:05 UTC
  • mfrom: (43.1.9 sid)
  • Revision ID: james.westby@ubuntu.com-20110607121405-i3h1rd7nrnd2b73h
Tags: 2.6.39-2
[ Ben Hutchings ]
* [x86] Enable BACKLIGHT_APPLE, replacing BACKLIGHT_MBP_NVIDIA
  (Closes: #627492)
* cgroups: Disable memory resource controller by default. Allow it
  to be enabled using kernel parameter 'cgroup_enable=memory'.
* rt2800usb: Enable support for more USB devices including
  Linksys WUSB600N (Closes: #596626) (this change was accidentally
  omitted from 2.6.39-1)
* [x86] Remove Celeron from list of processors supporting PAE. Most
  'Celeron M' models do not.
* Update debconf template translations:
  - Swedish (Martin Bagge) (Closes: #628932)
  - French (David Prévot) (Closes: #628191)
* aufs: Update for 2.6.39 (Closes: #627837)
* Add stable 2.6.39.1, including:
  - ext4: dont set PageUptodate in ext4_end_bio()
  - pata_cmd64x: fix boot crash on parisc (Closes: #622997, #622745)
  - ext3: Fix fs corruption when make_indexed_dir() fails
  - netfilter: nf_ct_sip: validate Content-Length in TCP SIP messages
  - sctp: fix race between sctp_bind_addr_free() and
    sctp_bind_addr_conflict()
  - sctp: fix memory leak of the ASCONF queue when free asoc
  - md/bitmap: fix saving of events_cleared and other state
  - cdc_acm: Fix oops when Droids MuIn LCD is connected
  - cx88: Fix conversion from BKL to fine-grained locks (Closes: #619827)
  - keys: Set cred->user_ns in key_replace_session_keyring (CVE-2011-2184)
  - tmpfs: fix race between truncate and writepage
  - nfs41: Correct offset for LAYOUTCOMMIT
  - xen/mmu: fix a race window causing leave_mm BUG()
  - ext4: fix possible use-after-free in ext4_remove_li_request()
  For the complete list of changes, see:
   http://www.kernel.org/pub/linux/kernel/v2.6/ChangeLog-2.6.39.1
* Bump ABI to 2
* netfilter: Enable IP_SET, IP_SET_BITMAP_IP, IP_SET_BITMAP_IPMAC,
  IP_SET_BITMAP_PORT, IP_SET_HASH_IP, IP_SET_HASH_IPPORT,
  IP_SET_HASH_IPPORTIP, IP_SET_HASH_IPPORTNET, IP_SET_HASH_NET,
  IP_SET_HASH_NETPORT, IP_SET_LIST_SET, NETFILTER_XT_SET as modules
  (Closes: #629401)

[ Aurelien Jarno ]
* [mipsel/loongson-2f] Disable_SCSI_LPFC to workaround GCC ICE.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Each CPU has a "base" scheduling domain (struct sched_domain). These are
2
 
accessed via cpu_sched_domain(i) and this_sched_domain() macros. The domain
 
1
Each CPU has a "base" scheduling domain (struct sched_domain). The domain
3
2
hierarchy is built from these base domains via the ->parent pointer. ->parent
4
 
MUST be NULL terminated, and domain structures should be per-CPU as they
5
 
are locklessly updated.
 
3
MUST be NULL terminated, and domain structures should be per-CPU as they are
 
4
locklessly updated.
6
5
 
7
6
Each scheduling domain spans a number of CPUs (stored in the ->span field).
8
7
A domain's span MUST be a superset of it child's span (this restriction could
26
25
load of each of its member CPUs, and only when the load of a group becomes
27
26
out of balance are tasks moved between groups.
28
27
 
29
 
In kernel/sched.c, rebalance_tick is run periodically on each CPU. This
30
 
function takes its CPU's base sched domain and checks to see if has reached
31
 
its rebalance interval. If so, then it will run load_balance on that domain.
32
 
rebalance_tick then checks the parent sched_domain (if it exists), and the
33
 
parent of the parent and so forth.
 
28
In kernel/sched.c, trigger_load_balance() is run periodically on each CPU
 
29
through scheduler_tick(). It raises a softirq after the next regularly scheduled
 
30
rebalancing event for the current runqueue has arrived. The actual load
 
31
balancing workhorse, run_rebalance_domains()->rebalance_domains(), is then run
 
32
in softirq context (SCHED_SOFTIRQ).
 
33
 
 
34
The latter function takes two arguments: the current CPU and whether it was idle
 
35
at the time the scheduler_tick() happened and iterates over all sched domains
 
36
our CPU is on, starting from its base domain and going up the ->parent chain.
 
37
While doing that, it checks to see if the current domain has exhausted its
 
38
rebalance interval. If so, it runs load_balance() on that domain. It then checks
 
39
the parent sched_domain (if it exists), and the parent of the parent and so
 
40
forth.
 
41
 
 
42
Initially, load_balance() finds the busiest group in the current sched domain.
 
43
If it succeeds, it looks for the busiest runqueue of all the CPUs' runqueues in
 
44
that group. If it manages to find such a runqueue, it locks both our initial
 
45
CPU's runqueue and the newly found busiest one and starts moving tasks from it
 
46
to our runqueue. The exact number of tasks amounts to an imbalance previously
 
47
computed while iterating over this sched domain's groups.
34
48
 
35
49
*** Implementing sched domains ***
36
50
The "base" domain will "span" the first level of the hierarchy. In the case