Re: BUG: scheduling while atomic with PREEMPT_RT=y and bpf selftests

From: Sebastian Andrzej Siewior
Date: Mon Jun 16 2025 - 02:29:25 EST


On 2025-06-16 00:12:49 [+0200], Bert Karwatzki wrote:
> These three patches fixes all the dmesg warning (with CONFIG_LOCKDEP) issues when running the
> bpf test_progs and does not cause deadlocks without CONFIG_LOCKDEP.
>

> is fixed by this:
>
> diff --git a/include/trace/bpf_probe.h b/include/trace/bpf_probe.h
> index 183fa2aa2935..49257cb90209 100644
> --- a/include/trace/bpf_probe.h
> +++ b/include/trace/bpf_probe.h
> @@ -58,9 +58,9 @@ static notrace void \
> __bpf_trace_##call(void *__data, proto) \
> { \
> might_fault(); \
> - preempt_disable_notrace(); \
> + migrate_disable(); \
> CONCATENATE(bpf_trace_run, COUNT_ARGS(args))(__data, CAST_TO_U64(args)); \
> - preempt_enable_notrace(); \
> + migrate_enable(); \
> }

I doubt this can be fixed that way. I sent a series out
https://lore.kernel.org/all/20250613152218.1924093-1-bigeasy@xxxxxxxxxxxxx/

which is the first the step towards fixing this properly.

Sebastian