Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3023311pxj; Mon, 17 May 2021 15:50:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwfn8XxNxPq7JeU3ND4XuARrr7NrVN/kUSURT9BtiY5/NTZKqOuQM12MORqGfkxL4IzAFKV X-Received: by 2002:a02:8308:: with SMTP id v8mr2285805jag.143.1621291815148; Mon, 17 May 2021 15:50:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621291815; cv=none; d=google.com; s=arc-20160816; b=QjnbIKbqQPSb4yWc6ROg+3ZH+OxprKINFjTK66ckwiBpmEClvERs4cYN1iZlWvZWb7 ysfRs/bnzqJMwwzKvyG+1nTl6KN7djIs0LAkpUEQKcU5q1zY93RN0M7K6ZrepgnDZe8v N9j0CaF2rlG2YTHefVsF4Uo0Nh62DxQzk35UD5Jricp2OKNsuevoT9zQXdvPChA+4cyj n80XmKN0MdZPCiqcR8UyKoCKqgPUaR4+TvfUBLVRON2ra6h4n+qYRqLfmVCwxUgctUGA x26DTDgSvZE9sNKqoWM9Zq2+PLH0fChlPW/Q6KUmmPLpJgmg1rk2KOs8BzPls8GQ//xx 8N5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=sqZZf9pv9x3BmDSMR7r4VVk62EezPge9Twm7UfMnbrQ=; b=Z2mihUeMbrDpS6liCRDo1TMfHBkCBcshB8kNsmRlIyaFnfqhlc/A82HQ3TFcUp+xB6 Trv3exdjzoqj9/DmWKCP72QASxH3pbZJvF8/RKrWCm2kTCkgohozFlXzKPWEbwJqkZd2 Z6cGPrx+QarakuE9ZAyLlbO81Zzeavm3ckMbUsvCiy+kSHoffX4uRy9dh4H5LfDhHg66 jyrUc6pO3ovx11S7c5Gk6GhDgf8D+uQ0ZBIFGG2LUQ0xjjHddAwKI9SZn4JQ30pSkJtm 4B9BySD5UK2mKJ2YxTwSyUVtTJTZdAAjFOyZIvfO1KZla6GWLW3/LcxwDdquYU3F/yIF mpow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=G3+8zQs0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p15si21015335ilo.83.2021.05.17.15.49.59; Mon, 17 May 2021 15:50:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=G3+8zQs0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238815AbhEQOQU (ORCPT + 99 others); Mon, 17 May 2021 10:16:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:43908 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238774AbhEQONq (ORCPT ); Mon, 17 May 2021 10:13:46 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3DBBE61352; Mon, 17 May 2021 14:08:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621260520; bh=6Hgr4S1/hMtZUpsFzKkQK9/e8zA7pyZCdkPROOkg8Yw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=G3+8zQs0QefZUABNOK0j+kOD3N34GAdCxVYwj6xTArweirqf+a0gINumQms1Qj4YC aPRBxYIcevtAd7JvEx3hpuaCszKvRzPy56vqH/AOTbZcaj2nQ+v2coh/gPkEYy0rc0 Ul1e0u+/Tl6OBYQ/IzRqxjzLpYO+ddB/Pm72e6qY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Petr Mladek , Ingo Molnar , Laurence Oberman , Michal Hocko , Peter Zijlstra , Thomas Gleixner , Vincent Whitchurch , Andrew Morton , Linus Torvalds , Sasha Levin Subject: [PATCH 5.12 119/363] watchdog: explicitly update timestamp when reporting softlockup Date: Mon, 17 May 2021 15:59:45 +0200 Message-Id: <20210517140306.646924373@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140302.508966430@linuxfoundation.org> References: <20210517140302.508966430@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Petr Mladek [ Upstream commit c9ad17c991492f4390f42598f6ab0531f87eed07 ] The softlockup situation might stay for a long time or even forever. When it happens, the softlockup debug messages are printed in regular intervals defined by get_softlockup_thresh(). There is a mystery. The repeated message is printed after the full interval that is defined by get_softlockup_thresh(). But the timer callback is called more often as defined by sample_period. The code looks like the soflockup should get reported in every sample_period when it was once behind the thresh. It works only by chance. The watchdog is touched when printing the stall report, for example, in printk_stack_address(). Make the behavior clear and predictable by explicitly updating the timestamp in watchdog_timer_fn() when the report gets printed. Link: https://lkml.kernel.org/r/20210311122130.6788-3-pmladek@suse.com Signed-off-by: Petr Mladek Cc: Ingo Molnar Cc: Laurence Oberman Cc: Michal Hocko Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Vincent Whitchurch Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- kernel/watchdog.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/watchdog.c b/kernel/watchdog.c index 8440e62bfec4..8efd2a8d9f10 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c @@ -410,6 +410,9 @@ static enum hrtimer_restart watchdog_timer_fn(struct hrtimer *hrtimer) } } + /* Start period for the next softlockup warning. */ + update_touch_ts(); + pr_emerg("BUG: soft lockup - CPU#%d stuck for %us! [%s:%d]\n", smp_processor_id(), duration, current->comm, task_pid_nr(current)); -- 2.30.2