Skip to content

Commit e245d99

Browse files
Babu Mogerdavem330
authored andcommitted
lockdep: Limit static allocations if PROVE_LOCKING_SMALL is defined
Reduce the size of data structure for lockdep entries by half if PROVE_LOCKING_SMALL if defined. This is used only for sparc. Signed-off-by: Babu Moger <babu.moger@oracle.com> Acked-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent e6b5f1b commit e245d99

1 file changed

Lines changed: 17 additions & 3 deletions

File tree

kernel/locking/lockdep_internals.h

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@ enum {
4545
#define LOCKF_USED_IN_IRQ_READ \
4646
(LOCKF_USED_IN_HARDIRQ_READ | LOCKF_USED_IN_SOFTIRQ_READ)
4747

48+
/*
49+
* CONFIG_PROVE_LOCKING_SMALL is defined for sparc. Sparc requires .text,
50+
* .data and .bss to fit in required 32MB limit for the kernel. With
51+
* PROVE_LOCKING we could go over this limit and cause system boot-up problems.
52+
* So, reduce the static allocations for lockdeps related structures so that
53+
* everything fits in current required size limit.
54+
*/
55+
#ifdef CONFIG_PROVE_LOCKING_SMALL
4856
/*
4957
* MAX_LOCKDEP_ENTRIES is the maximum number of lock dependencies
5058
* we track.
@@ -54,18 +62,24 @@ enum {
5462
* table (if it's not there yet), and we check it for lock order
5563
* conflicts and deadlocks.
5664
*/
65+
#define MAX_LOCKDEP_ENTRIES 16384UL
66+
#define MAX_LOCKDEP_CHAINS_BITS 15
67+
#define MAX_STACK_TRACE_ENTRIES 262144UL
68+
#else
5769
#define MAX_LOCKDEP_ENTRIES 32768UL
5870

5971
#define MAX_LOCKDEP_CHAINS_BITS 16
60-
#define MAX_LOCKDEP_CHAINS (1UL << MAX_LOCKDEP_CHAINS_BITS)
61-
62-
#define MAX_LOCKDEP_CHAIN_HLOCKS (MAX_LOCKDEP_CHAINS*5)
6372

6473
/*
6574
* Stack-trace: tightly packed array of stack backtrace
6675
* addresses. Protected by the hash_lock.
6776
*/
6877
#define MAX_STACK_TRACE_ENTRIES 524288UL
78+
#endif
79+
80+
#define MAX_LOCKDEP_CHAINS (1UL << MAX_LOCKDEP_CHAINS_BITS)
81+
82+
#define MAX_LOCKDEP_CHAIN_HLOCKS (MAX_LOCKDEP_CHAINS*5)
6983

7084
extern struct list_head all_lock_classes;
7185
extern struct lock_chain lock_chains[];

0 commit comments

Comments
 (0)