Skip to contentSkip to conversation

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

PATCH Superseded Luis Claudio R. Goncalves 3 participants 4 messages Jul 25, 2024 – Jul 29, 2024 Locking primitives

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 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 configuration switch LOCKDEP_CIRCULAR_QUEUE_BITS should fix the warning.

Preface the scary bactrace 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 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
Reviewed-by on v1 1/1
#1 lore raw
Quoted 22 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 configuration switch LOCKDEP_CIRCULAR_QUEUE_BITS should fix the warning.

Preface the scary bactrace 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 +0 -0
index 58c88220a478a..1cf6d9fdddc9c 100644

kernel/locking/lockdep.c static noinline void print_bfs_bug(int ret) · line 2070

Quoted 4 lines
kernel/locking/lockdep.c +1 -0
@@ -2067,6 +2067,9 @@ static noinline void print_bfs_bug(int ret)
 	/*
 	 * Breadth-first-search failed, graph got corrupted?
 	 */
+	if (ret  == BFS_EQUEUEFULL)

This line has an extra space after "ret", but otherwise it looks fine.

Regards,
Boqun

Quoted 8 lines
kernel/locking/lockdep.c +2 -0
+		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
Quoted 18 lines · Boqun Feng
Quoted 17 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 configuration switch LOCKDEP_CIRCULAR_QUEUE_BITS should fix the warning.

Preface the scary bactrace 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(+)
Quoted 11 lines

kernel/locking/lockdep.c static noinline void print_bfs_bug(int ret) · line 2070

Quoted 9 lines
kernel/locking/lockdep.c +1 -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)

This line has an extra space after "ret", but otherwise it looks fine.

Should I send a v2 of the patch with the extra whitespace removed?

Luis

Quoted 5 lines

Regards,
Boqun

Quoted 9 lines
Quoted 8 lines
kernel/locking/lockdep.c +2 -0
+		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

---end quoted text---

reviewer Reviewed-by
#3 lore raw
Quoted 29 lines · Luis Claudio R. Goncalves
Quoted 18 lines · Boqun Feng
Quoted 17 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 configuration switch LOCKDEP_CIRCULAR_QUEUE_BITS should fix the warning.

Preface the scary bactrace 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(+)
Quoted 10 lines

kernel/locking/lockdep.c static noinline void print_bfs_bug(int ret) · line 2070

Quoted 9 lines
kernel/locking/lockdep.c +1 -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)

This line has an extra space after "ret", but otherwise it looks fine.

Quoted 3 lines

Should I send a v2 of the patch with the extra whitespace removed?

Luis

Yes, you should. Other than the extra space, the patch looks good to me too.

You can also add our review-by tags in your v2 patch.

Cheers,
Longman

Quoted 16 lines
Quoted 6 lines

Regards,
Boqun

Quoted 8 lines
Quoted 8 lines
kernel/locking/lockdep.c +2 -0
+		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

---end quoted text---