On Tue, Nov 19, 2024 at 03:39:02PM -0800, Josh Poimboeuf wrote:
On Tue, Nov 19, 2024 at 04:34:53PM +0100, Valentin Schneider wrote:
Later commits will cause objtool to warn about non __ro_after_init static keys being used in .noinstr sections in order to safely defer instruction patching IPIs targeted at NOHZ_FULL CPUs.
Don't we need similar checking for static calls?
Two such keys currently exist: mds_idle_clear and __sched_clock_stable, which can both be modified at runtime.
Not sure if feasible, but it sure would be a lot simpler to just make "no noinstr patching" a hard rule and then convert the above keys (or at least their noinstr-specific usage) to regular branches.
That'll be a bit of a mess. Also, then we're adding overhead/cost for all people for the benefit of this fringe case (NOHZ_FULL). Not a desirable trade-off IMO.
So I do think the proposed solution (+- naming, I like your naming proposal better) is the better one.
But I think we can make the fall-back safer, we can simply force the IPI when we poke at noinstr code -- then NOHZ_FULL gets to keep the pieces, but at least we don't violate any correctness constraints.