linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] RISC-V: Add fragmented config for debug options
@ 2019-12-05 17:49 Anup Patel
  2019-12-06  9:00 ` Daniel Thompson
  0 siblings, 1 reply; 3+ messages in thread
From: Anup Patel @ 2019-12-05 17:49 UTC (permalink / raw)
  To: Palmer Dabbelt, Paul Walmsley, Albert Ou
  Cc: Atish Patra, Alistair Francis, Christoph Hellwig, Anup Patel,
	linux-riscv, linux-kernel, Anup Patel

Various Linux kernel DEBUG options have big performance impact so
these should not be enabled in RISC-V normal defconfigs.

Instead we should have separate RISC-V fragmented config for enabling
these DEBUG options. This way Linux RISC-V kernel can be built for
both non-debug and debug purposes using same defconfig.

This patch moves additional DEBUG options to extra_debug.config.

To configure a non-debug RV64 kernel, we use our normal defconfig:
   $ make O=<linux_build_directory> defconfig
Wherease to configure a debug RV64 kernel, we use extra_debug.config:
   $ make O=<linux_build_directory> defconfig extra_debug.config

Signed-off-by: Anup Patel <anup.patel@wdc.com>
---
Changes since v1:
 - Use fragmented .config instead of separate debug defconfigs.
---
 arch/riscv/configs/defconfig          | 23 -----------------------
 arch/riscv/configs/extra_debug.config | 21 +++++++++++++++++++++
 arch/riscv/configs/rv32_defconfig     | 23 -----------------------
 3 files changed, 21 insertions(+), 46 deletions(-)
 create mode 100644 arch/riscv/configs/extra_debug.config

diff --git a/arch/riscv/configs/defconfig b/arch/riscv/configs/defconfig
index e2ff95cb3390..f0710d8f50cc 100644
--- a/arch/riscv/configs/defconfig
+++ b/arch/riscv/configs/defconfig
@@ -101,27 +101,4 @@ CONFIG_CRYPTO_USER_API_HASH=y
 CONFIG_CRYPTO_DEV_VIRTIO=y
 CONFIG_PRINTK_TIME=y
 CONFIG_DEBUG_FS=y
-CONFIG_DEBUG_PAGEALLOC=y
-CONFIG_DEBUG_VM=y
-CONFIG_DEBUG_VM_PGFLAGS=y
-CONFIG_DEBUG_MEMORY_INIT=y
-CONFIG_DEBUG_PER_CPU_MAPS=y
-CONFIG_SOFTLOCKUP_DETECTOR=y
-CONFIG_WQ_WATCHDOG=y
-CONFIG_SCHED_STACK_END_CHECK=y
-CONFIG_DEBUG_TIMEKEEPING=y
-CONFIG_DEBUG_RT_MUTEXES=y
-CONFIG_DEBUG_SPINLOCK=y
-CONFIG_DEBUG_MUTEXES=y
-CONFIG_DEBUG_RWSEMS=y
-CONFIG_DEBUG_ATOMIC_SLEEP=y
-CONFIG_STACKTRACE=y
-CONFIG_DEBUG_LIST=y
-CONFIG_DEBUG_PLIST=y
-CONFIG_DEBUG_SG=y
 # CONFIG_RCU_TRACE is not set
-CONFIG_RCU_EQS_DEBUG=y
-CONFIG_DEBUG_BLOCK_EXT_DEVT=y
-# CONFIG_FTRACE is not set
-# CONFIG_RUNTIME_TESTING_MENU is not set
-CONFIG_MEMTEST=y
diff --git a/arch/riscv/configs/extra_debug.config b/arch/riscv/configs/extra_debug.config
new file mode 100644
index 000000000000..66c58bb645a4
--- /dev/null
+++ b/arch/riscv/configs/extra_debug.config
@@ -0,0 +1,21 @@
+CONFIG_DEBUG_PAGEALLOC=y
+CONFIG_DEBUG_VM=y
+CONFIG_DEBUG_VM_PGFLAGS=y
+CONFIG_DEBUG_MEMORY_INIT=y
+CONFIG_DEBUG_PER_CPU_MAPS=y
+CONFIG_SOFTLOCKUP_DETECTOR=y
+CONFIG_WQ_WATCHDOG=y
+CONFIG_SCHED_STACK_END_CHECK=y
+CONFIG_DEBUG_TIMEKEEPING=y
+CONFIG_DEBUG_RT_MUTEXES=y
+CONFIG_DEBUG_SPINLOCK=y
+CONFIG_DEBUG_MUTEXES=y
+CONFIG_DEBUG_RWSEMS=y
+CONFIG_DEBUG_ATOMIC_SLEEP=y
+CONFIG_STACKTRACE=y
+CONFIG_DEBUG_LIST=y
+CONFIG_DEBUG_PLIST=y
+CONFIG_DEBUG_SG=y
+CONFIG_RCU_EQS_DEBUG=y
+CONFIG_DEBUG_BLOCK_EXT_DEVT=y
+CONFIG_MEMTEST=y
diff --git a/arch/riscv/configs/rv32_defconfig b/arch/riscv/configs/rv32_defconfig
index eb519407c841..bdec58e6c5f7 100644
--- a/arch/riscv/configs/rv32_defconfig
+++ b/arch/riscv/configs/rv32_defconfig
@@ -98,27 +98,4 @@ CONFIG_CRYPTO_USER_API_HASH=y
 CONFIG_CRYPTO_DEV_VIRTIO=y
 CONFIG_PRINTK_TIME=y
 CONFIG_DEBUG_FS=y
-CONFIG_DEBUG_PAGEALLOC=y
-CONFIG_DEBUG_VM=y
-CONFIG_DEBUG_VM_PGFLAGS=y
-CONFIG_DEBUG_MEMORY_INIT=y
-CONFIG_DEBUG_PER_CPU_MAPS=y
-CONFIG_SOFTLOCKUP_DETECTOR=y
-CONFIG_WQ_WATCHDOG=y
-CONFIG_SCHED_STACK_END_CHECK=y
-CONFIG_DEBUG_TIMEKEEPING=y
-CONFIG_DEBUG_RT_MUTEXES=y
-CONFIG_DEBUG_SPINLOCK=y
-CONFIG_DEBUG_MUTEXES=y
-CONFIG_DEBUG_RWSEMS=y
-CONFIG_DEBUG_ATOMIC_SLEEP=y
-CONFIG_STACKTRACE=y
-CONFIG_DEBUG_LIST=y
-CONFIG_DEBUG_PLIST=y
-CONFIG_DEBUG_SG=y
 # CONFIG_RCU_TRACE is not set
-CONFIG_RCU_EQS_DEBUG=y
-CONFIG_DEBUG_BLOCK_EXT_DEVT=y
-# CONFIG_FTRACE is not set
-# CONFIG_RUNTIME_TESTING_MENU is not set
-CONFIG_MEMTEST=y
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] RISC-V: Add fragmented config for debug options
  2019-12-05 17:49 [PATCH v2] RISC-V: Add fragmented config for debug options Anup Patel
@ 2019-12-06  9:00 ` Daniel Thompson
  2019-12-06 16:23   ` Anup Patel
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Thompson @ 2019-12-06  9:00 UTC (permalink / raw)
  To: Anup Patel
  Cc: Palmer Dabbelt, Paul Walmsley, Albert Ou, Atish Patra,
	Alistair Francis, Christoph Hellwig, Anup Patel, linux-riscv,
	linux-kernel

On Thu, Dec 05, 2019 at 05:49:18PM +0000, Anup Patel wrote:
> Various Linux kernel DEBUG options have big performance impact so
> these should not be enabled in RISC-V normal defconfigs.
> 
> Instead we should have separate RISC-V fragmented config for enabling
> these DEBUG options. This way Linux RISC-V kernel can be built for
> both non-debug and debug purposes using same defconfig.
> 
> This patch moves additional DEBUG options to extra_debug.config.
> 
> To configure a non-debug RV64 kernel, we use our normal defconfig:
>    $ make O=<linux_build_directory> defconfig
> Wherease to configure a debug RV64 kernel, we use extra_debug.config:
>    $ make O=<linux_build_directory> defconfig extra_debug.config
> 
> Signed-off-by: Anup Patel <anup.patel@wdc.com>
> ---
> Changes since v1:
>  - Use fragmented .config instead of separate debug defconfigs.
> ---
>  arch/riscv/configs/defconfig          | 23 -----------------------
>  arch/riscv/configs/extra_debug.config | 21 +++++++++++++++++++++

Might be better to call this rv_debug.config (or riscv_debug.config),
This would imply it is a set of options recommended by riscv
maintainers and also having a suitable prefix means it is less
likely to ever conflict with .config files in kernel/configs .

BTW don't respin the patch on my account. Using a .config file was just
an idea and I'm not sure it reached consensus on the v1 thread.


Daniel.


>  arch/riscv/configs/rv32_defconfig     | 23 -----------------------
>  3 files changed, 21 insertions(+), 46 deletions(-)
>  create mode 100644 arch/riscv/configs/extra_debug.config
> 
> diff --git a/arch/riscv/configs/defconfig b/arch/riscv/configs/defconfig
> index e2ff95cb3390..f0710d8f50cc 100644
> --- a/arch/riscv/configs/defconfig
> +++ b/arch/riscv/configs/defconfig
> @@ -101,27 +101,4 @@ CONFIG_CRYPTO_USER_API_HASH=y
>  CONFIG_CRYPTO_DEV_VIRTIO=y
>  CONFIG_PRINTK_TIME=y
>  CONFIG_DEBUG_FS=y
> -CONFIG_DEBUG_PAGEALLOC=y
> -CONFIG_DEBUG_VM=y
> -CONFIG_DEBUG_VM_PGFLAGS=y
> -CONFIG_DEBUG_MEMORY_INIT=y
> -CONFIG_DEBUG_PER_CPU_MAPS=y
> -CONFIG_SOFTLOCKUP_DETECTOR=y
> -CONFIG_WQ_WATCHDOG=y
> -CONFIG_SCHED_STACK_END_CHECK=y
> -CONFIG_DEBUG_TIMEKEEPING=y
> -CONFIG_DEBUG_RT_MUTEXES=y
> -CONFIG_DEBUG_SPINLOCK=y
> -CONFIG_DEBUG_MUTEXES=y
> -CONFIG_DEBUG_RWSEMS=y
> -CONFIG_DEBUG_ATOMIC_SLEEP=y
> -CONFIG_STACKTRACE=y
> -CONFIG_DEBUG_LIST=y
> -CONFIG_DEBUG_PLIST=y
> -CONFIG_DEBUG_SG=y
>  # CONFIG_RCU_TRACE is not set
> -CONFIG_RCU_EQS_DEBUG=y
> -CONFIG_DEBUG_BLOCK_EXT_DEVT=y
> -# CONFIG_FTRACE is not set
> -# CONFIG_RUNTIME_TESTING_MENU is not set
> -CONFIG_MEMTEST=y
> diff --git a/arch/riscv/configs/extra_debug.config b/arch/riscv/configs/extra_debug.config
> new file mode 100644
> index 000000000000..66c58bb645a4
> --- /dev/null
> +++ b/arch/riscv/configs/extra_debug.config
> @@ -0,0 +1,21 @@
> +CONFIG_DEBUG_PAGEALLOC=y
> +CONFIG_DEBUG_VM=y
> +CONFIG_DEBUG_VM_PGFLAGS=y
> +CONFIG_DEBUG_MEMORY_INIT=y
> +CONFIG_DEBUG_PER_CPU_MAPS=y
> +CONFIG_SOFTLOCKUP_DETECTOR=y
> +CONFIG_WQ_WATCHDOG=y
> +CONFIG_SCHED_STACK_END_CHECK=y
> +CONFIG_DEBUG_TIMEKEEPING=y
> +CONFIG_DEBUG_RT_MUTEXES=y
> +CONFIG_DEBUG_SPINLOCK=y
> +CONFIG_DEBUG_MUTEXES=y
> +CONFIG_DEBUG_RWSEMS=y
> +CONFIG_DEBUG_ATOMIC_SLEEP=y
> +CONFIG_STACKTRACE=y
> +CONFIG_DEBUG_LIST=y
> +CONFIG_DEBUG_PLIST=y
> +CONFIG_DEBUG_SG=y
> +CONFIG_RCU_EQS_DEBUG=y
> +CONFIG_DEBUG_BLOCK_EXT_DEVT=y
> +CONFIG_MEMTEST=y
> diff --git a/arch/riscv/configs/rv32_defconfig b/arch/riscv/configs/rv32_defconfig
> index eb519407c841..bdec58e6c5f7 100644
> --- a/arch/riscv/configs/rv32_defconfig
> +++ b/arch/riscv/configs/rv32_defconfig
> @@ -98,27 +98,4 @@ CONFIG_CRYPTO_USER_API_HASH=y
>  CONFIG_CRYPTO_DEV_VIRTIO=y
>  CONFIG_PRINTK_TIME=y
>  CONFIG_DEBUG_FS=y
> -CONFIG_DEBUG_PAGEALLOC=y
> -CONFIG_DEBUG_VM=y
> -CONFIG_DEBUG_VM_PGFLAGS=y
> -CONFIG_DEBUG_MEMORY_INIT=y
> -CONFIG_DEBUG_PER_CPU_MAPS=y
> -CONFIG_SOFTLOCKUP_DETECTOR=y
> -CONFIG_WQ_WATCHDOG=y
> -CONFIG_SCHED_STACK_END_CHECK=y
> -CONFIG_DEBUG_TIMEKEEPING=y
> -CONFIG_DEBUG_RT_MUTEXES=y
> -CONFIG_DEBUG_SPINLOCK=y
> -CONFIG_DEBUG_MUTEXES=y
> -CONFIG_DEBUG_RWSEMS=y
> -CONFIG_DEBUG_ATOMIC_SLEEP=y
> -CONFIG_STACKTRACE=y
> -CONFIG_DEBUG_LIST=y
> -CONFIG_DEBUG_PLIST=y
> -CONFIG_DEBUG_SG=y
>  # CONFIG_RCU_TRACE is not set
> -CONFIG_RCU_EQS_DEBUG=y
> -CONFIG_DEBUG_BLOCK_EXT_DEVT=y
> -# CONFIG_FTRACE is not set
> -# CONFIG_RUNTIME_TESTING_MENU is not set
> -CONFIG_MEMTEST=y
> -- 
> 2.17.1
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] RISC-V: Add fragmented config for debug options
  2019-12-06  9:00 ` Daniel Thompson
@ 2019-12-06 16:23   ` Anup Patel
  0 siblings, 0 replies; 3+ messages in thread
From: Anup Patel @ 2019-12-06 16:23 UTC (permalink / raw)
  To: Daniel Thompson
  Cc: Anup Patel, Palmer Dabbelt, Paul Walmsley, Albert Ou,
	Atish Patra, Alistair Francis, Christoph Hellwig, linux-riscv,
	linux-kernel

On Fri, Dec 6, 2019 at 2:31 PM Daniel Thompson
<daniel.thompson@linaro.org> wrote:
>
> On Thu, Dec 05, 2019 at 05:49:18PM +0000, Anup Patel wrote:
> > Various Linux kernel DEBUG options have big performance impact so
> > these should not be enabled in RISC-V normal defconfigs.
> >
> > Instead we should have separate RISC-V fragmented config for enabling
> > these DEBUG options. This way Linux RISC-V kernel can be built for
> > both non-debug and debug purposes using same defconfig.
> >
> > This patch moves additional DEBUG options to extra_debug.config.
> >
> > To configure a non-debug RV64 kernel, we use our normal defconfig:
> >    $ make O=<linux_build_directory> defconfig
> > Wherease to configure a debug RV64 kernel, we use extra_debug.config:
> >    $ make O=<linux_build_directory> defconfig extra_debug.config
> >
> > Signed-off-by: Anup Patel <anup.patel@wdc.com>
> > ---
> > Changes since v1:
> >  - Use fragmented .config instead of separate debug defconfigs.
> > ---
> >  arch/riscv/configs/defconfig          | 23 -----------------------
> >  arch/riscv/configs/extra_debug.config | 21 +++++++++++++++++++++
>
> Might be better to call this rv_debug.config (or riscv_debug.config),
> This would imply it is a set of options recommended by riscv
> maintainers and also having a suitable prefix means it is less
> likely to ever conflict with .config files in kernel/configs .

Yes, rv_debug.config seems a better name.

I will wait for more comments before renaming it to rv_debug.config

>
> BTW don't respin the patch on my account. Using a .config file was just
> an idea and I'm not sure it reached consensus on the v1 thread.

Not a problem, actually David Abdurachmanov (SiFive) had also
suggested to use fragmented config for debug options.

Actually, we are seeing 12% performance drop in Hackbench by
having DEBUG options enabled by default in normal defconfigs
so we certainly need to move it out of normal defconfigs. Having
fragmented config for DEBUG options is certainly a clean and
maintainable approach that's why I went ahead with your suggestion.

Regards,
Anup

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-12-06 16:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-05 17:49 [PATCH v2] RISC-V: Add fragmented config for debug options Anup Patel
2019-12-06  9:00 ` Daniel Thompson
2019-12-06 16:23   ` Anup Patel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).