Skip to contentSkip to conversation

lockdep: suggest the fix for "lockdep bfs error:-1" on print_bfs_bug

PATCH Applied Luis Claudio R. Goncalves 4 participants 4 messages Jul 30, 2024 – Aug 6, 2024 Locking primitives

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 lockdep: suggest the fix for "lockdep bfs error:-1" on print_bfs_bug

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
    ...

---

Changes in v2:
- removed extra space from the if condition.

 kernel/locking/lockdep.c | 3 +++
 1 file changed, 3 insertions(+)
kernel/locking/lockdep.c +3 -0
index 58c88220a478a..1cf6d9fdddc9c 100644
@@ -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);
 }
 
Signature · 1 line
2.45.2
maintainer
#1 lore raw
Quoted 12 lines · Luis Claudio R. Goncalves

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
    ...
Quoted 3 lines

Thanks!

Quoted 25 lines

---

Changes in v2:
- removed extra space from the if condition.

 kernel/locking/lockdep.c | 3 +++
 1 file changed, 3 insertions(+)
kernel/locking/lockdep.c +3 -0
index 58c88220a478a..1cf6d9fdddc9c 100644
@@ -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);
 }
 
Signature · 1 line
2.45.2
#2 lore raw
In reply to Luis Claudio R. Goncalves
Quoted 12 lines · Luis Claudio R. Goncalves

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
    ...
Quoted 3 lines

Queued at:

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

Thanks!

Regards,
Boqun

Quoted 25 lines

---

Changes in v2:
- removed extra space from the if condition.

 kernel/locking/lockdep.c | 3 +++
 1 file changed, 3 insertions(+)
kernel/locking/lockdep.c +3 -0
index 58c88220a478a..1cf6d9fdddc9c 100644
@@ -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);
 }
 
Signature · 1 line
2.45.2
#3 lore raw
In reply to Luis Claudio R. Goncalves
The following commit has been merged into the locking/core branch of tip:

The following commit has been merged into the locking/core branch of tip:

Commit-ID:     7886a61ebc1f3998df5950299cbe17272bf32c59
Gitweb:        https://git.kernel.org/tip/7886a61ebc1f3998df5950299cbe17272bf32c59
Author:        Luis Claudio R. Goncalves <[email protected]>
AuthorDate:    Tue, 30 Jul 2024 14:45:47 -03:00
Committer:     Peter Zijlstra <[email protected]>
CommitterDate: Mon, 05 Aug 2024 16:54:41 +02:00

lockdep: suggest the fix for "lockdep bfs error:-1" on print_bfs_bug

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
    ...
---
 kernel/locking/lockdep.c | 3 +++
 1 file changed, 3 insertions(+)
kernel/locking/lockdep.c +3 -0
index 726b22c..fee21f3 100644
@@ -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);
 }