[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1226089574.31966.85.camel@lappy.programming.kicks-ass.net>
Date: Fri, 07 Nov 2008 21:26:14 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Frank Mayhar <fmayhar@...gle.com>
Cc: Christoph Lameter <cl@...ux-foundation.org>,
Doug Chapman <doug.chapman@...com>, mingo@...e.hu,
roland@...hat.com, adobriyan@...il.com, akpm@...ux-foundation.org,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: regression introduced by - timers: fix itimer/many thread hang
OK, so how about going about this differently.
How about we group the threads per cpu, and appoint one the cpu-leader
and collect the per cpu sum in there.
Then, on tick time we sum the cpu-leaders to obtain the total.
This would require finding the cpu-leader for any particular cpu, which
for example, we could do by maintaining a rb-tree ordered on cpu. If you
find an entry, its the leader and you store a pointer to it, if its
empty, insert yourself.
We'd have to update this whenever a task migrates.
When the cpu-leader migrates it can hand off its sum to the cpu-leader
of the target cpu (assuming there is one, otherwise it will again be
cpu-leader).
The advantage is that the memory foot-print scales with nr_tasks and the
runtime cost is min(nr_tasks, nr_cpus) where nr_cpus is limited to the
cpus the process actually runs on, so this takes full advantage of
things like cpusets.
--
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