Re: [PATCH V2] lockdep: suggest the fix for "lockdep bfs error:-1" on print_bfs_bug

From: Boqun Feng
Date: Mon Aug 05 2024 - 13:43:27 EST


On Tue, Jul 30, 2024 at 02:45:47PM -0300, Luis Claudio R. Goncalves wrote:
> When lockdep fails while performing the Breadth-first-search operation
> due to lack of memory, hint that increasing the value of the config
> switch LOCKDEP_CIRCULAR_QUEUE_BITS should fix the warning.
>
> Preface the scary backtrace with the suggestion:
>
> [ 163.849242] Increase LOCKDEP_CIRCULAR_QUEUE_BITS to avoid this warning:
> [ 163.849248] ------------[ cut here ]------------
> [ 163.849250] lockdep bfs error:-1
> [ 163.849263] WARNING: CPU: 24 PID: 2454 at kernel/locking/lockdep.c:2091 print_bfs_bug+0x27/0x40
> ...
>
> Reviewed-by: Boqun Feng <boqun.feng@xxxxxxxxx>
> Reviewed-by: Waiman Long <longman@xxxxxxxxxx>
> Signed-off-by: Luis Claudio R. Goncalves <lgoncalv@xxxxxxxxxx>

Queued at:

https://git.kernel.org/pub/scm/linux/kernel/git/boqun/linux.git/
lockdep-for-tip

Thanks!

Regards,
Boqun

> ---
>
> Changes in v2:
> - removed extra space from the if condition.
>
> kernel/locking/lockdep.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
> index 58c88220a478a..1cf6d9fdddc9c 100644
> --- a/kernel/locking/lockdep.c
> +++ b/kernel/locking/lockdep.c
> @@ -2067,6 +2067,9 @@ static noinline void print_bfs_bug(int ret)
> /*
> * Breadth-first-search failed, graph got corrupted?
> */
> + if (ret == BFS_EQUEUEFULL)
> + pr_warn("Increase LOCKDEP_CIRCULAR_QUEUE_BITS to avoid this warning:\n");
> +
> WARN(1, "lockdep bfs error:%d\n", ret);
> }
>
> --
> 2.45.2
>