[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181128090903.7a27ae58@gandalf.local.home>
Date: Wed, 28 Nov 2018 09:09:03 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: Anders Roxell <anders.roxell@...aro.org>
Cc: mingo@...hat.com, akpm@...ux-foundation.org, dvyukov@...gle.com,
linux-kernel@...r.kernel.org, Arnd Bergmann <arnd@...db.de>
Subject: Re: [PATCH 2/2] kernel/trace: fix watchdog soft lockup
On Wed, 28 Nov 2018 09:13:34 +0100
Anders Roxell <anders.roxell@...aro.org> wrote:
> When building a allmodconfig kernel for arm64 and boot that in qemu,
> CONFIG_FTRACE_STARTUP_TEST gets enabled and that takes time so the
> watchdog expires and prints out a message like this:
> 'watchdog: BUG: soft lockup - CPU#0 stuck for 22s! [swapper/0:1]'
> Each time the function ftrace_replace_code gets called it stays in that
> functions loop for 41424 times.
> Rework so that function cond_resched() gets called in the
> ftrace_replace_code loop.
>
> Co-developed-by: Arnd Bergmann <arnd@...db.de>
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
> Signed-off-by: Anders Roxell <anders.roxell@...aro.org>
> ---
> kernel/trace/ftrace.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
> index 5b4f73e4fd56..3f456921dedf 100644
> --- a/kernel/trace/ftrace.c
> +++ b/kernel/trace/ftrace.c
> @@ -2426,6 +2426,10 @@ void __weak ftrace_replace_code(int enable)
>
> do_for_each_ftrace_rec(pg, rec) {
>
> + /* This loop can take minutes when sanitizers are enabled, so
> + * lets make sure we allow RCU processing.
> + */
> + cond_resched();
> if (rec->flags & FTRACE_FL_DISABLED)
> continue;
>
NACK. On some architectures this code is run from stop machine. We
can't call cond_resched() because it may be called with interrupts
disabled.
This is a weak function. If arm64 has special needs, just copy it in
the arm64 code.
-- Steve
Powered by blists - more mailing lists