From nobody Tue Apr 8 04:55:08 2025 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 192BF2441A7; Thu, 3 Apr 2025 13:33:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743687221; cv=none; b=Rhydq9Cgqj9HNGMb2FhR4SeOGJ+ZW+zWcmJnavqnDrTc+f5nfT5USXpDVhbZfcmrd6KGlVzlzoi8eXBISLl7lNfAWB3nBOPCLcp5qFKzSoBL1TvGnW+ZvsbEZdAlgvI4bf4ZVSYu531b4gH+8UvFFU6e3T7YVbiuxlobpWwwVgc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743687221; c=relaxed/simple; bh=V09QYGy9WvMyptysyuxnjEZNRDE5mU1Edv5d/IFvE2Y=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=brk1BWYqQ1IaXK23jTHAYOO/TgBwsfAtQhVdpy35v/1oiL9SC2M9y23ItRQGTdcQ7W56IUbXYd68M48ZVQMdFKGUOwjoF2aspFtmcCJ1ftjc0e7znACzTv7ZL3L8KsTzAmVbABFuH3QpFsxfKwo7Nhq3DmgFFyP52ZD8aipt2sE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=l+/G1Ytl; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=oi7ANQvo; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="l+/G1Ytl"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="oi7ANQvo" Date: Thu, 03 Apr 2025 13:33:37 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1743687218; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Bqo3zAorG1aMhSEebspaI0g5rNtRC8E11v6m4l17RnI=; b=l+/G1Ytlg6q5gtQqJhwatiZl5Gr7U40+G1Bq38ES8crO2qL7QXr4ul3TL9x+bRs79NE0T3 UzfoCaTxK15/uQEU9LladbX9yjPUGLxA05LH9KEMFO4it1weHwOUe70AxE89wghop6yPrp KsniKrJDdYnZ2YIt4EGUwOraeXkUbkG+gF4rusWnzGLggPQ3vWmU72ezlYPFsi6HGSji97 3wjoyLM5jGJ0MlrykY+1aP6fUVQWadcYjxLQAuBmd6gUP1TUo2BQjs+F3B5SVWmPvUFqjy DoRLTn1zePTzePxiRzGT1Ihe5ZkMLY+w0qYo8TvjOlJeC+lpwopEZFvSg65Gxg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1743687218; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Bqo3zAorG1aMhSEebspaI0g5rNtRC8E11v6m4l17RnI=; b=oi7ANQvojYXSJEOTPiUown0JvSrLmXYMea5xPAM3wD4cR3TbdRqVC4BFtccop7vUfPLNRb fmk31touXteLkmCA== From: "tip-bot2 for Sohil Mehta" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/nmi] x86/nmi: Improve NMI duration console printouts Cc: Sohil Mehta , Ingo Molnar , Kai Huang , "Peter Zijlstra (Intel)" , Nikolay Borisov , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20250327234629.3953536-10-sohil.mehta@intel.com> References: <20250327234629.3953536-10-sohil.mehta@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <174368721780.30396.7072042211093296234.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the x86/nmi branch of tip: Commit-ID: f2e01dcf6df2d12e86c363ea9c37d53994d89dd6 Gitweb: https://git.kernel.org/tip/f2e01dcf6df2d12e86c363ea9c37d5399= 4d89dd6 Author: Sohil Mehta AuthorDate: Thu, 27 Mar 2025 23:46:29=20 Committer: Ingo Molnar 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 Signed-off-by: Ingo Molnar Reviewed-by: Kai Huang Acked-by: Peter Zijlstra (Intel) Reviewed-by: Nikolay Borisov 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 *acti= on, u64 duration) =20 action->max_duration =3D duration; =20 - remainder_ns =3D do_div(duration, (1000 * 1000)); - decimal_msecs =3D remainder_ns / 1000; + /* Convert duration from nsec to msec */ + remainder_ns =3D do_div(duration, NSEC_PER_MSEC); + decimal_msecs =3D remainder_ns / NSEC_PER_USEC; =20 - 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); } =20 static int nmi_handle(unsigned int type, struct pt_regs *regs)