Re: [PATCH v4 4/6] sched/core: Pause KCOV in __schedule()

From: Karl Mehltretter

Date: Sat Oct 31 2026 - 09:09:57 EST


On Fri, Oct 30, 2026 at 02:23:54PM +0100, Andrew Morton wrote:
> __attribute__((no_instrument_function))
> __attribute__((__always_inline__))
> class_kcov_pause_t class_kcov_pause_constructor(void)
> {
> class_kcov_pause_t _t = { .lock = (void*)1 },
> *_T __attribute__((__unused__)) = &_t;
> _T->paused = __kcov_pause();
> return _t;
> }
>
> Adding all this goop to core scheduler functions on non-KCOV kernels
> won't be terribly popular!
>
> A bit of macro magic can trivially make all this go away for non-KCOV
> kernels. The overhead is probably acceptable with CONFIG_KCOV=y
> kernels - seems it's only enabled for debug/research/fuzzing kernels.
>
> Ditto the hrtimer change. Aim to make these patches produce no change
> in generated code with CONFIG_KCOV=n.
>

Good point. Leaving the guard outside #ifdef CONFIG_KCOV was an
oversight in v2. I will fix this and the hrtimer wrapper in v5.

Thanks,
Karl