[Question] MTRR init on secondary processors

From: Peter Xu
Date: Wed Jan 20 2016 - 00:45:01 EST


Got a question about how we init MTRR for hot plugged processors.

I see that when init MTRR on new processors (online one processor,
possibly by hot-plugged), we need to stop all the active processors,
re-init MTRR on all the processors synchronously. Could anyone
explain why we need this sync-up for all the active processors
(please check mtrr_ap_init()) ?

I can understand that the OS software should make sure that every
processor's MTRR configurations are consistent, but why not we init
the new one only, just to make sure it is consistent with others
(since all the rest processors should be consistent in MTRR
configurations already)?

I am asking this since I found that this operation will force all
active processor to stop its work (the MTRR re-init is handled by
[migration/N] per-cpu kernel thread with FIFO 99 priority, which
will interrupt my RT application program), which brings very big
latency spikes on real-time CPUs.

I checked Intel manual volume 3 section 11.11.8, I think it's
following what the manual says. However I still cannot understand
the reason behind. Would appreciate if anyone knows this, and also
if anyone has suggestion on how I could avoid this spike on RT

Thanks in advance.