Re: [PATCH] lockdep: lockdep_set_notrack_class()

From: Waiman Long
Date: Sun Jun 30 2024 - 23:16:53 EST



On 6/30/24 20:10, Kent Overstreet wrote:
On Sun, Jun 30, 2024 at 06:08:21PM GMT, Waiman Long wrote:
On 6/30/24 01:10, Kent Overstreet wrote:
Add a new helper to disable lockdep tracking entirely for a given class.

This is needed for bcachefs, which takes too many btree node locks for
lockdep to track. Instead, we have a single lockdep_map for "btree_trans
has any btree nodes locked", which makes more since given that we have
centralized lock management and a cycle detector.
Could you explain a bit more what the current novalidate_class is lacking
WRT to the bcachefs lock? Is it excessive performance overhead or some bogus
lockdep warning?
novalidate just switches off checking of lock ordering, but the fact
that the locks are held is still tracked.

bcachefs takes more btree node locks than lockdep can track, so I'm
switching to a single lockdep map for "this btree_trans has any btree
nodes locked" instead.

I asked because you are adding a new special class that is similar to no_validate in some way but also a bit different. So we need to document what each of these special classes are for to avoid confusion.

Cheers,
Longman