Re: [BUG] -next lockdep invalid wait context
From: Tejun Heo
Date: Mon Nov 04 2024 - 13:08:13 EST
Hello,
On Fri, Nov 01, 2024 at 05:45:01PM -0700, Boqun Feng wrote:
...
> Because it's a different bug.
>
> schedule():
> __schedule():
> rq_lock(); // <- rq lock is a raw spin lock, so no sleep inside
> switch_mm_irqs_off():
> trace_tlb_flush():
> bpf_trace_run2():
> stack_map_get_build_id_offset():
> mmap_read_trylock(): // this is actually ok, because
> // trylock() on rwsem won't
> // sleep.
> __mmap_lock_trace_acquire_returned():
> get_mm_memcg_path():
> cgroup_path():
> kernfs_path_from_node():
> read_lock_irqsave(); // on RT, read_lock()
> // is a rwsem IIUC,
> // so might sleep.
> // hence the issue.
>
> Maybe kernfs can use RCU instead of read_lock here? I don't know...
Yeah, we should be able to make kn->name RCU protected and drop the usage of
the rename lock in read paths.
Thanks.
--
tejun