mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Waiman Long <longman@redhat.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Ingo Molnar <mingo@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-kernel@vger.kernel.org, Mike Rapoport <rppt@linux.ibm.com>,
	Kees Cook <keescook@chromium.org>
Subject: Re: [PATCH] watchdog: Fix possible soft lockup warning at bootup
Date: Thu, 2 Jan 2020 15:12:36 -0500	[thread overview]
Message-ID: <044ac2d7-1dee-46a9-93ba-31645ec2f8a1@redhat.com> (raw)
In-Reply-To: <20200102120817.d1c289313747cfde7270076f@linux-foundation.org>

On 1/2/20 3:08 PM, Andrew Morton wrote:
> On Thu,  2 Jan 2020 10:41:49 -0500 Waiman Long <longman@redhat.com> wrote:
>
>> It was found that watchdog soft lockup warning was displayed on some
>> arm64 server systems at bootup time:
>>
>> ...
>>
>> Further analysis of the situation revealed that the smp_init() call
>> itself took more than 20s for that 2-socket 56-core and 224-thread
>> server.
>>
>>  [    0.115632] CPU1: Booted secondary processor 0x0000000100 [0x431f0af1]
>>    :
>>  [   27.177282] CPU223: Booted secondary processor 0x0000011b03 [0x431f0af1]
>>
>> By adding some instrumentation code, it was found that for cpu 14,
>> watchdog_enable() was called early with a timestamp of 1. The first
>> watchdog timer callback for that cpu, however, happened really late at
>> the above 25s timestamp mark causing the watchdog logic to treat the
>> delay as a soft lockup.
>>
>> On another arm64 system that doesn't show the soft lockup warning, the
>> watchdog timer callback happened earlier at the 5s timestamp mark with
>> the watchdog thread invoked shortly after that.
>>
>> The reason why there was such a delay in the first watchdog timer
>> callback for that particular system wasn't fully known yet.
> Mysteries are unwelcome.  Are you continuing to investigate this?
Yes, I will do some more investigation as to why it took so long.
>> Given
>> the fact that smp_init() can run for a long time on some systems,
>> it is probably more appropriate to enable the watchdog function after
>> smp_init() instead of before it.
>>
>> Another way is to leave watchdog_touch_ts at 0 in watchdog_enable()
>> while the system is at the booting stage. Either one of those should
>> be able to eliminate the soft lockup warning on bootup.
>>
>> ...
>>
>> --- a/kernel/watchdog.c
>> +++ b/kernel/watchdog.c
>> @@ -496,7 +496,9 @@ static void watchdog_enable(unsigned int cpu)
>>  		      HRTIMER_MODE_REL_PINNED_HARD);
>>  
>>  	/* Initialize timestamp */
>> -	__touch_watchdog();
>> +	if (system_state != SYSTEM_BOOTING)
>> +		__touch_watchdog();
> A comment which explains the system_state test would be appropriate
> here.

Will do so.

>>  	/* Enable the perf event */
>>  	if (watchdog_enabled & NMI_WATCHDOG_ENABLED)
>>  		watchdog_nmi_enable(cpu);

Cheers,
Longman


  reply	other threads:[~2020-01-02 20:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-02 15:41 Waiman Long
2020-01-02 20:08 ` Andrew Morton
2020-01-02 20:12   ` Waiman Long [this message]
2020-01-03 15:17     ` Waiman Long

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=044ac2d7-1dee-46a9-93ba-31645ec2f8a1@redhat.com \
    --to=longman@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=rppt@linux.ibm.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome