Re: [PATCH v4 5/5] x86: initialize secondary CPU only if master CPU will wait for it

From: Toshi Kani
Date: Fri May 02 2014 - 11:00:57 EST


On Fri, 2014-05-02 at 10:21 +0200, Igor Mammedov wrote:
> On Thu, 01 May 2014 17:11:56 -0600
> Toshi Kani <toshi.kani@xxxxxx> wrote:
:
> > When 10s passed, the master could set a new flag, ex.
> > cpu_callout_error_mask, which wait_for_master_cpu() checks and call
> > play_dead() when it is set. This avoids AP to spin forever when 10s
> > becomes not long enough. But it does not have to be part of this
> > patchset, though.
> I'm reluctant to add another to already too many cpu_*_mask,
> maybe we could reuse cpu_initialized_mask by clearing it on timeout.
> This way AP spinning on cpu_callout_mask could notice it and halt itself.

I agree that there are too many cpu_* masks. IMHO, these cpu rendezvous
masks, initialized/callout/callin, should be combined into a per-cpu
flag. There is not much point of being individual masks.

Anyway, I do not think cpu_initialized_mask can be reused here.

> It would be better to make it separate patch on top of this series,
> to reduce delay of bugfixes in this series.

Agreed.

> >
> > > + if (!boot_error) {
> > > /*
> > > - * Wait 5s total for a response
> > > + * Wait till AP completes initial initialization
> >
> > We should generally avoid such wait w/o a timeout condition, but since
> > native_cpu_up() waits till cpu_online(cpu) anyway after this point, this
> If we don't wait here and fall through into tight loop waiting on
> cpu_online(cpu) in native_cpu_up() or check_tsc_sync_source() then
> stop_task for syncing MTTRs initiated from AP won't have a chance
> to run on the master CPU.
>
> > seems OK... I wonder if we need touch_nmi_watchdog(), though.
> There wasn't any touch_nmi_watchdog() in the original code and I don't
> think we need it here since we are not just spinning on CPU but giving
> control back to kernel calling schedule(), which would allow watchdog_task
> to do the job if needed.

Agreed.

Thanks,
-Toshi

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