Re: CFS Scheduler : Period : for NCPUs : Code Suggestion Change

From: Peter Zijlstra
Date: Mon Jul 06 2009 - 08:46:39 EST


On Tue, 2009-06-30 at 18:36 -0700, Mitchell Erblich wrote:
> This is NOT A PATCH.
>
> PLEASE include my email in the reply as I am not currently on
> the linux kernel mail alias.
>
> This code snap is grabbed from what is believed to be a semi-current
> OS source (fxr.watson.org) comparison webpage.
>
> Upon a quick CFS scheduler code walk, increasing the period
> should ALSO be dependent on the number of online/active CPUs.
>
> The period should be adjusted based on the number of
> online CPUs. This change allows NCPUs * tasks without
> changing/increasing the period.
>
> On first thought NR_CPUS should give the number of cpu on
> the system, however, this may be different from the number of
> CPUs online, thus..
>
> Change #1: place after line 425
> int cpu, ncpu;
>
>
> Change #2: place before line 427
> for_each_online_cpu(cpu) {
> ncpu++;
> }
> nr_running /= ncpu;
>

Ah, but the nr_running number used is _per_ cpu already, so would that
address your concern?

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/