Skip to contentSkip to conversation

Increase lockdep limits: MAX_LOCK_DEPTH

PATCH NAK Joao Correia 2 participants 5 messages Jul 7, 2009 Scheduler

lore
Share & tools
lore
#0 lore raw

PATCH 2/3 Increase lockdep limits: MAX_LOCK_DEPTH

(Applies to current Linus tree, as of 2.6.31-rc2)

As a result of increasing MAX_STACK_TRACE_ENTRIES on the previous patch, another limit surfaced as being hit too soon.
This patch increases MAX_LOCK_DEPTH, being hit by false positives, and turning off the locking correctness validator.

The new value is arbitrary, but I believe the old one was too. Given the amount of changes happening with regards to the usage of lockdep, the previous limit is just too low and keeping it that way would defeat the purpose of lockdep.

---
 include/linux/sched.h |    2 +-

1 files changes, 1 insertions(+), 1 deletions(-)

include/linux/sched.h +1 -1
index 0085d75..304231b 100644
@@ -1367,7 +1367,7 @@ struct task_struct {
        int softirq_context;
 #endif
 #ifdef CONFIG_LOCKDEP
-# define MAX_LOCK_DEPTH 48UL
+# define MAX_LOCK_DEPTH 96UL
        u64 curr_chain_key;
        int lockdep_depth;
        unsigned int lockdep_recursion;

---

#1 lore raw
Quoted 7 lines · Joao Correia

(Applies to current Linus tree, as of 2.6.31-rc2)

As a result of increasing MAX_STACK_TRACE_ENTRIES on the previous patch, another limit surfaced as being hit too soon.
This patch increases MAX_LOCK_DEPTH, being hit by false positives, and turning off the locking correctness validator.

Quoted 7 lines

The new value is arbitrary, but I believe the old one was too. Given the amount of changes happening with regards to the usage of lockdep, the previous limit is just too low and keeping it that way would defeat the purpose of lockdep.

NAK, find the site that triggers this and fix it. holding more than 48 locks at any one time is silly.

Quoted 18 lines
---
 include/linux/sched.h |    2 +-

1 files changes, 1 insertions(+), 1 deletions(-)

include/linux/sched.h +1 -2
index 0085d75..304231b 100644
@@ -1367,7 +1367,7 @@ struct task_struct {
        int softirq_context;
 #endif
 #ifdef CONFIG_LOCKDEP
-# define MAX_LOCK_DEPTH 48UL
+# define MAX_LOCK_DEPTH 96UL
        u64 curr_chain_key;
        int lockdep_depth;
        unsigned int lockdep_recursion;
---
#2 lore raw

Im running into this in places as diverse as modprobe, swapper, udevd and ip6tables-restore. It doesnt happen always on the same one, and the stack traces dont point to an (apparent) common point, hence me flagging this as a limit that is just being triggered due to increased lockdep usage.

Joao Correia

Quoted 39 lines · Peter Zijlstra
Quoted 7 lines · Joao Correia

(Applies to current Linus tree, as of 2.6.31-rc2)

As a result of increasing MAX_STACK_TRACE_ENTRIES on the previous patch, another limit surfaced as being hit too soon.
This patch increases MAX_LOCK_DEPTH, being hit by false positives, and turning off the locking correctness validator.

Quoted 7 lines

The new value is arbitrary, but I believe the old one was too. Given the amount of changes happening with regards to the usage of lockdep, the previous limit is just too low and keeping it that way would defeat the purpose of lockdep.

NAK, find the site that triggers this and fix it. holding more than 48 locks at any one time is silly.

Quoted 18 lines

---
 include/linux/sched.h |    2 +-
 1 files changes, 1 insertions(+), 1 deletions(-)

include/linux/sched.h +1 -2
index 0085d75..304231b 100644
@@ -1367,7 +1367,7 @@ struct task_struct {
         int softirq_context;
  #endif
  #ifdef CONFIG_LOCKDEP
-# define MAX_LOCK_DEPTH 48UL
+# define MAX_LOCK_DEPTH 96UL
         u64 curr_chain_key;
         int lockdep_depth;
         unsigned int lockdep_recursion;
---
#3 lore raw

A: Because we read from top to bottom, left to right.
Q: Why should I start my reply below the quoted text?

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

A: The lost context.
Q: What makes top-posted replies harder to read than bottom-posted?

Quoted 17 lines · Joao Correia
Quoted 16 lines · Peter Zijlstra
Quoted 14 lines · Joao Correia

(Applies to current Linus tree, as of 2.6.31-rc2)

As a result of increasing MAX_STACK_TRACE_ENTRIES on the previous patch, another limit surfaced as being hit too soon.
This patch increases MAX_LOCK_DEPTH, being hit by false positives, and turning off the locking correctness validator.

The new value is arbitrary, but I believe the old one was too. Given the amount of changes happening with regards to the usage of lockdep, the previous limit is just too low and keeping it that way would defeat the purpose of lockdep.

Quoted 8 lines
Quoted 2 lines

NAK, find the site that triggers this and fix it. holding more than 48 locks at any one time is silly.

Im running into this in places as diverse as modprobe, swapper, udevd and ip6tables-restore. It doesnt happen always on the same one, and the stack traces dont point to an (apparent) common point, hence me flagging this as a limit that is just being triggered due to increased lockdep usage.

This particular one will only trigger on the sites where you do indeed hold >48 locks. If that triggers on multiple sites we really have a problem.

Quoted 20 lines
Quoted 20 lines
Quoted 18 lines
---
 include/linux/sched.h |    2 +-

1 files changes, 1 insertions(+), 1 deletions(-)

include/linux/sched.h +1 -2
index 0085d75..304231b 100644
@@ -1367,7 +1367,7 @@ struct task_struct {
        int softirq_context;
 #endif
 #ifdef CONFIG_LOCKDEP
-# define MAX_LOCK_DEPTH 48UL
+# define MAX_LOCK_DEPTH 96UL
        u64 curr_chain_key;
        int lockdep_depth;
        unsigned int lockdep_recursion;
---
#4 lore raw
Quoted 10 lines · Peter Zijlstra

A: Because we read from top to bottom, left to right.
Q: Why should I start my reply below the quoted text?

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

A: The lost context.
Q: What makes top-posted replies harder to read than bottom-posted?

Interesting :-).

Ill keep that in mind, apologies.

Joao Correia