[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1349352728.4438.23.camel@twins>
Date: Thu, 04 Oct 2012 14:12:08 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Andrea Righi <andrea@...terlinux.com>
Cc: Paul Menage <paul@...lmenage.org>, Ingo Molnar <mingo@...hat.com>,
linux-kernel@...r.kernel.org, Paul Turner <pjt@...gle.com>,
Glauber Costa <glommer@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH RFC 1/3] sched: introduce distinct per-cpu load average
On Thu, 2012-10-04 at 11:43 +0200, Andrea Righi wrote:
>
> Right, the update must be atomic to have a coherent nr_uninterruptible
> value. And AFAICS the only way to account a coherent
> nr_uninterruptible
> value per-cpu is to go with atomic ops... mmh... I'll think more on
> this.
You could stick it in the cpu controller instead of cpuset, add a
per-cpu nr_uninterruptible counter to struct task_group and update it
from the enqueue/dequeue paths. Those already are per-cgroup (through
cfs_rq, which has a tg pointer).
That would also give you better semantics since it would really be the
load of the tasks of the cgroup, not whatever happened to run on a
particular cpu regardless of groups. Then again, it might be 'fun' to
get the hierarchical semantics right :-)
OTOH it would also make calculating the load-avg O(nr_cgroups) and since
we do this from the tick and people are known to create a shitload (on
the order of 1e3 and upwards) of those this might not actually be a very
good idea.
Also, your patch 2 relies on the load avg function to be additive yet
your completely fail to mention this and state whether this is so or
not.
Furthermore, please look at PER_CPU() and friends as alternatives to
[NR_CPUS] arrays.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists