Re: [patch 05/12] timekeeping_notify: use stop_machine_fail when appropriate

From: Marcelo Tosatti
Date: Wed Feb 07 2024 - 08:12:59 EST


On Wed, Feb 07, 2024 at 12:57:19PM +0100, Thomas Gleixner wrote:
> On Tue, Feb 06 2024 at 15:49, Marcelo Tosatti wrote:
> > Change timekeeping_notify to use stop_machine_fail when appropriate,
> > which will fail in case the target CPU is tagged as block interference
> > CPU.
>
> You completely fail to explain 'appropriate'. There is zero reason for
> this churn, really.

The churn is so that we can return an error to
current_clocksource_store (sysfs handler for writes to
/sys/devices/system/clocksource/clocksource0/current_clocksource).

Yeah, should probably separate patches that prepare code for
returning errors from the actual change between smp_call_function_single
and smp_call_function_single_fail (started that for the
rdmsr_on_cpu/wrmsr_on_cpu helpers).

OK, so i am assuming you are good with the general idea of the patch
(and have no better one) which is:

idx = block_interf_srcu_read_lock();
ret = smp_call_function_single_fail(cpu, remote_fn, ...); (or stop_machine_fail)
block_interf_srcu_read_unlock(idx);