lkml.org 
[lkml]   [2011]   [Jun]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCHSET] stop_machine: implement stop_machine_from_offline_cpu()
From
Date
On Tue, 2011-06-14 at 19:06 +0200, Tejun Heo wrote:
> This three patch series implements stop_machine_from_offline_cpu(),
> which is stop_machine() which can be used from a CPU which isn't yet
> online.
>
> This is for mtrr which needs stop_machine while bringing up a CPU. It
> currently implements its own stop_machine directly using
> stop_one_cpu(). Duplicating such core functionality is wasteful and
> fragile. e.g. mtrr's implementation currently can deadlock against
> generic stop_machine().
>
> This patchset is born from Suresh's attempt at implementing similar
> feature into [__]stop_machine()[1], which IMHO is a bit too subtle.
> Given the peculiarity of the feature, I think it's better to have
> dedicated function with an ugly name. Also, this way, the
> implementation is very well isolated from the rest of stop_cpus
> machinery and much simpler.

Maybe a silly question, but why does mtrr need all this? Surely mtrr can
serialize state by other means than stopping all cpus. A simple mutex
around the shared state blocking other cpus from updating the mtrr state
while we're copying the state to our newly born cpu should cure things.

I'm sure I'm missing something trivial here, but shouldn't we at least
explain the details and explore alternatives before merging ugly code?




\
 
 \ /
  Last update: 2011-06-16 14:13    [W:0.075 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site