Re: [PATCH] specific do_timer_cpu value for nohz off mode

From: Thomas Gleixner
Date: Wed Aug 17 2011 - 12:47:52 EST


On Wed, 17 Aug 2011, Dimitri Sivanich wrote:

> Reposting this, as this was posted 2 weeks ago with no replies.

It's still in my vacation backlog :)

> Jiffies updates are currently done by the tick_do_timer_cpu. This has a
> non-deterministic value that can be any running cpu on the system. It
> changes dynamically in nohz mode. When nohz mode is off, it gets set to
> a more static, but still non-deterministic value.
>
> While the nohz behavior is necessary, is there a reason why the nohz off
> case can't have a specific value, say 0 as it was on earlier kernels?

Yes, we had troubles when switching over to highres/oneshot mode when
the first cpu which did the switch did not take the do_timer duty. See
changelogs.

> If the cpu is offlined, let the value change at that time (note that the
> x86 arch disallows offlining cpu 0).
>
> There are certain cases where this would be advantageous, especially where
> timely jiffies updates may not necessarily occur on specific processors.

Huch? How about fixing those long interrupt disabled regions instead?
And honestly jiffies update being delayed for a bit is not really a
problem.

> The following sample patch presents one way that this could be done.
> Processors wait for the selected cpu to enter high resolution mode before
> they do so.

That's a horrible hack.

> Note that this patch is not hotplug aware (however, should the
> tick_static_do_timer_cpu be offlined, the tick_do_timer_cpu simply becomes
> another cpu anyway).
>
> Comments on this idea, or the sample patch?

I still have no idea why a random assignment is so harmful. Also if
there is really a reason to make that assignment static, what about
using a sysfs file, which lets you read out the assignment and update
it in the NOHZ off case ?

Thanks,

tglx
--
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/