[08/10] x86-64: select DYNAMIC_DEBUG_RELATIVE_POINTERS
diff mbox series

Message ID 20190409212517.7321-9-linux@rasmusvillemoes.dk
State In Next
Commit 6c5c9318c1d396a0274992c923127e2e20b5b08a
Headers show
Series
  • implement DYNAMIC_DEBUG_RELATIVE_POINTERS
Related show

Commit Message

Rasmus Villemoes April 9, 2019, 9:25 p.m. UTC
This reduces the size of struct _ddebug from 56 to 40 bytes. There's
one such struct for each pr_debug(), netdev_debug() etc. in a
CONFIG_DYNAMIC_DEBUG kernel. An Ubuntu 4.15 kernel has about 2550
entries in the __verbose section of vmlinux, amounting to ~40K
saved. (Modules also become smaller, but it's harder to quantify how
much that yields at runtime.)

For comparison, the __bug_table section of that Ubuntu kernel is 75576
bytes, i.e. 6298 12-byte bug_entrys, so GENERIC_BUG_RELATIVE_POINTERS
saves ~50K.

Due to the build-time sanity checks in asm-generic/dynamic_debug.h, we
need to add another #undef to vclock_gettime.c.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
 arch/x86/Kconfig                            | 1 +
 arch/x86/entry/vdso/vdso32/vclock_gettime.c | 1 +
 arch/x86/include/asm/Kbuild                 | 1 +
 3 files changed, 3 insertions(+)

Comments

Ingo Molnar April 10, 2019, 7:31 a.m. UTC | #1
* Rasmus Villemoes <linux@rasmusvillemoes.dk> wrote:

> This reduces the size of struct _ddebug from 56 to 40 bytes. There's
> one such struct for each pr_debug(), netdev_debug() etc. in a
> CONFIG_DYNAMIC_DEBUG kernel. An Ubuntu 4.15 kernel has about 2550
> entries in the __verbose section of vmlinux, amounting to ~40K
> saved. (Modules also become smaller, but it's harder to quantify how
> much that yields at runtime.)
> 
> For comparison, the __bug_table section of that Ubuntu kernel is 75576
> bytes, i.e. 6298 12-byte bug_entrys, so GENERIC_BUG_RELATIVE_POINTERS
> saves ~50K.
> 
> Due to the build-time sanity checks in asm-generic/dynamic_debug.h, we
> need to add another #undef to vclock_gettime.c.
> 
> Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
> ---
>  arch/x86/Kconfig                            | 1 +
>  arch/x86/entry/vdso/vdso32/vclock_gettime.c | 1 +
>  arch/x86/include/asm/Kbuild                 | 1 +
>  3 files changed, 3 insertions(+)
> 
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index 5ad92419be19..eb5488b4577d 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -30,6 +30,7 @@ config X86_64
>  	select SWIOTLB
>  	select X86_DEV_DMA_OPS
>  	select ARCH_HAS_SYSCALL_WRAPPER
> +	select DYNAMIC_DEBUG_RELATIVE_POINTERS

Acked-by: Ingo Molnar <mingo@kernel.org>

Thanks,

	Ingo

Patch
diff mbox series

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 5ad92419be19..eb5488b4577d 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -30,6 +30,7 @@  config X86_64
 	select SWIOTLB
 	select X86_DEV_DMA_OPS
 	select ARCH_HAS_SYSCALL_WRAPPER
+	select DYNAMIC_DEBUG_RELATIVE_POINTERS
 
 #
 # Arch settings
diff --git a/arch/x86/entry/vdso/vdso32/vclock_gettime.c b/arch/x86/entry/vdso/vdso32/vclock_gettime.c
index 9242b28418d5..9acec4426206 100644
--- a/arch/x86/entry/vdso/vdso32/vclock_gettime.c
+++ b/arch/x86/entry/vdso/vdso32/vclock_gettime.c
@@ -17,6 +17,7 @@ 
 #undef CONFIG_ILLEGAL_POINTER_VALUE
 #undef CONFIG_SPARSEMEM_VMEMMAP
 #undef CONFIG_NR_CPUS
+#undef CONFIG_DYNAMIC_DEBUG_RELATIVE_POINTERS
 
 #define CONFIG_X86_32 1
 #define CONFIG_PGTABLE_LEVELS 2
diff --git a/arch/x86/include/asm/Kbuild b/arch/x86/include/asm/Kbuild
index a0ab9ab61c75..793d2c6735b9 100644
--- a/arch/x86/include/asm/Kbuild
+++ b/arch/x86/include/asm/Kbuild
@@ -7,6 +7,7 @@  generated-y += unistd_64_x32.h
 generated-y += xen-hypercalls.h
 
 generic-y += dma-contiguous.h
+generic-y += dynamic_debug.h
 generic-y += early_ioremap.h
 generic-y += export.h
 generic-y += mcs_spinlock.h