All of lore.kernel.org
 help / color / mirror / Atom feed
* [folded-merged] watchdog-softlockup-fix-incorrect-cpu-utilization-output-during-softlockup-v2.patch removed from -mm tree
@ 2025-09-14  0:16 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2025-09-14  0:16 UTC (permalink / raw)
  To: mm-commits, yaoma, tglx, max.kellermann, lihuafei1, yaozhenguo1,
	akpm


The quilt patch titled
     Subject: watchdog/softlockup:Fix incorrect CPU utilization output during softlockup
has been removed from the -mm tree.  Its filename was
     watchdog-softlockup-fix-incorrect-cpu-utilization-output-during-softlockup-v2.patch

This patch was dropped because it was folded into watchdog-softlockup-fix-incorrect-cpu-utilization-output-during-softlockup.patch

------------------------------------------------------
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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-09-14  0:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-14  0:16 [folded-merged] watchdog-softlockup-fix-incorrect-cpu-utilization-output-during-softlockup-v2.patch removed from -mm tree Andrew Morton

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.