Re: PATCH: Fix race in cpu_down (hotplug cpu)

Ingo Molnar
2005-09-19T07:29:13Z

* Nick Piggin <nickpiggin@yahoo.com.au> wrote:

> On Mon, 2005-09-19 at 15:12 +0800, Shaohua Li wrote:
> > On Mon, 2005-09-19 at 16:36 +1000, Nick Piggin wrote:
>
> > > Ah, actually I have a patch which makes all CPU idle threads
> > > run with preempt disabled and only enable preempt when scheduling.
> > > Would that help?
> > It should solve the issue to me. Should we take care of the latency?
> > acpi_processor_idle might execute for a long time.
> >
>
> Oh really? I think yes, the latency should be taken care of because we
> want to be able to provide good latency even for !preempt kernels. If
> a solution can be found for acpi_processor_idle, that would be ideal.

the ACPI idle code runs with irqs disabled anyway, so there's no issue
here. If something takes long there, we can do little about it. (but in
practice ACPI sleep latencies are pretty ok - the only latencies i found
in the past were due to need_resched bugs in the ACPI idle routine)

> IMO it always felt kind of hackish to run the idle threads with
> preempt on.

Yes, idle threads can have preemption disabled. There's not any big
difference in terms of latencies, the execution paths are all very
short.

Ingo