linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/unwind_guess: Prevent using UNWINDER_GUESS=y with STACKDEPOT=y
@ 2017-11-30 12:35 Andrey Ryabinin
  2017-11-30 12:38 ` Dmitry Vyukov
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Andrey Ryabinin @ 2017-11-30 12:35 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86
  Cc: linux-kernel, Josh Poimboeuf, Alexander Potapenko, Dmitry Vyukov,
	xiaolong.ye, fengguang.wu, Andrey Ryabinin

Stackdepot doesn't work well with CONFIG_UNWINDER_GUESS=y.
The 'guess' unwinder generate awfully large and inaccurate stacktraces,
thus stackdepot can't deduplicate stacktraces because they all look like
unique. Eventually stackdepot reaches its capacity limit:

WARNING: CPU: 0 PID: 545 at lib/stackdepot.c:119 depot_save_stack+0x28e/0x550
Call Trace:
 ? kasan_kmalloc+0x144/0x160
 ? depot_save_stack+0x1f5/0x550
 ? do_raw_spin_unlock+0xda/0xf0
 ? preempt_count_sub+0x13/0xc0

<...90 lines...>

 ? do_raw_spin_unlock+0xda/0xf0

Add STACKDEPOT=n dependency to UNWINDER_GUESS to avoid the problem.

Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Reported-by: kernel test robot <xiaolong.ye@intel.com>
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
---
 arch/x86/Kconfig.debug | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug
index 6293a8768a91..672441c008c7 100644
--- a/arch/x86/Kconfig.debug
+++ b/arch/x86/Kconfig.debug
@@ -400,6 +400,7 @@ config UNWINDER_FRAME_POINTER
 config UNWINDER_GUESS
 	bool "Guess unwinder"
 	depends on EXPERT
+	depends on !STACKDEPOT
 	---help---
 	  This option enables the "guess" unwinder for unwinding kernel stack
 	  traces.  It scans the stack and reports every kernel text address it
-- 
2.13.6

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

* Re: [PATCH] x86/unwind_guess: Prevent using UNWINDER_GUESS=y with STACKDEPOT=y
  2017-11-30 12:35 [PATCH] x86/unwind_guess: Prevent using UNWINDER_GUESS=y with STACKDEPOT=y Andrey Ryabinin
@ 2017-11-30 12:38 ` Dmitry Vyukov
  2017-11-30 13:57 ` Josh Poimboeuf
  2017-12-12 10:58 ` [tip:x86/urgent] x86/unwinder/guess: Prevent using CONFIG_UNWINDER_GUESS=y with CONFIG_STACKDEPOT=y tip-bot for Andrey Ryabinin
  2 siblings, 0 replies; 4+ messages in thread
From: Dmitry Vyukov @ 2017-11-30 12:38 UTC (permalink / raw)
  To: Andrey Ryabinin
  Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin,
	the arch/x86 maintainers, LKML, Josh Poimboeuf,
	Alexander Potapenko, kernel test robot, Fengguang Wu

On Thu, Nov 30, 2017 at 1:35 PM, Andrey Ryabinin
<aryabinin@virtuozzo.com> wrote:
> Stackdepot doesn't work well with CONFIG_UNWINDER_GUESS=y.
> The 'guess' unwinder generate awfully large and inaccurate stacktraces,
> thus stackdepot can't deduplicate stacktraces because they all look like
> unique. Eventually stackdepot reaches its capacity limit:
>
> WARNING: CPU: 0 PID: 545 at lib/stackdepot.c:119 depot_save_stack+0x28e/0x550
> Call Trace:
>  ? kasan_kmalloc+0x144/0x160
>  ? depot_save_stack+0x1f5/0x550
>  ? do_raw_spin_unlock+0xda/0xf0
>  ? preempt_count_sub+0x13/0xc0
>
> <...90 lines...>
>
>  ? do_raw_spin_unlock+0xda/0xf0
>
> Add STACKDEPOT=n dependency to UNWINDER_GUESS to avoid the problem.
>
> Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
> Reported-by: kernel test robot <xiaolong.ye@intel.com>
> Reported-by: Fengguang Wu <fengguang.wu@intel.com>
> ---
>  arch/x86/Kconfig.debug | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug
> index 6293a8768a91..672441c008c7 100644
> --- a/arch/x86/Kconfig.debug
> +++ b/arch/x86/Kconfig.debug
> @@ -400,6 +400,7 @@ config UNWINDER_FRAME_POINTER
>  config UNWINDER_GUESS
>         bool "Guess unwinder"
>         depends on EXPERT
> +       depends on !STACKDEPOT
>         ---help---
>           This option enables the "guess" unwinder for unwinding kernel stack
>           traces.  It scans the stack and reports every kernel text address it
> --
> 2.13.6
>


Acked-by: Dmitry Vyukov <dvyukov@google.com>

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

* Re: [PATCH] x86/unwind_guess: Prevent using UNWINDER_GUESS=y with STACKDEPOT=y
  2017-11-30 12:35 [PATCH] x86/unwind_guess: Prevent using UNWINDER_GUESS=y with STACKDEPOT=y Andrey Ryabinin
  2017-11-30 12:38 ` Dmitry Vyukov
@ 2017-11-30 13:57 ` Josh Poimboeuf
  2017-12-12 10:58 ` [tip:x86/urgent] x86/unwinder/guess: Prevent using CONFIG_UNWINDER_GUESS=y with CONFIG_STACKDEPOT=y tip-bot for Andrey Ryabinin
  2 siblings, 0 replies; 4+ messages in thread
From: Josh Poimboeuf @ 2017-11-30 13:57 UTC (permalink / raw)
  To: Andrey Ryabinin
  Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, linux-kernel,
	Alexander Potapenko, Dmitry Vyukov, xiaolong.ye, fengguang.wu

On Thu, Nov 30, 2017 at 03:35:54PM +0300, Andrey Ryabinin wrote:
> Stackdepot doesn't work well with CONFIG_UNWINDER_GUESS=y.
> The 'guess' unwinder generate awfully large and inaccurate stacktraces,
> thus stackdepot can't deduplicate stacktraces because they all look like
> unique. Eventually stackdepot reaches its capacity limit:
> 
> WARNING: CPU: 0 PID: 545 at lib/stackdepot.c:119 depot_save_stack+0x28e/0x550
> Call Trace:
>  ? kasan_kmalloc+0x144/0x160
>  ? depot_save_stack+0x1f5/0x550
>  ? do_raw_spin_unlock+0xda/0xf0
>  ? preempt_count_sub+0x13/0xc0
> 
> <...90 lines...>
> 
>  ? do_raw_spin_unlock+0xda/0xf0
> 
> Add STACKDEPOT=n dependency to UNWINDER_GUESS to avoid the problem.
> 
> Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
> Reported-by: kernel test robot <xiaolong.ye@intel.com>
> Reported-by: Fengguang Wu <fengguang.wu@intel.com>

Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>

-- 
Josh

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

* [tip:x86/urgent] x86/unwinder/guess: Prevent using CONFIG_UNWINDER_GUESS=y with CONFIG_STACKDEPOT=y
  2017-11-30 12:35 [PATCH] x86/unwind_guess: Prevent using UNWINDER_GUESS=y with STACKDEPOT=y Andrey Ryabinin
  2017-11-30 12:38 ` Dmitry Vyukov
  2017-11-30 13:57 ` Josh Poimboeuf
@ 2017-12-12 10:58 ` tip-bot for Andrey Ryabinin
  2 siblings, 0 replies; 4+ messages in thread
From: tip-bot for Andrey Ryabinin @ 2017-12-12 10:58 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: hpa, peterz, linux-kernel, aryabinin, xiaolong.ye, torvalds,
	dvyukov, tglx, fengguang.wu, glider, jpoimboe, mingo

Commit-ID:  0a373d4fc248cb707821d7dad54ce6d5bcb0cdfe
Gitweb:     https://git.kernel.org/tip/0a373d4fc248cb707821d7dad54ce6d5bcb0cdfe
Author:     Andrey Ryabinin <aryabinin@virtuozzo.com>
AuthorDate: Thu, 30 Nov 2017 15:35:54 +0300
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Mon, 11 Dec 2017 19:07:07 +0100

x86/unwinder/guess: Prevent using CONFIG_UNWINDER_GUESS=y with CONFIG_STACKDEPOT=y

Stackdepot doesn't work well with CONFIG_UNWINDER_GUESS=y.
The 'guess' unwinder generate awfully large and inaccurate stacktraces,
thus stackdepot can't deduplicate stacktraces because they all look like
unique. Eventually stackdepot reaches its capacity limit:

  WARNING: CPU: 0 PID: 545 at lib/stackdepot.c:119 depot_save_stack+0x28e/0x550
  Call Trace:
   ? kasan_kmalloc+0x144/0x160
   ? depot_save_stack+0x1f5/0x550
   ? do_raw_spin_unlock+0xda/0xf0
   ? preempt_count_sub+0x13/0xc0

  <...90 lines...>

   ? do_raw_spin_unlock+0xda/0xf0

Add a STACKDEPOT=n dependency to UNWINDER_GUESS to avoid the problem.

Reported-by: kernel test robot <xiaolong.ye@intel.com>
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Acked-by: Dmitry Vyukov <dvyukov@google.com>
Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20171130123554.4330-1-aryabinin@virtuozzo.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/Kconfig.debug | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug
index 6293a87..672441c 100644
--- a/arch/x86/Kconfig.debug
+++ b/arch/x86/Kconfig.debug
@@ -400,6 +400,7 @@ config UNWINDER_FRAME_POINTER
 config UNWINDER_GUESS
 	bool "Guess unwinder"
 	depends on EXPERT
+	depends on !STACKDEPOT
 	---help---
 	  This option enables the "guess" unwinder for unwinding kernel stack
 	  traces.  It scans the stack and reports every kernel text address it

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

end of thread, other threads:[~2017-12-12 11:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-30 12:35 [PATCH] x86/unwind_guess: Prevent using UNWINDER_GUESS=y with STACKDEPOT=y Andrey Ryabinin
2017-11-30 12:38 ` Dmitry Vyukov
2017-11-30 13:57 ` Josh Poimboeuf
2017-12-12 10:58 ` [tip:x86/urgent] x86/unwinder/guess: Prevent using CONFIG_UNWINDER_GUESS=y with CONFIG_STACKDEPOT=y tip-bot for Andrey Ryabinin

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).