Re: [PATCH bpf-next v3 7/9] bpf: expose deferred .BTF.base module BTF in sysfs from module load

From: Jay Wang

Date: Thu Oct 01 2026 - 19:54:43 EST


Right, fixed in v4 (patch 8/12):
https://lore.kernel.org/bpf/20261001225214.12351-1-wanjay@xxxxxxxxxx/

The reader no longer loads the vmlinux BTF itself. If it is not there
yet, the reader queues a work item that calls bpf_load_btf_vmlinux(),
and waits for the module's BTF to be published, for @gone, or for the
load attempt to end without the BTF. MODULE_STATE_GOING sets @gone and
wakes before it removes the file, so the drain no longer waits on a
module load: in your cycle the reader returns -ENODEV, the drain
completes, GOING returns, and the kworker's modprobe gets the rwsem once
the writer is done.

On the lock comment, you are right that the btf_module_mutex ->
cand_cache_mutex edge is gone. v4 states what the separate lock does
keep: btf_module_mutex, which the module notifier takes, is never taken
under btf_vmlinux_lock.

Jay