From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org,yaoma@linux.alibaba.com,tglx@linutronix.de,max.kellermann@ionos.com,lihuafei1@huawei.com,yaozhenguo1@gmail.com,akpm@linux-foundation.org
Subject: + watchdog-softlockup-fix-incorrect-cpu-utilization-output-during-softlockup-v2.patch added to mm-nonmm-unstable branch
Date: Tue, 19 Aug 2025 15:54:51 -0700 [thread overview]
Message-ID: <20250819225452.6539EC4CEF1@smtp.kernel.org> (raw)
The patch titled
Subject: watchdog/softlockup:Fix incorrect CPU utilization output during softlockup
has been added to the -mm mm-nonmm-unstable branch. Its filename is
watchdog-softlockup-fix-incorrect-cpu-utilization-output-during-softlockup-v2.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/watchdog-softlockup-fix-incorrect-cpu-utilization-output-during-softlockup-v2.patch
This patch will later appear in the mm-nonmm-unstable branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days
------------------------------------------------------
From: ZhenguoYao <yaozhenguo1@gmail.com>
Subject: watchdog/softlockup:Fix incorrect CPU utilization output during softlockup
Date: Mon, 18 Aug 2025 16:14:38 +0800
make get_16bit_precision() more accurate, fix comment layout
Link: https://lkml.kernel.org/r/20250818081438.40540-1-yaozhenguo@jd.com
Signed-off-by: ZhenguoYao <yaozhenguo1@gmail.com>
Cc: Bitao Hu <yaoma@linux.alibaba.com>
Cc: Li Huafei <lihuafei1@huawei.com>
Cc: Max Kellermann <max.kellermann@ionos.com>
Cc: Thomas Gleinxer <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
kernel/watchdog.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
--- a/kernel/watchdog.c~watchdog-softlockup-fix-incorrect-cpu-utilization-output-during-softlockup-v2
+++ a/kernel/watchdog.c
@@ -425,7 +425,11 @@ static DEFINE_PER_CPU(u8, cpustat_tail);
*/
static u16 get_16bit_precision(u64 data_ns)
{
- return data_ns >> 24LL; /* 2^24ns ~= 16.8ms */
+ /*
+ * 2^24ns ~= 16.8ms
+ * Round to the nearest multiple of 16.8 milliseconds.
+ */
+ return (data_ns + (1 << 23)) >> 24LL;
}
static void update_cpustat(void)
@@ -444,7 +448,8 @@ static void update_cpustat(void)
old_stat = __this_cpu_read(cpustat_old[i]);
new_stat = get_16bit_precision(cpustat[tracked_stats[i]]);
util = DIV_ROUND_UP(100 * (new_stat - old_stat), sample_period_16);
- /* Since we use 16-bit precision, the raw data will undergo
+ /*
+ * Since we use 16-bit precision, the raw data will undergo
* integer division, which may sometimes result in data loss,
* and then result might exceed 100%. To avoid confusion,
* we enforce a 100% display cap when calculations exceed this threshold.
_
Patches currently in -mm which might be from yaozhenguo1@gmail.com are
watchdog-softlockup-fix-wrong-output-when-watchdog_thresh-3.patch
watchdog-softlockup-fix-incorrect-cpu-utilization-output-during-softlockup.patch
watchdog-softlockup-fix-incorrect-cpu-utilization-output-during-softlockup-v2.patch
reply other threads:[~2025-08-19 22:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20250819225452.6539EC4CEF1@smtp.kernel.org \
--to=akpm@linux-foundation.org \
--cc=lihuafei1@huawei.com \
--cc=max.kellermann@ionos.com \
--cc=mm-commits@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=yaoma@linux.alibaba.com \
--cc=yaozhenguo1@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.