[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <174368721780.30396.7072042211093296234.tip-bot2@tip-bot2>
Date: Thu, 03 Apr 2025 13:33:37 -0000
From: "tip-bot2 for Sohil Mehta" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Sohil Mehta <sohil.mehta@...el.com>, Ingo Molnar <mingo@...nel.org>,
Kai Huang <kai.huang@...el.com>,
"Peter Zijlstra (Intel)" <peterz@...radead.org>,
Nikolay Borisov <nik.borisov@...e.com>, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject: [tip: x86/nmi] x86/nmi: Improve NMI duration console printouts
The following commit has been merged into the x86/nmi branch of tip:
Commit-ID: f2e01dcf6df2d12e86c363ea9c37d53994d89dd6
Gitweb: https://git.kernel.org/tip/f2e01dcf6df2d12e86c363ea9c37d53994d89dd6
Author: Sohil Mehta <sohil.mehta@...el.com>
AuthorDate: Thu, 27 Mar 2025 23:46:29
Committer: Ingo Molnar <mingo@...nel.org>
CommitterDate: Tue, 01 Apr 2025 22:26:38 +02:00
x86/nmi: Improve NMI duration console printouts
Convert the last remaining printk() in nmi.c to pr_info(). Along with
it, use timespec macros to calculate the NMI handler duration.
Signed-off-by: Sohil Mehta <sohil.mehta@...el.com>
Signed-off-by: Ingo Molnar <mingo@...nel.org>
Reviewed-by: Kai Huang <kai.huang@...el.com>
Acked-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Reviewed-by: Nikolay Borisov <nik.borisov@...e.com>
Link: https://lore.kernel.org/r/20250327234629.3953536-10-sohil.mehta@intel.com
---
arch/x86/kernel/nmi.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/arch/x86/kernel/nmi.c b/arch/x86/kernel/nmi.c
index 59ed74e..be93ec7 100644
--- a/arch/x86/kernel/nmi.c
+++ b/arch/x86/kernel/nmi.c
@@ -119,12 +119,12 @@ static void nmi_check_duration(struct nmiaction *action, u64 duration)
action->max_duration = duration;
- remainder_ns = do_div(duration, (1000 * 1000));
- decimal_msecs = remainder_ns / 1000;
+ /* Convert duration from nsec to msec */
+ remainder_ns = do_div(duration, NSEC_PER_MSEC);
+ decimal_msecs = remainder_ns / NSEC_PER_USEC;
- printk_ratelimited(KERN_INFO
- "INFO: NMI handler (%ps) took too long to run: %lld.%03d msecs\n",
- action->handler, duration, decimal_msecs);
+ pr_info_ratelimited("INFO: NMI handler (%ps) took too long to run: %lld.%03d msecs\n",
+ action->handler, duration, decimal_msecs);
}
static int nmi_handle(unsigned int type, struct pt_regs *regs)
Powered by blists - more mailing lists