Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Support daemon.media label (e.g. mpd service), issue #2

+ Tag mpd with media.label (simple.d/audio.conf)
+ Update scheduler rules to move non user processes labelled
with daemon.media to sys_media cgroup. They are scheduled similar
to user.media.
  • Loading branch information...
commit 02cc4fd905b1e9960009335f177adcf2f9170d30 1 parent 780f9ea
Petr Gajdůšek gajdusek authored
26 conf/scheduler/20-desktop.lua
View
@@ -100,6 +100,11 @@ SCHEDULER_MAPPING_DESKTOP["cpu"] =
param = { ["cpu.shares"]="1"},
},
{
+ name = "sys_media",
+ param = { ["cpu.shares"]="2500", ["?cpu.rt_runtime_us"] = "1"},
+ label = { "daemon.media" },
+ },
+ {
name = "system",
cgroups_name = "sys_bg",
label = { "daemon.bg" },
@@ -243,6 +248,11 @@ SCHEDULER_MAPPING_DESKTOP["memory"] =
end
},
{
+ name = "sys_media",
+ param = { ["?memory.swappiness"] = "40" },
+ label = { "daemon.media" },
+ },
+ {
name = "system",
cgroups_name = "sys_daemon",
check = function(proc)
@@ -312,6 +322,14 @@ SCHEDULER_MAPPING_DESKTOP["blkio"] =
end,
},
{
+ name = "sys_media",
+ param = { ["blkio.weight"]="300" },
+ label = { "daemon.media"},
+ adjust = function(cgroup, proc)
+ save_io_prio(proc, 7, ulatency.IOPRIO_CLASS_RT)
+ end,
+ },
+ {
name = "kernel",
cgroups_name = "",
check = function(proc)
@@ -378,6 +396,14 @@ SCHEDULER_MAPPING_DESKTOP["bfqio"] =
end,
},
{
+ name = "sys_media",
+ param = { ["bfqio.weight"]="300" },
+ label = { "daemon.media"},
+ adjust = function(cgroup, proc)
+ save_io_prio(proc, 7, ulatency.IOPRIO_CLASS_RT)
+ end,
+ },
+ {
name = "kernel",
cgroups_name = "",
check = function(proc)
18 conf/scheduler/20-one-seat-desktop.lua
View
@@ -166,6 +166,11 @@ SCHEDULER_MAPPING_ONE_SEAT_DESKTOP["cpu"] =
param = { ["cpu.shares"]="600"},
},
{
+ name = "sys_media",
+ param = { ["cpu.shares"]="2500", ["?cpu.rt_runtime_us"] = "1"},
+ label = { "daemon.media" },
+ },
+ {
name = "system",
cgroups_name = "sys_daemon",
check = function(proc)
@@ -384,6 +389,11 @@ SCHEDULER_MAPPING_ONE_SEAT_DESKTOP["memory"] =
param = { ["?memory.swappiness"] = "100" },
},
{
+ name = "sys_media",
+ param = { ["?memory.swappiness"] = "40" },
+ label = { "daemon.media" },
+ },
+ {
name = "system",
cgroups_name = "sys_daemon",
check = function(proc)
@@ -514,6 +524,14 @@ SCHEDULER_MAPPING_ONE_SEAT_DESKTOP["blkio"] =
end,
},
{
+ name = "sys_media",
+ param = { ["blkio.weight"]="300" },
+ label = { "daemon.media"},
+ adjust = function(cgroup, proc)
+ save_io_prio(proc, 1, ulatency.IOPRIO_CLASS_RT)
+ end,
+ },
+ {
name = "system",
cgroups_name = "sys_bg",
label = { "daemon.bg" },
1  conf/simple.d/audio.conf
View
@@ -5,6 +5,7 @@ clementine user.media
cmd:python*exaile.py* user.media
listen user.media
mpd user.media
+mpd daemon.media
parole user.media
rhythmbox user.media
xmms2d user.media
Please sign in to comment.
Something went wrong with that request. Please try again.