Skip to content

Commit

Permalink
sparc64: Use LOCKDEP_SMALL, not PROVE_LOCKING_SMALL
Browse files Browse the repository at this point in the history
CONFIG_PROVE_LOCKING_SMALL shrinks the memory usage of lockdep so the
kernel text, data, and bss fit in the required 32MB limit, but this
option is not set for every config that enables lockdep.

A 4.10 kernel fails to boot with the console output

    Kernel: Using 8 locked TLB entries for main kernel image.
    hypervisor_tlb_lock[2000000:0:8000000071c007c3:1]: errors with f
    Program terminated

with these config options

    CONFIG_LOCKDEP=y
    CONFIG_LOCK_STAT=y
    CONFIG_PROVE_LOCKING=n

To fix, rename CONFIG_PROVE_LOCKING_SMALL to CONFIG_LOCKDEP_SMALL, and
enable this option with CONFIG_LOCKDEP=y so we get the reduced memory
usage every time lockdep is turned on.

Tested that CONFIG_LOCKDEP_SMALL is set to 'y' if and only if
CONFIG_LOCKDEP is set to 'y'.  When other lockdep-related config options
that select CONFIG_LOCKDEP are enabled (e.g. CONFIG_LOCK_STAT or
CONFIG_PROVE_LOCKING), verified that CONFIG_LOCKDEP_SMALL is also
enabled.

Fixes: e6b5f1b ("config: Adding the new config parameter CONFIG_PROVE_LOCKING_SMALL for sparc")
Signed-off-by: Daniel Jordan <[email protected]>
Reviewed-by: Babu Moger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
danieljordan10 authored and davem330 committed Apr 18, 2017
1 parent fb5e215 commit 395102d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion arch/sparc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ config SPARC
select ARCH_HAS_SG_CHAIN
select CPU_NO_EFFICIENT_FFS
select HAVE_ARCH_HARDENED_USERCOPY
select PROVE_LOCKING_SMALL if PROVE_LOCKING
select LOCKDEP_SMALL if LOCKDEP
select ARCH_WANT_RELAX_ORDER

config SPARC32
Expand Down
6 changes: 3 additions & 3 deletions kernel/locking/lockdep_internals.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ enum {
(LOCKF_USED_IN_HARDIRQ_READ | LOCKF_USED_IN_SOFTIRQ_READ)

/*
* CONFIG_PROVE_LOCKING_SMALL is defined for sparc. Sparc requires .text,
* CONFIG_LOCKDEP_SMALL is defined for sparc. Sparc requires .text,
* .data and .bss to fit in required 32MB limit for the kernel. With
* PROVE_LOCKING we could go over this limit and cause system boot-up problems.
* CONFIG_LOCKDEP we could go over this limit and cause system boot-up problems.
* So, reduce the static allocations for lockdeps related structures so that
* everything fits in current required size limit.
*/
#ifdef CONFIG_PROVE_LOCKING_SMALL
#ifdef CONFIG_LOCKDEP_SMALL
/*
* MAX_LOCKDEP_ENTRIES is the maximum number of lock dependencies
* we track.
Expand Down
6 changes: 3 additions & 3 deletions lib/Kconfig.debug
Original file line number Diff line number Diff line change
Expand Up @@ -1103,9 +1103,6 @@ config PROVE_LOCKING

For more details, see Documentation/locking/lockdep-design.txt.

config PROVE_LOCKING_SMALL
bool

config LOCKDEP
bool
depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
Expand All @@ -1114,6 +1111,9 @@ config LOCKDEP
select KALLSYMS
select KALLSYMS_ALL

config LOCKDEP_SMALL
bool

config LOCK_STAT
bool "Lock usage statistics"
depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
Expand Down

0 comments on commit 395102d

Please sign in to comment.