Re: [PATCH] x86/alternatives: remove false sharing in poke_int3_handler()

From: Ingo Molnar
Date: Tue Mar 25 2025 - 04:41:31 EST



* Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:

> On Mon, Mar 24, 2025 at 08:53:31AM +0100, Eric Dumazet wrote:
>
> > BTW the atomic_cond_read_acquire() part is never called even during my
> > stress test.
>
> Yes, IIRC this is due to text_poke_sync() serializing the state, as that
> does a synchronous IPI broadcast, which by necessity requires all
> previous INT3 handlers to complete.
>
> You can only hit that case if the INT3 remains after step-3 (IOW you're
> actively writing INT3 into the text). This is exceedingly rare.

Might make sense to add a comment for that.

Also, any strong objections against doing this in the namespace:

s/bp_/int3_

?

Half of the code already calls it a variant of 'int3', half of it 'bp',
which I had to think for a couple of seconds goes for breakpoint, not
base pointer ... ;-)

Might as well standardize on int3_ and call it a day?

Thanks,

Ingo