Re: [PATCH V2] lockdep: fix deadlock issue between lockdep and rcu

From: Bart Van Assche
Date: Thu Feb 01 2024 - 16:24:57 EST


On 2/1/24 11:48, Boqun Feng wrote:
raw_spin_lock_irqsave():
lock_acquire():
__lock_acquire():
validate_chain():
lookup_chain_cache_add():
graph_lock();

Basically, every lock acquisition may lock the lockdep graph because
of dependency checking.

Wouldn't it be simpler to make __lock_acquire() return early if
this_cpu_read(lockdep_recursion) indicates that the graph lock is held?

Thanks,

Bart.