Re: [PATCH v2 0/6] kcov: Suppress timer and scheduler coverage leaks
From: Karl Mehltretter
Date: Tue Sep 01 2026 - 01:50:30 EST
On Tue, Aug 11, 2026 at 05:41:05PM +0100, Karl Mehltretter wrote:
>
> Add a nestable KCOV_PAUSED bit and a kcov_pause guard. Use the guard for
> deferred hrtimer rearm, __schedule(), the try_to_wake_up() wakeup body
> and wake_up_new_task(). This suppresses their instrumented callees
> without excluding those callees from task-context coverage.
>
Andrey, Alexander, Dmitry,
Could you please take a look at this series from the KCOV side?
It fixes the CONFIG_KCOV_SELFTEST failures covered by this series. Some
architectures still need further architecture-specific KCOV
instrumentation exclusions.
The three syzkaller A/B pairs from the cover letter also suggest
better coverage: at matched execution counts, the patched kernels had
14-19% more coverage and 42-54% larger corpora.
Do you think the pause mechanism and the places where it is used make
sense? Do you want me to continue with a v3?
I also looked at the Sashiko dashboard report:
https://sashiko.dev/#/patchset/20260811154111.64669-1-kmehltretter@xxxxxxxxx
I don't think the remaining warning about reordering or removing the
kcov_mode stores is real for these call sites.
One small change opportunity for v3: In try_to_wake_up(), I would take
the kcov_pause guard before the preempt guard. Cleanup then runs
preempt_enable() while KCOV is still paused and resumes KCOV afterwards.
I would also replace "uninstrumented" with "built without KCOV
instrumentation" to avoid the ambiguity Peter pointed out.
Separately, I will look at turning Peter's IRQ-exit preempt-count
proposal into a standalone patch for instrumentation in general,
especially KCSAN. It does not replace this KCOV series, since it only
covers work run directly from IRQ exit.
Thanks,
Karl