Ne 2. březen 2014, 16:13:22 CET
Corcodel Marian <[email protected]> napsal(a):

> This bug is because linux-kernel not have full support for cgroup.
> On linux debian package missing support also for CONFIG_CFS_BANDWIDTH,
> CONFIG_RT_GROUP_SCHED please send this bug on linux maintainers.
> 


Hi Marian,

ulatencyd rules do not limit CPU bandwidth, unless you modified them.
So CONFIG_CFS_BANDWIDTH disabled in kernel has no effect.
CONFIG_RT_GROUP_SCHED disabled does not harm too, because ulatency do
not limit RT processes, it just moves them to separate cgroup. And IMHO
the VLC should not be running real-time.

It is easy to update rules to limit run time of process under RT
scheduler or their CPU bandwidth under CFS scheduler if you recompile
the kernel; but I am not sure this is what you want...

Because I don't understand why you tag VLC with user.poison flag. This
flag is designated for processes that are causing memory pressure. What
do you want to achieve? VLC is media player and therefore shouldn't
you want it to run smoothly? Similar you have amarok labelled with
user.idle, why? What problem are you trying to resolve?

Next you seem to be running systemd. I cannot see any cgroups in the
tree you pasted here. Either you have snipped the `ulatency tree`
output really unfortunately or your processes are not in those cgroups,
ulatencyd has put them. See
https://github.com/poelzi/ulatencyd/wiki/Faq#wiki-14does-it-work-with-systemd

1) Make sure you have cgroups controllers disabled in systemd so
it does not move processes from ulatencyd cgroups.

2) Copy ulatency python script (should be in /bin or /usr/bin, not
sure where) somewhere into under your home directory and apply attached
patch.

3) Run 
$ echo cpu memory blkio cpuset | xargs -n1 ./ulatency --flags tree &>
tree.log
and attach the tree.log

4) Please, describe exactly what do you want to achieve and why.

Petr
commit 4f3ea0a25c236ed1af39350ca02e1fb45a9b172d
Author: Daniel Poelzleithner <[email protected]>
Date:   Wed Apr 20 14:17:40 2011 +0200

    show important group attributes in client
    
    show a list of important group values next to the group name in tree output.

diff --git a/client/ulatency b/client/ulatency
index 6d84f5a..b6f0789 100755
--- a/client/ulatency
+++ b/client/ulatency
@@ -27,6 +27,11 @@ VERSION = '0.2'
 DEFAULT_TREE = "cpu"
 CGROUP_PATHS = {}
 CGROUP_SUBSYS = []
+GROUP_VALUES = ["cpu.shares",
+                "cpuset.cpus", "cpuset.cpu_exclusive",
+                "memory.limit_in_bytes", "memory.memsw.limit_in_bytes",
+                "memory.swappiness", "blkio.weight"]
+GROUP_VALUES_HIDE = ["", "0", "2147483647", "9223372036854775807"]
 
 CONFIG_SINGLE_TASK = "single_task"
 
@@ -409,10 +414,12 @@ class Tree(object):
     }
 
     def __init__(self, tree=DEFAULT_TREE, processes=True, show_all=True,
-                 utf = True, color = False, flags = False, cmdline = False):
+                 utf = True, color = False, flags = False, cmdline = False,
+                 group_values=True):
         self.tree = tree
         self.processes = processes
         self.show_all = show_all
+        self.group_values = group_values
         self.utf = utf
         self.flags = flags
         self.cmdline = cmdline
@@ -423,13 +430,13 @@ class Tree(object):
                 process = u("{0.yellow}{1}{0.default} {2}"),
                 subtree = u("{0.bold}{0.black}{1}{0.default}"),
                 tree    = u("{0.bold}{0.black}{1}{2}{3}{0.default}{0.green}") +
-                          u("{5}{0.bold}{0.black}{4}{0.default}"),
+                          u("{5}{0.bold}{0.black}{4}{0.black}{6}{0.default}"),
                 file    = u("{0.bold}{0.black}{1}{2}{3}{0.default}{4}{5}{0.magenta}{6}{0.default}") )
         else:
             self.color = drug(
                 process = u("{1} {2}"),
                 subtree = u("{1}"),
-                tree    = u("{1}{2}{3}{5}{4}"),
+                tree    = u("{1}{2}{3}{5}{4}{6}"),
                 file    = u("{1}{2}{3}{4}{5}{6}") )
         path = self.get_path()
         if path:
@@ -547,11 +554,27 @@ class Tree(object):
                     islast or self.boxes[self.utf].branch,
                     self.boxes[self.utf].file, process, fpad, flags))
                 return
+            values = ""
+            if self.group_values:
+                for value in GROUP_VALUES:
+                    vpath = os.path.join(branch.path, value)
+                    if os.path.exists(vpath):
+                        with open(vpath) as fp:
+                            cont = fp.read().replace("\n", "")
+                            if cont not in GROUP_VALUES_HIDE:
+                                if values:
+                                    values += " {0}={1}".format(value, cont)
+                                else:
+                                    values += "{0}={1}".format(value, cont)
+                if values:
+                    values = (max(3, 20 - len(padding) - len(branch.name)))*" " + values
+
             prnt(self.color.tree.format(style, padding,
                 islast or self.boxes[self.utf].branch,
                 self.boxes[self.utf].start,
                 self.boxes[self.utf].end,
-                branch.name))
+                branch.name,
+                values))
             count = 0
             for child in branch.children:
                 count += 1
@@ -984,6 +1007,8 @@ def main():
         default=False, help="show complete tree")
     parser.add_option("--flags", dest="flags", action="store_true",
         default=False, help="show flags on tree output")
+    parser.add_option("--no-group-values", dest="no_group_values", action="store_true",
+        default=False, help="hide important group values")
     parser.add_option("--cmd", dest="cmdline", action="store_true",
         default=False, help="show cmdline")
     parser.add_option("--as-root", dest="as_root", action="store_true",
@@ -1049,7 +1074,8 @@ def main():
     if not args or args[0] == 'tree':
         kwargs = dict(utf = options.utf, color = options.color,
             show_all = options.all, processes = options.processes,
-            flags = options.flags, cmdline = options.cmdline)
+            flags = options.flags, cmdline = options.cmdline,
+            group_values = not options.no_group_values)
         if len(args) > 1:
             tree = Tree(tree=args[1], **kwargs)
         else:

Reply via email to