lkml.org 
[lkml]   [2014]   [Jan]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Fwd: Re: RFC: cgroups aware proc
On Mon, Jan 13, 2014 at 06:23:50PM +0200, Marian Marinov wrote:
> Hello Peter,
>
> I need help with the scheduler.
>
> I'm currently trying to patch the /proc/loadavg to show the load that is
> only related to the processes from the current cgroup.
>
> I looked trough the code and I was hoping that tsk->sched_task_group->cfs_rq
> struct will give me the needed information, but unfortunately for me, it did
> not.
>
> Can you advise me, how to approach this problem?

Yeah, don't :-) Really, loadavg is a stupid metric.

> I'm totally new to the scheduler code.

Luckily you won't actually have to touch much of it. Most of the actual
loadavg code lives in the first ~400 lines of kernel/sched/proc.c, read
and weep. Its one of the best documented bits around.

Your proposition however is extremely expensive, you turn something
that's already expensive O(nr_cpus) into something O(nr_cpus *
nr_cgroups).

I'm fairly sure people will not like that, esp. for something of such
questionable use as the loadavg -- its really only a pretty number that
doesn't mean all that much.

> -------- Original Message --------
> From: Li Zefan <lizefan@huawei.com>
>
> Then you should add Peter, Ingo and LKML to your Cc list. :)

You failed that, let me fix that.


\
 
 \ /
  Last update: 2014-01-13 20:41    [W:0.032 / U:0.644 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site