Re: [PATCH 2/4] stop_machine: reimplement using cpuhog

From: Tejun Heo
Date: Mon Mar 08 2010 - 18:37:49 EST


Hello,

On 03/09/2010 04:37 AM, Heiko Carstens wrote:
>> How cpuhog can make a difference? Afaics, we shouldn't pass a
>> blocking callback to hog_cpus/hog_one_cpu.
>
> Well, it might me true that this shouldn't be done. But I don't see
> a reason why in general it wouldn't work to pass a function that
> would block. So it's just a matter of time until somebody uses it
> for such a purpose. For the current stop_machine implementation it
> would be broken to pass a blocking function (preemption disabled,
> interrupts disabled).

Well, all current users don't block and it definitely can be enforced
by turning off preemption around the callback. stop_machine() uses
busy waiting for every state transition so something else blocking on
a cpu could waste a lot of cpu cycles on other cpus even if the wait
is guaranteed to be finite. Would that sooth your concern?

Thanks.

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