aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/scheduler/sched-rt-group.txt
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-04-11 16:24:16 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-11 16:24:16 -0400
commit14897e35fdc045fff9baabf0354570da22386706 (patch)
tree32cf1fcd7696e2018a05f2e4f8d5d20166af21ab /Documentation/scheduler/sched-rt-group.txt
parentb0fac02370cffad956ff3de5e8ed4df7e7b875d7 (diff)
parent14dadf1d5eb5bea2dd115852cfee880505c1c169 (diff)
Merge branch 'docs' of git://git.lwn.net/linux-2.6
* 'docs' of git://git.lwn.net/linux-2.6: Add additional examples in Documentation/spinlocks.txt Move sched-rt-group.txt to scheduler/ Documentation: move rpc-cache.txt to filesystems/ Documentation: move nfsroot.txt to filesystems/ Spell out behavior of atomic_dec_and_lock() in kerneldoc Fix a typo in highres.txt Fixes to the seq_file document Fill out information on patch tags in SubmittingPatches Add the seq_file documentation
Diffstat (limited to 'Documentation/scheduler/sched-rt-group.txt')
-rw-r--r--Documentation/scheduler/sched-rt-group.txt59
1 files changed, 59 insertions, 0 deletions
diff --git a/Documentation/scheduler/sched-rt-group.txt b/Documentation/scheduler/sched-rt-group.txt
new file mode 100644
index 000000000000..1c6332f4543c
--- /dev/null
+++ b/Documentation/scheduler/sched-rt-group.txt
@@ -0,0 +1,59 @@
1
2
3Real-Time group scheduling.
4
5The problem space:
6
7In order to schedule multiple groups of realtime tasks each group must
8be assigned a fixed portion of the CPU time available. Without a minimum
9guarantee a realtime group can obviously fall short. A fuzzy upper limit
10is of no use since it cannot be relied upon. Which leaves us with just
11the single fixed portion.
12
13CPU time is divided by means of specifying how much time can be spent
14running in a given period. Say a frame fixed realtime renderer must
15deliver 25 frames a second, which yields a period of 0.04s. Now say
16it will also have to play some music and respond to input, leaving it
17with around 80% for the graphics. We can then give this group a runtime
18of 0.8 * 0.04s = 0.032s.
19
20This way the graphics group will have a 0.04s period with a 0.032s runtime
21limit.
22
23Now if the audio thread needs to refill the DMA buffer every 0.005s, but
24needs only about 3% CPU time to do so, it can do with a 0.03 * 0.005s
25= 0.00015s.
26
27
28The Interface:
29
30system wide:
31
32/proc/sys/kernel/sched_rt_period_ms
33/proc/sys/kernel/sched_rt_runtime_us
34
35CONFIG_FAIR_USER_SCHED
36
37/sys/kernel/uids/<uid>/cpu_rt_runtime_us
38
39or
40
41CONFIG_FAIR_CGROUP_SCHED
42
43/cgroup/<cgroup>/cpu.rt_runtime_us
44
45[ time is specified in us because the interface is s32; this gives an
46 operating range of ~35m to 1us ]
47
48The period takes values in [ 1, INT_MAX ], runtime in [ -1, INT_MAX - 1 ].
49
50A runtime of -1 specifies runtime == period, ie. no limit.
51
52New groups get the period from /proc/sys/kernel/sched_rt_period_us and
53a runtime of 0.
54
55Settings are constrained to:
56
57 \Sum_{i} runtime_{i} / global_period <= global_runtime / global_period
58
59in order to keep the configuration schedulable.