From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 46C3232E72F for ; Wed, 11 Mar 2026 14:07:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773238027; cv=none; b=crHqgkyoELI5Vneqis0tyRmmejgU3vLm5/ca8LaTDEzHht6L2he183NnWiJ3yef0jp29e8PXpdUMpGkwuuvbtHnIj6liZMrEcNUAdhhl5Jj9+MyN7d5XAVDws0sc6P7J3GhwtMmstPzJHzcOVcFceV5FHNEaX0f1JLX7YFONhw8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773238027; c=relaxed/simple; bh=Fd1mYtpfk66Zlazj7nT3zuvWvOHW00VZQFPEW9Ttx28=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ZUHs/S4EGOf3xtpF1M3egl5/ES1PmAp0D2s67KWlaKLCsrbFpCfNhJ8lTTjKCq92lkvDTTKv0sLmTHxqjTSINUwHcjadcy6v27HzY+66T9ed/egrbU/tbPQ8FzI7AdMZwCKw6uOdtWYUzQhHVDi8PrLIolUTD/Gb/QZjH9LE+xY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=G8STOH3U; arc=none smtp.client-ip=209.85.128.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="G8STOH3U" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-4853c1ca73aso29420615e9.2 for ; Wed, 11 Mar 2026 07:07:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1773238025; x=1773842825; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=6JiaOxu0oMiUlwTd4Az0OphvPRvCCSUjpenBGodYb5o=; b=G8STOH3UEU0Btx7F8Q8BJVO7gCg3tJrobGvA9LlgvPihnIxGj9W7Cc0UO7qDCBWxyG sYXORa83izMDjxDWFTHFHGjS3MUQHyhkXIcTsbXOeWJMiHtM0/QTnxfRZ9TGNKW3xbdk M6z4JG/eSfuQ5YaU331mOc379eW94D6ontFuP67d6r5kKMSiQAjetv/sAsUmxqhWBArv NcmSyjI1jdyBpWMvuRdrZXxJViGD7qgJDu48PNFVIqStqeBsUVbaQNrBXGqJUdcQjYKC 3MC6jzzNJS0ffUIggn2Wpc3zsCXEuc2GOvRwCyWmnyYsJVY2EmwhFpYt1XwZ8Csi7EaX Z5ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773238025; x=1773842825; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=6JiaOxu0oMiUlwTd4Az0OphvPRvCCSUjpenBGodYb5o=; b=cV6BdmHk1v5CbYTm5aUyWwOJ+6eaP/Vy6JY2qs0810ZyoOZs0dBykty4TwD+/4Sqvz Pe8kKfa5p7Hm11hMUK42jrBo+DmfiSXfxYx259rfiXU1SlSvWOizbBqFSOFg0rgoZiOU VrvPlzWH6vJru/7fNFrTb73ofiWNk6216ZEpzEhTGuq6wS2n4EYNZFJ3pyDbnFC2styz LZffln1T9jjarAeffH8ajGrtq6wAZ/kzIOW8vm+AInUt5qDoS5WMIqNmKoPxcYQh/AW3 YFY09JBgvOTDCLcqCwrCu1Y2vyM8dwrMmkSUgywG90pihZgXIDDHSNj85X2JQUCoIGd5 vPBw== X-Forwarded-Encrypted: i=1; AJvYcCWnna1yraqva84R2vvA2O1Idfj3P26V0FzR/zRgJyZup1tJM+u3sxXgALWxIglchfBjb8lqhuA+AMpikC8=@vger.kernel.org X-Gm-Message-State: AOJu0Yxo3+AWRFSKacympf0IizHmfI0L8B7Z/nQU3wQWrRyFZsi0jGOs KynxRvE9XxpAlC6KDT0/PzwW0orIDr8Da3j9iVjGIEnKsp3n+JaWrP99VlSDuoUdJM8= X-Gm-Gg: ATEYQzycim4lTlc1WKn8gdoDb12vIkHhLOBiyw2tJrjVMQBL/f9SUIeqvEst731guY2 ZPme+HfTo9YH8Y0aOagQmWGBr9eIPkfQLn8TUm+4hEZNFp3ToCPWp8GMSAz6BZs0VAczzp+/s49 hyDAx4/KDj4H75WfzGiLAJ91HF674j1Ch68ZsbUPYR2dB9zH4Hq0y36pnJbHsuI5iY469Z6CU1t 1MBspYTF7L8MIHP1/ioX3hqMCshE/6DSF5DW2hq5HYpW+PNJmRhmcbLYGggYw+hWIwtZA6U2AWU +LFCaOexxXQ3QdN28GkEzYacW1psZLArun0SYDglvEPNORmMj6hsjF87hX2zEKesF2Mx/VYZLWT A/eplwuRMQieK4Fn/DijsUeBYUzh3e5Uxe1lvHbPkyNRRY45GB4cFk5bDdPGBsAeO4nYi/xeKfu GPRvRq+eo5IVjYi9l6GDouVyyw6ZZwiaGaS2AY X-Received: by 2002:a05:600c:1f8e:b0:47e:e076:c7a5 with SMTP id 5b1f17b1804b1-4854b0ca217mr46078285e9.11.1773238024538; Wed, 11 Mar 2026 07:07:04 -0700 (PDT) Received: from pathway.suse.cz ([176.114.240.130]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4854b5e912fsm140577955e9.2.2026.03.11.07.07.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Mar 2026 07:07:04 -0700 (PDT) Date: Wed, 11 Mar 2026 15:07:02 +0100 From: Petr Mladek To: Doug Anderson Cc: mrungta@google.com, Jonathan Corbet , Jinchao Wang , Yunhui Cui , Stephane Eranian , Ian Rogers , Li Huafei , Feng Tang , Max Kellermann , Andrew Morton , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Subject: Re: [PATCH 3/4] watchdog/hardlockup: improve buddy system detection timeliness Message-ID: References: <20260212-hardlockup-watchdog-fixes-v1-0-745f1dce04c3@google.com> <20260212-hardlockup-watchdog-fixes-v1-3-745f1dce04c3@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Thu 2026-03-05 08:45:35, Doug Anderson wrote: > Hi, > > On Thu, Mar 5, 2026 at 5:47 AM Petr Mladek wrote: > > > > > --- a/kernel/watchdog.c > > > +++ b/kernel/watchdog.c > > > @@ -163,8 +171,13 @@ static bool is_hardlockup(unsigned int cpu) > > > { > > > int hrint = atomic_read(&per_cpu(hrtimer_interrupts, cpu)); > > > > > > - if (per_cpu(hrtimer_interrupts_saved, cpu) == hrint) > > > - return true; > > > + if (per_cpu(hrtimer_interrupts_saved, cpu) == hrint) { > > > + per_cpu(hrtimer_interrupts_missed, cpu)++; > > > + if (per_cpu(hrtimer_interrupts_missed, cpu) >= watchdog_hardlockup_miss_thresh) > > > > This would return true for every check when missed >= 3. > > As a result, the hardlockup would be reported every 4s. > > > > I would keep the 12s cadence and change this to: > > > > if (per_cpu(hrtimer_interrupts_missed, cpu) % watchdog_hardlockup_miss_thresh == 0) > > I could be confused, but I don't think this is needed because we clear > "hrtimer_interrupts_missed" to 0 any time we save the timer count. > While I believe the "%" will functionally work, it seems harder to > understand, at least to me. My understanding is that we save the number of interrupts and reset missed counter only when: + the number of interrupts is different (timer on the watched CPU fired) + the watchdog was touched (hiding delay) => it is just incremented when the timer was not called (hardlockup scenario). In particular, it is _not_ reset when we report the hardlockup. Or do I miss anything. Best Regards, Petr