Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp7910127ybl; Thu, 16 Jan 2020 07:35:54 -0800 (PST) X-Google-Smtp-Source: APXvYqzcSkj1PGWCOD0L4LgZoh3zJ6ZYxVxC1I7+Cbm48W74uWCrQrj1KbeVUcahZKXQSsFBWxoS X-Received: by 2002:a9d:6b89:: with SMTP id b9mr2359792otq.298.1579188953932; Thu, 16 Jan 2020 07:35:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579188953; cv=none; d=google.com; s=arc-20160816; b=vhn/e+8wYYmdXuwGBI6GU87BlP5lVThzf36a92pNWwQmgmzBpEWnh25HUcgxtE9oLe lx9vwfIOTaP2ff6qzkz0E07UnNmj9yvyb9ECcdESvocirS/gtoZYO1HMRlRhmQBMZYwt dVRBn56z9hszkJv9RwOIUvavmxLhvLq7KLKGb1X9CJ9vlD6MWgXMQKv/Itq6pC+UVZdM lig7mzJ4q+0loPI+E8pokpIOfGBo3F/JUZtDYrxCjMsiAEfBF/npgtuo/GP1ik+zQDa8 YYR1PEKZ77xXKj/8ZtS6hv7KX+8K5yVz39kxyJBlEsj1u4iqwActAw7LLbsQVBDCmbl/ t0bQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject :dkim-signature; bh=kK6Km6s43/DeUxpqxgZHiJ00km9z23ARb6cNGp/MiO8=; b=BFFAB4Emu2RlD9gRdZxezfcKvuPCL39l7x6dtDkEwfkzpnnYI3/1Zbbyef/OSBWIqK kzaNyEMl/acKIqRe3kwIghJXgIrtvs8ZwQ7tsQyUm0HaBJeg5+Nh6a8e4UI9o513b4EB 8BubbIx3suy12d91p7/Tw+1RFxuDGXngVINxLAg4QMalt4YpQQMspr+e0MUpXs6mSKdu 6SH+p47c+mH7wJaJepnFyeHRVqImYogzDxPX68BXv5fiSM44L+bJhQAyx4pyPH7+A0Gq 7LMM80Xdp6LAbdCw5fd43NUoxn5+S3KO45AcD0HdmEMaIldKUPCxMnUivs4IV34Ub2s+ n2nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=B7zGVFYy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m24si11050918oic.11.2020.01.16.07.35.42; Thu, 16 Jan 2020 07:35:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=B7zGVFYy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726785AbgAPPed (ORCPT + 99 others); Thu, 16 Jan 2020 10:34:33 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:47002 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726151AbgAPPed (ORCPT ); Thu, 16 Jan 2020 10:34:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579188871; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kK6Km6s43/DeUxpqxgZHiJ00km9z23ARb6cNGp/MiO8=; b=B7zGVFYyekbp5ZfYtaG9QBMZakdMzfjk3UH5jaIqhgHf3qlahSmcnZnke5+y5Tuxdz7/xy zY4AXSZuobkcUTZhz6qcX+1QT/dap6GqD5HUqONnymDKwZEvFea6VzW6dRqfuK83uDTBZD z+srj6mYGIuHLcgQUEFaBAAb3zX5G1Y= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-440-SKgw51c0PAWxiyIY-SCsiA-1; Thu, 16 Jan 2020 10:34:28 -0500 X-MC-Unique: SKgw51c0PAWxiyIY-SCsiA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 39D0A1005516; Thu, 16 Jan 2020 15:34:22 +0000 (UTC) Received: from llong.remote.csb (dhcp-17-59.bos.redhat.com [10.18.17.59]) by smtp.corp.redhat.com (Postfix) with ESMTP id 22EA65C28F; Thu, 16 Jan 2020 15:34:21 +0000 (UTC) Subject: Re: [PATCH v2] watchdog: Fix possible soft lockup warning at bootup To: Thomas Gleixner , Andrew Morton , Ingo Molnar Cc: linux-kernel@vger.kernel.org, Mike Rapoport , Kees Cook , Catalin Marinas , Will Deacon , Robert Richter , Peter Zijlstra References: <20200103151032.19590-1-longman@redhat.com> <87sgkgw3xq.fsf@nanos.tec.linutronix.de> <87blr3wrqw.fsf@nanos.tec.linutronix.de> From: Waiman Long Organization: Red Hat Message-ID: Date: Thu, 16 Jan 2020 10:34:20 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <87blr3wrqw.fsf@nanos.tec.linutronix.de> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/16/20 6:44 AM, Thomas Gleixner wrote: > Thomas Gleixner writes: > > Added ARM64 and ThunderX folks > >> Waiman Long writes: >>> By adding some instrumentation code, it was found that for cpu 14, >>> watchdog_enable() was called early with a timestamp of 1. That activates >>> the watchdog time checking logic. It was also found that the monotonic >>> time measured during the smp_init() phase runs much slower than the >>> real elapsed time as shown by the below debug printf output: >>> >>> [ 1.138522] run_queues, watchdog_timer_fn: now = 170000000 >>> [ 25.519391] run_queues, watchdog_timer_fn: now = 4170000000 >>> >>> In this particular case, it took about 24.4s of elapsed time for the >>> clock to advance 4s which is the soft expiration time that is required >>> to trigger the calling of watchdog_timer_fn(). That clock slowdown >>> stopped once the smp_init() call was done and the clock time ran at >>> the same rate as the elapsed time afterward. > And looking at this with a more awake brain, the root cause is pretty > obvious. > > sched_clock() advances by 24 seconds, but clock MONOTONIC on which the > watchdog timer is based does not. As the timestamps you printed have 7 > trailing zeros, it's pretty clear that timekeeping is still jiffies > based at this point and HZ is set to 100. > > So while bringing up the non-boot CPUs the boot CPU loses ~2000 timer > interrupts. That needs to be fixed and not papered over. > You are right that the root-causing effort wasn't complete and I took the easy way out. As I have limited knowledge on how the timer code work, I was not sure how to start further investigation at that time. Your insight gives me a hint on where to start now. So I will dig further in to see what causes this. Thanks, Longman