/
README
106 lines (73 loc) · 3.1 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
== What is ulatency ==
Ulatency is a daemon that controls how the Linux kernel will spend it's
resources on the running processes. It uses dynamic cgroups to give the kernel
hints and limitations on processes.
It strongly supports the lua scripting language for writing rules and the
scheduler code.
== What tries it to fix ==
The Linux scheduler does a pretty good job to give the available resources to
all processes, but this may not be the best user experience in the desktop case.
ulatencyd monitors the system and categorizes the running processes into cgroups.
Processes that run wild to slow down the system by causing massive swaping will
be isolated.
== Isn't CONFIG_SCHED_DESKTOP enough ? ==
There is a patch for 2.6.38 in pipeline, see http://thread.gmane.org/gmane.linux.kernel/1050575
I think that this mimimal aproach is good for some circumstances, but does not
provide enough flexibility required for a true low latency desktop.
Perfect desktop scheduling needs a lot of heuristics, that don't belong in
the kernel. For example, the patch won't protect you from swap of death, fork bombs,
can't detect which process you are actually using and give more cpu shares to them,
can't give realtime priorities to processes like jackd, etc...
ulatencyd is designed for fixing exactly that.
== Building ==
Build Requirements:
libglib2.0-dev
libdbus-glib-1-dev
liblua5.1-0-dev | libluajit-5.1-dev
liblua5.1-posix1 (sometimes called luaposix)
Documentation:
doxygen
libmoose-perl
pandoc
CLI:
python-dbus
python2.5+ - python3.2+
GUI:
python-qt4
python-qt4-dbus
Compiling:
# cmake .
# make DEBUG=1
Configure options (optional):
# ccmake .
Building Documentation:
# make docs
Install:
# sudo make install
Running:
# sudo /usr/local/sbin/ulatencyd -v 2
== Links ==
Website - https://github.com/poelzi/ulatencyd
Infos - https://github.com/poelzi/ulatencyd/wiki
FAQ - https://github.com/poelzi/ulatencyd/wiki/Faq
Reporting Bugs - https://github.com/poelzi/ulatencyd/issues
== Architecture ==
See docs/architecture.svg for a general overview.
The core of the daemon is written in c, embedding a lua interpreter.
Most of the rules are written in lua scripts, as heuristics for system behavior
can best be written in a script language.
The daemon exports system informations into lua script.
There are two ways implementing a heuristic behavior:
- using a timeout callback
- using a filter class
The timeout callback is called until it returns True.
The filter class is the preferred way. The filter gets executed on processes and
can categorize the process.
Depending on the return value of the call the future behaviour may vary.
The return value consists of a flag section and i timeout section. The filter
is only executed after the timeout seconds.
It may also cause the filter to not be called on any child progress of the filter.
The processes are traveld in tree order. This means that the progress tree is
mapped into the data structure and traveled from top (id = 1, which is the init)
and then trough all the children.
For more informations see docs/RULES_HOWTO.txt