Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp377517pxj; Tue, 18 May 2021 05:33:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxHmYSOytsPX+g5qW4R0HL+4WUEwstmwcAuEDvacmeidj2r0sAppZl0CXWRmaGQBrzrPg1S X-Received: by 2002:a50:fd81:: with SMTP id o1mr6659834edt.107.1621341221073; Tue, 18 May 2021 05:33:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621341221; cv=none; d=google.com; s=arc-20160816; b=blOEioS3wSUDlAtIwgdGvwuxG27gfemuN4gal3OHzT/0b2Odp1oBICEHL6F4e7XbzF OUBDdXk0DKjY8/5Cwd9pgl8ZIi2zOPTiuQWqw1Rgrz+H7vd0sJFTrDj+x65cVSYR409+ ZTrZ8+QJV3ViWidK9aYKDgU+AxPswgIhyCiqrx8VwwyPc5qOKHjrjZCC57SLvg43/Cl9 WgyWbjrdUVQHxWE8ec4D5/1rqEyBgEbw9wlitk9SZts6Wu9eSHA6Du+RJ0NXWID09AX8 pgHh5MLggM2knvU9db2LAdMam3MAtMXg4wEjeLtCUcrAbyCnjZ85/W2w/doqfvSqe2RR byIQ== 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=1h/Za8f3u+4N9i4gs9YJ36vM5nQbgaVX9MvaY2+VPJc=; b=bDgEkno/Z1//XEZDwwVt8BGAKEeznWL30cP8YRFN6p/UgXCLuALAu1TdNQJwb72yv3 RhbmmWGJ6cU9kam42IVQ9EpC33HPm3GBM9HcypKmJv4G77MmTC8734JSQt52M/67A/bj ++aH1P9r48C4po7kPL67rAX/NFhqGX3hh2QMDjVF5AXH6LKAOi/llfuvEwjHLKtcn7BL cMloygBofE3Pc+lMkMwap/ngJEiviANANsZSe1d/dPNu29nWAkqwQL+Dh8TFSORc3d+I GEm9/Mjt+JlFOiHocYSzCZWn5Pi5WgQdx0S9V7xkbfVjit1KO9sxir3Vj+4OaLrhzm5+ 9Bvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VldSguGk; 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 n11si13417390edy.80.2021.05.18.05.33.17; Tue, 18 May 2021 05:33:41 -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=VldSguGk; 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 S245731AbhEQPam (ORCPT + 99 others); Mon, 17 May 2021 11:30:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:53464 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241649AbhEQPPz (ORCPT ); Mon, 17 May 2021 11:15:55 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4FBC2613EB; Mon, 17 May 2021 14:32:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621261955; bh=exRUsy11EDsYD0fvsmHuAxt/ZSh/ofMXZtzCPeXxHW4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VldSguGkCeGRCHM+xMUFOQNuTFLEk1g+HamNjj57+xfT5NbPK8QD3W2SuM+uMetM/ OedWWwiUiEwI2pkWuqPFIYhTzhgwK5xRinKPSgZdHgoNbsZHDLKatOlWLRi4t0PEaJ ZiWzsm741O/uDTYfEQmrRKYbnHZoSW0IIc0UlhoE= 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.10 090/289] watchdog: explicitly update timestamp when reporting softlockup Date: Mon, 17 May 2021 16:00:15 +0200 Message-Id: <20210517140308.215464145@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140305.140529752@linuxfoundation.org> References: <20210517140305.140529752@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 c58244064de8..7776d53a015c 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c @@ -409,6 +409,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