From patchwork Sat Sep 11 03:48:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexei Lozovsky X-Patchwork-Id: 12486151 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 41955C433F5 for ; Sat, 11 Sep 2021 03:48:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1ED7D61214 for ; Sat, 11 Sep 2021 03:48:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235281AbhIKDt3 (ORCPT ); Fri, 10 Sep 2021 23:49:29 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:42799 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232531AbhIKDt1 (ORCPT ); Fri, 10 Sep 2021 23:49:27 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 22DE15C0189; Fri, 10 Sep 2021 23:48:14 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 10 Sep 2021 23:48:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ilammy.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=lMi0BKNLipyY8 mupcENzcBdBYS0W64a2lg2FY9qyhcQ=; b=N0a3vDvJ9PFW9IlXnNoO+0canqRJx UfhyyPQEXCnktRNUSpY+bjkeoOgglxnkURtWxqhF+b9BHtIvCYlqY0ynCmMnsTvt vMr54Gjr19weDBIIEoz3Kq3Yapg9LVWbiOwcOGz2/CqPaHi43R0EpjzmNc4bJxb/ 8zqNGikOO21q4Zt/OlG9S8OyOPPPOxVUdBywvUNPFZUPBo8pSFybH/n5FIpgI8y8 FVA1w5C/jRWhl7fXR2EU1QLEsTmCR4Adbp2XyyVhCzKhMvPJZ2T+LPJH9p32pTpO 1Q6QH0Q0KRfKRCOr0eVGDv1GfKoEkkjQ/YHXdVZYYBAU9v4PnvSFJSSsg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=lMi0BKNLipyY8mupcENzcBdBYS0W64a2lg2FY9qyhcQ=; b=v+4dSS8B xw6rXEFjQXxcVIUv6c1xx/e5t9kk2TeuwXZyCGKAJri63xSBVHe/RF3TtBuYJdwT u9eOAI5U2RaMtAjGGxF3dvQAQYWeEeVB9PnQNxRXxcIwUCtV/2a0mmh2vcMsSh7q 8Y/mdzojystgglikPKY4rUvFO1d7YHO8HqEYrOkrR9pfWdeMRRRAuzRAe5img+Xh AsVIXKM+Bec8071sv1lpFPDaL3B1bMfl33KX4t9nwVd6an5oL0fCH70V39r//PpM AidYTjHPZkX/6ITeMRySPGRR6/jk4gbqlItzhLSvIe39ug0fSRc7yyfHlikXFWKA hn6+24peo9BrzA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudegvddgjeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeetlhgvgigv ihcunfhoiihovhhskhihuceomhgvsehilhgrmhhmhidrnhgvtheqnecuggftrfgrthhtvg hrnhepteeujeehkeejueevieehgfeuheelleeggfehfefffeekjeduueejjeeugfetueek necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhgvse hilhgrmhhmhidrnhgvth X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 10 Sep 2021 23:48:12 -0400 (EDT) From: Alexei Lozovsky To: Thomas Gleixner Cc: Alexey Dobriyan , Christoph Lameter , LKML , linux-fsdevel@vger.kernel.org Subject: [PATCH 1/7] genirq: Use unsigned int for irqs_sum Date: Sat, 11 Sep 2021 12:48:02 +0900 Message-Id: <20210911034808.24252-2-me@ilammy.net> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210911034808.24252-1-me@ilammy.net> References: <06F4B1B0-E4DE-4380-A8E1-A5ACAD285163@ilammy.net> <20210911034808.24252-1-me@ilammy.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org It's read as unsigned int via kstat_cpu_irqs_sum() for /proc/stat. There is no point in having this counter wider than necessary. Signed-off-by: Alexei Lozovsky --- include/linux/kernel_stat.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h index 44ae1a7eb9e3..72818fb39ae8 100644 --- a/include/linux/kernel_stat.h +++ b/include/linux/kernel_stat.h @@ -36,7 +36,7 @@ struct kernel_cpustat { }; struct kernel_stat { - unsigned long irqs_sum; + unsigned int irqs_sum; unsigned int softirqs[NR_SOFTIRQS]; }; From patchwork Sat Sep 11 03:48:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexei Lozovsky X-Patchwork-Id: 12486153 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E13BEC433F5 for ; Sat, 11 Sep 2021 03:48:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C000461216 for ; Sat, 11 Sep 2021 03:48:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235306AbhIKDtc (ORCPT ); Fri, 10 Sep 2021 23:49:32 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:33153 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233549AbhIKDt2 (ORCPT ); Fri, 10 Sep 2021 23:49:28 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 22ABE5C00B1; Fri, 10 Sep 2021 23:48:16 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Fri, 10 Sep 2021 23:48:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ilammy.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=saIJQDFIkap8K f5WlETLRZ3iX43zsd8TcVVo9ME/MBw=; b=kRaJptlraeVFr/GR0fy50S2lJqaGa ovyy6dSPPsicn5x8nZuKhh868tseeqVOyKynjtqUh/dS2IdxuctRm/RfQILbI9nA pzxdX0b5SSRIbfrmQZB1b5jv9MHAi+Smm0G5Ai4Vwk1ZTpdS01OZr2hX5sKX6qwf a764AjXJGbmuoqNP3HhNzkGhl7aoivzEk3jpas/gl+cM0kvXxMDZ9TRLGRYMW3ON edW1e7r8s6W5DtWMK4w11ZfsPsRq5LN4f458vrnO2vuaEYvRwDF9oLl0DHg1NR66 4k2MRphpBATObdCT3Mzs8xOSFcFDksl5KrfDwD5npooFk7UWtFEzj7kJQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=saIJQDFIkap8Kf5WlETLRZ3iX43zsd8TcVVo9ME/MBw=; b=TSwvYq7g 2de91ps2k5vfhlxH0GaC9+CQrUrqJwmdBVcGbybSvo6ydPJvMSFsybjFkKWHJfZt ElDQCllJO3/7ZTxJhig566xY6A3WhdFH2/2X464wfd6GiulqYZcNeeqos49ycgHG EZ+2JpGkwFbjZc5DkxUtjYJb3d8LINnpf0Gek5f7heg2G9D6d6Cg7JDaP5FFIpLE Hnv/GDXbSBlU5d1+5c+8Fv8uUCPIQsYI6rJCx5TqIyiuLsf+h+MPLUfhzNjz+8ML QN5Wrqk68QcsJsiGpQsqKF3eQUJFUOePCe2Ql89p7FgrsTXrtQotflKZ5gPzsUp3 mtmGZoEMnOhBZg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudegvddgjeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeetlhgvgigv ihcunfhoiihovhhskhihuceomhgvsehilhgrmhhmhidrnhgvtheqnecuggftrfgrthhtvg hrnhepteeujeehkeejueevieehgfeuheelleeggfehfefffeekjeduueejjeeugfetueek necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhgvse hilhgrmhhmhidrnhgvth X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 10 Sep 2021 23:48:14 -0400 (EDT) From: Alexei Lozovsky To: Thomas Gleixner Cc: Alexey Dobriyan , Christoph Lameter , LKML , linux-fsdevel@vger.kernel.org Subject: [PATCH 2/7] powerpc/irq: arch_irq_stat_cpu() returns unsigned int Date: Sat, 11 Sep 2021 12:48:03 +0900 Message-Id: <20210911034808.24252-3-me@ilammy.net> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210911034808.24252-1-me@ilammy.net> References: <06F4B1B0-E4DE-4380-A8E1-A5ACAD285163@ilammy.net> <20210911034808.24252-1-me@ilammy.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org The interrupt counters this function sums up are all unsigned int (see irq_cpustat_t). If the sum overflows, so be it: you should monitor the counter and take note when it wraps around. Summing up unsigned int values into u64 does not "handle" overflows, but if any of the individual counters overflows then the computed sum is inaccurate. Signed-off-by: Alexei Lozovsky --- arch/powerpc/include/asm/hardirq.h | 2 +- arch/powerpc/kernel/irq.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/include/asm/hardirq.h b/arch/powerpc/include/asm/hardirq.h index f133b5930ae1..5248adcb50b4 100644 --- a/arch/powerpc/include/asm/hardirq.h +++ b/arch/powerpc/include/asm/hardirq.h @@ -32,7 +32,7 @@ static inline void ack_bad_irq(unsigned int irq) printk(KERN_CRIT "unexpected IRQ trap at vector %02x\n", irq); } -extern u64 arch_irq_stat_cpu(unsigned int cpu); +extern unsigned int arch_irq_stat_cpu(unsigned int cpu); #define arch_irq_stat_cpu arch_irq_stat_cpu #endif /* _ASM_POWERPC_HARDIRQ_H */ diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c index 551b653228c4..a100c967892e 100644 --- a/arch/powerpc/kernel/irq.c +++ b/arch/powerpc/kernel/irq.c @@ -645,9 +645,9 @@ int arch_show_interrupts(struct seq_file *p, int prec) /* * /proc/stat helpers */ -u64 arch_irq_stat_cpu(unsigned int cpu) +unsigned int arch_irq_stat_cpu(unsigned int cpu) { - u64 sum = per_cpu(irq_stat, cpu).timer_irqs_event; + unsigned int sum = per_cpu(irq_stat, cpu).timer_irqs_event; sum += per_cpu(irq_stat, cpu).broadcast_irqs_event; sum += per_cpu(irq_stat, cpu).pmu_irqs; From patchwork Sat Sep 11 03:48:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexei Lozovsky X-Patchwork-Id: 12486155 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8A033C433EF for ; Sat, 11 Sep 2021 03:48:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 69827611EF for ; Sat, 11 Sep 2021 03:48:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235316AbhIKDtd (ORCPT ); Fri, 10 Sep 2021 23:49:33 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:45163 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235295AbhIKDta (ORCPT ); Fri, 10 Sep 2021 23:49:30 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id CFF735C0198; Fri, 10 Sep 2021 23:48:17 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Fri, 10 Sep 2021 23:48:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ilammy.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=qU+ZIBwcVV+1Z RKMVnuvE+6vrYCsfMzo1A5ZRTYTTsk=; b=BG8AXXGuZxJ4Pp4TOAydPGjswfTAB K6cmhVG5XVM+klNVzCnRG9CO4wKZNer8y7FIM13lFyWVIzFz3FUyJb51fyuBBdLd 4cB9yalgupyxL0sM7Xpicoqj+CGnnwSTabPwGwrpYImB7UcdQa341XWP1vDp/tXu UnTaoG079XxQnQ4jE64QlXrguHG6dNalj8qd11CqKSITsYmBDLQof/8FF/PH0oA/ ZJt2n+Q8JByDjTNEHekSWKGjxRVMXJCPU+NgaFb8fhAubHTD+ORymcSmirxXyVWR KD/Hfgb0xEEgxBD/38I/1lAYp2KXkyndQz2MWhVkbTnP+1NJz1FuxFgvQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=qU+ZIBwcVV+1ZRKMVnuvE+6vrYCsfMzo1A5ZRTYTTsk=; b=T1Tp3tq2 6YK1epcUDtgnWw1qmMcN+jWfD2br8bPlg/4uWoYXMV8/QXuBG6LIkPa6gq09M2pm Y+MDyB0kv4fvSBPWS1weY7w4rSsO32yn7IMMxry0GX5jkykGRGhmKGLGtGXev9K/ k4aRfVlnJXdISGtJVyErYVzioaTIUXyXM5QvJB77oVTb7NbL++YwA7fmXzPlPuAM j9MO3v3wQMd1MEWhITAN6P3XVA87JbNKpfo+GvfJ3f5Nf2p6BaoOsDuxGiq/wF39 G7HlSmLYvHD0zaMV/18htPyXFtfzIOuX3GIYqEzbFDLqRNOdnIv8pn+iGCt91n7l oPbtpSuJ/RVDwA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudegvddgjeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeetlhgvgigv ihcunfhoiihovhhskhihuceomhgvsehilhgrmhhmhidrnhgvtheqnecuggftrfgrthhtvg hrnhepteeujeehkeejueevieehgfeuheelleeggfehfefffeekjeduueejjeeugfetueek necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhgvse hilhgrmhhmhidrnhgvth X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 10 Sep 2021 23:48:16 -0400 (EDT) From: Alexei Lozovsky To: Thomas Gleixner Cc: Alexey Dobriyan , Christoph Lameter , LKML , linux-fsdevel@vger.kernel.org Subject: [PATCH 3/7] x86/irq: arch_irq_stat_cpu() returns unsigned int Date: Sat, 11 Sep 2021 12:48:04 +0900 Message-Id: <20210911034808.24252-4-me@ilammy.net> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210911034808.24252-1-me@ilammy.net> References: <06F4B1B0-E4DE-4380-A8E1-A5ACAD285163@ilammy.net> <20210911034808.24252-1-me@ilammy.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Like with PowerPC's version, on x86 the interrupt counters that are added here are all unsigned int too (see irq_cpustat_t for x86) as well as mce_exception_count and mce_poll_count. Summing up unsigned int values into u64 does not "handle" overflows, but if any of the individual counters overflows then the computed sum is inaccurate. Signed-off-by: Alexei Lozovsky --- arch/x86/include/asm/hardirq.h | 2 +- arch/x86/kernel/irq.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/include/asm/hardirq.h b/arch/x86/include/asm/hardirq.h index 275e7fd20310..461536b45391 100644 --- a/arch/x86/include/asm/hardirq.h +++ b/arch/x86/include/asm/hardirq.h @@ -54,7 +54,7 @@ DECLARE_PER_CPU_SHARED_ALIGNED(irq_cpustat_t, irq_stat); extern void ack_bad_irq(unsigned int irq); -extern u64 arch_irq_stat_cpu(unsigned int cpu); +extern unsigned int arch_irq_stat_cpu(unsigned int cpu); #define arch_irq_stat_cpu arch_irq_stat_cpu extern u64 arch_irq_stat(void); diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c index e28f6a5d14f1..cefe1bc9f42c 100644 --- a/arch/x86/kernel/irq.c +++ b/arch/x86/kernel/irq.c @@ -188,9 +188,9 @@ int arch_show_interrupts(struct seq_file *p, int prec) /* * /proc/stat helpers */ -u64 arch_irq_stat_cpu(unsigned int cpu) +unsigned int arch_irq_stat_cpu(unsigned int cpu) { - u64 sum = irq_stats(cpu)->__nmi_count; + unsigned int sum = irq_stats(cpu)->__nmi_count; #ifdef CONFIG_X86_LOCAL_APIC sum += irq_stats(cpu)->apic_timer_irqs; From patchwork Sat Sep 11 03:48:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexei Lozovsky X-Patchwork-Id: 12486157 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 576B6C433F5 for ; Sat, 11 Sep 2021 03:48:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3192F611EF for ; Sat, 11 Sep 2021 03:48:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235360AbhIKDtn (ORCPT ); Fri, 10 Sep 2021 23:49:43 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:55707 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235300AbhIKDtb (ORCPT ); Fri, 10 Sep 2021 23:49:31 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 982005C0191; Fri, 10 Sep 2021 23:48:19 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Fri, 10 Sep 2021 23:48:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ilammy.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=UtuZPwZ+Fw93V aE+L4bJab8rAtlR8ivT2txo06W5xJs=; b=etBpuCx51QGe3lhLkATS6rCxxLJGB DpAAlArYC2TsrahY+HQFpX+fhLug8bHMHBzvxNDag6NKQM9N1FVEJrTNxiJTs+4j 0dB8QHgmc9np+PWYYMkKpbNsEycFN8tpIhVNYGbof52mlwXlnWX9WpDZbWFyaoNa nD0aXZ0qth27kygpl5SCwo+Xymt1dz8hB0R/tYFCyCkUnJxGYkJwoPdJDZoS7Wsy rF4+qnYj1zitLHjl1JXu6igGYoEQjr72jOerpe1cOT0rEJkpvOM5bHPKL8Mdy35Z k1pN3RnN6+fwXDXz0YKuy9oy8+ZQh7yYBjcIISIZyyEWMIlKs+aCsyZdg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=UtuZPwZ+Fw93VaE+L4bJab8rAtlR8ivT2txo06W5xJs=; b=bYs0jBya BbM5O98vjQIlwIF7KVhVq06mBi7wRLxM/Ml35Vbp6OVTjokRjg7iX+t89VIVc6Z2 KXP2xD9id1TFWMIX416gBwXcnOwlvSoakRWhoFnpYMZ0x0iQboLO47F2LgWu8slu NEILIckNs+vwtBlmhLfFlvEzuVCVPr4fUjiPgicy9nmyvKo/n2DrPSUk3WisyGqu /WWYk3uYdv8a97YBcFDu5r4UwDWnjdsPgx71yjnhfPGbg4y2WkRU0RvkD3bTPA15 MOqTcH/Q25/zzban9FiwcLy3Aw8bksTFjo21bgfk3MNdmCuF5Y5ujJc+HlxQ95h7 Cl1027vsZ1/71Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudegvddgjedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeetlhgvgigv ihcunfhoiihovhhskhihuceomhgvsehilhgrmhhmhidrnhgvtheqnecuggftrfgrthhtvg hrnhepteeujeehkeejueevieehgfeuheelleeggfehfefffeekjeduueejjeeugfetueek necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhgvse hilhgrmhhmhidrnhgvth X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 10 Sep 2021 23:48:18 -0400 (EDT) From: Alexei Lozovsky To: Thomas Gleixner Cc: Alexey Dobriyan , Christoph Lameter , LKML , linux-fsdevel@vger.kernel.org Subject: [PATCH 4/7] x86/irq: arch_irq_stat() returns unsigned int Date: Sat, 11 Sep 2021 12:48:05 +0900 Message-Id: <20210911034808.24252-5-me@ilammy.net> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210911034808.24252-1-me@ilammy.net> References: <06F4B1B0-E4DE-4380-A8E1-A5ACAD285163@ilammy.net> <20210911034808.24252-1-me@ilammy.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org irq_err_count is atomic_t, extending it to u64 does not make the value wider, it's still unsigned int and will wrap around like unsigned int. Signed-off-by: Alexei Lozovsky --- arch/x86/include/asm/hardirq.h | 2 +- arch/x86/kernel/irq.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/include/asm/hardirq.h b/arch/x86/include/asm/hardirq.h index 461536b45391..3b0d79e72871 100644 --- a/arch/x86/include/asm/hardirq.h +++ b/arch/x86/include/asm/hardirq.h @@ -57,7 +57,7 @@ extern void ack_bad_irq(unsigned int irq); extern unsigned int arch_irq_stat_cpu(unsigned int cpu); #define arch_irq_stat_cpu arch_irq_stat_cpu -extern u64 arch_irq_stat(void); +extern unsigned int arch_irq_stat(void); #define arch_irq_stat arch_irq_stat diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c index cefe1bc9f42c..18691ed499d1 100644 --- a/arch/x86/kernel/irq.c +++ b/arch/x86/kernel/irq.c @@ -218,9 +218,9 @@ unsigned int arch_irq_stat_cpu(unsigned int cpu) return sum; } -u64 arch_irq_stat(void) +unsigned int arch_irq_stat(void) { - u64 sum = atomic_read(&irq_err_count); + unsigned int sum = atomic_read(&irq_err_count); return sum; } From patchwork Sat Sep 11 03:48:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexei Lozovsky X-Patchwork-Id: 12486159 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C9A25C433EF for ; Sat, 11 Sep 2021 03:48:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B151B61212 for ; Sat, 11 Sep 2021 03:48:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235385AbhIKDtt (ORCPT ); Fri, 10 Sep 2021 23:49:49 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:34785 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235319AbhIKDtd (ORCPT ); Fri, 10 Sep 2021 23:49:33 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 57CBB5C0187; Fri, 10 Sep 2021 23:48:21 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 10 Sep 2021 23:48:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ilammy.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=cigNkoH13qaWh wQ8t7Mm2Oj9VW7DSWQdJYMBXGB8leE=; b=QGNIsVTNHlretRUnvBEfGehe800eO j2Dre7EBBnkDJI4QIqCC9e9sjjytrDQJyuNB8NUdfEDppjPRFu2visCHWUL/m3XW bgBoFzsiX4PiVw9oFB7lJWqJ/EADCHEGQfRd3XAZgVrurCyGbTkjLQaBfH4lOMJN IfFBolfp+nBH1eqos6A14i1qjvnULWEc456vagTXPARJX4g4368buVdhOGd6WgO+ xmzOO37jNyCTcwd1WBI7GkUe95qcqr9c/9eoNpQMWPbWxhbEantaNzzBA3HZlxuJ bJApwY3DVEcY3/BeCOTrQskJKeemC+G7M4OltvGlGbTIikrYoKz+qq33Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=cigNkoH13qaWhwQ8t7Mm2Oj9VW7DSWQdJYMBXGB8leE=; b=EnAmDpBx d6YuMMEz1FyHXJu91uGifX8aXMZwswwZ2/pO6U1M9zXrElS8yrQ7mGNPnvPPfMWT eAmQlz3F1cOhFjYF8kCaw5BCQYBikiArR0ufEASkbtEozJaUSK5m9Dr82BDcnj2v 4LPUTqM1xGL/XzDVVwcFrN01pVcA9RBnmJQy6KnPKGRqn6y8Bf/cJd5NTZQ9QWmn uB6VFEXXhF3RjI5fyy+xJxhm2xI7rHPvCyGJgeNIcuUZBj+WR2zhW/3aleY/lXtn eFgDDdWf/6UWlOTGt1/cfgxI/Xg5WKcfd/YiRg2b7oDe4ZOY5hWjHHYX9Gy+4iqM 2xMTSOB11RMreQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudegvddgjeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeetlhgvgigv ihcunfhoiihovhhskhihuceomhgvsehilhgrmhhmhidrnhgvtheqnecuggftrfgrthhtvg hrnhepteeujeehkeejueevieehgfeuheelleeggfehfefffeekjeduueejjeeugfetueek necuvehluhhsthgvrhfuihiivgepudenucfrrghrrghmpehmrghilhhfrhhomhepmhgvse hilhgrmhhmhidrnhgvth X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 10 Sep 2021 23:48:19 -0400 (EDT) From: Alexei Lozovsky To: Thomas Gleixner Cc: Alexey Dobriyan , Christoph Lameter , LKML , linux-fsdevel@vger.kernel.org Subject: [PATCH 5/7] proc/stat: Use unsigned int for "intr" sum Date: Sat, 11 Sep 2021 12:48:06 +0900 Message-Id: <20210911034808.24252-6-me@ilammy.net> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210911034808.24252-1-me@ilammy.net> References: <06F4B1B0-E4DE-4380-A8E1-A5ACAD285163@ilammy.net> <20210911034808.24252-1-me@ilammy.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Now that all values that are collected into "sum" are unsigned int, make the sum itself unsigned int so that it overflows consistently with individual components and thus retains the monotonicity. Since seq_put_decimal_ull() is a function, we don't have to explicitly cast sum into unsigned long long. Integer promotion will take care of that (and the compiler will issue warnings if the types don't agree). Signed-off-by: Alexei Lozovsky --- fs/proc/stat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/proc/stat.c b/fs/proc/stat.c index 6561a06ef905..d31b83b2a175 100644 --- a/fs/proc/stat.c +++ b/fs/proc/stat.c @@ -110,7 +110,7 @@ static int show_stat(struct seq_file *p, void *v) int i, j; u64 user, nice, system, idle, iowait, irq, softirq, steal; u64 guest, guest_nice; - u64 sum = 0; + unsigned int sum = 0; u64 sum_softirq = 0; unsigned int per_softirq_sums[NR_SOFTIRQS] = {0}; struct timespec64 boottime; @@ -192,7 +192,7 @@ static int show_stat(struct seq_file *p, void *v) seq_put_decimal_ull(p, " ", nsec_to_clock_t(guest_nice)); seq_putc(p, '\n'); } - seq_put_decimal_ull(p, "intr ", (unsigned long long)sum); + seq_put_decimal_ull(p, "intr ", sum); show_all_irqs(p); From patchwork Sat Sep 11 03:48:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexei Lozovsky X-Patchwork-Id: 12486161 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A58AFC433FE for ; Sat, 11 Sep 2021 03:48:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8FAED61214 for ; Sat, 11 Sep 2021 03:48:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235364AbhIKDtw (ORCPT ); Fri, 10 Sep 2021 23:49:52 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:60155 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235322AbhIKDtf (ORCPT ); Fri, 10 Sep 2021 23:49:35 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 115D05C018D; Fri, 10 Sep 2021 23:48:23 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 10 Sep 2021 23:48:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ilammy.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=hZFPPQMxtDZYs SaAZ1s1UJVWP1V7Xv6Kaz9Dp+/4f24=; b=dkgv1grr7eem+kHDQotDzlcN7xyIV wEVo9mXfGH0yokZuB/Gvhp3Wswg53X+shqyJiMTgrRfgl21cvLIamMTqqvcPmMLk KdqD1TXZ7RySsBqHCvXyHz71nIVEPjkAwjFhMuoCLLqjLMzIvE7DW8VqYnRO46cL dpoW3ZDoeV22X+pOvFEdB/w+24OZHuC1xlpKnaih6YAyEolB1GVDudvSm90U37PG O5FcxxQbsPQCNi1VCmwazg8b5sxCHrvsbPXbnG+j/gGnEsAZVyYtLBL7lWeHbOwf Mp5/MeFdhawuJefNlECyFsoD5zwwcnIAp86smtgPzua0Ah4H5AcWhEUaw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=hZFPPQMxtDZYsSaAZ1s1UJVWP1V7Xv6Kaz9Dp+/4f24=; b=cwTjDWO5 0Gk1ynKlfJOqK/aSbQ3G14iUEz+LhGkyi5zGKdeM+ux6gqFpDmYbghS6ZEyIWTgg +IgJbuUWUtDnY4AzSW2is90YB8ZgzrNauPTWZCY2vRvTce34aUrKI0zagnr5oNW6 MSF5F7CiLFs+xcatjYMAgYH+weW/AlLfWoJoxvq/wYtEO2wdKD1WO7e6jiDP1uyI 1afBKGhRlD/fhLn/pLLBey19KZ4dcu5TOrqvZxQGdYEleNJZ4Bx8lDlpfxZXey3A /vqdnwpEpE1lhjv7PvKmJCF38wBCMOIIrYtnN6kjK76DHJ/XBbxDfld2J068SLXq Z00QzRPoVD3StA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudegvddgjeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeetlhgvgigv ihcunfhoiihovhhskhihuceomhgvsehilhgrmhhmhidrnhgvtheqnecuggftrfgrthhtvg hrnhepteeujeehkeejueevieehgfeuheelleeggfehfefffeekjeduueejjeeugfetueek necuvehluhhsthgvrhfuihiivgepudenucfrrghrrghmpehmrghilhhfrhhomhepmhgvse hilhgrmhhmhidrnhgvth X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 10 Sep 2021 23:48:21 -0400 (EDT) From: Alexei Lozovsky To: Thomas Gleixner Cc: Alexey Dobriyan , Christoph Lameter , LKML , linux-fsdevel@vger.kernel.org Subject: [PATCH 6/7] proc/stat: Use unsigned int for "softirq" sum Date: Sat, 11 Sep 2021 12:48:07 +0900 Message-Id: <20210911034808.24252-7-me@ilammy.net> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210911034808.24252-1-me@ilammy.net> References: <06F4B1B0-E4DE-4380-A8E1-A5ACAD285163@ilammy.net> <20210911034808.24252-1-me@ilammy.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Similarly to "intr" sum value, "softirq" sum is computed by adding up unsigned int counters for each CPU returned by kstat_softirqs_cpu(). To preserve monotonicity, use the same integer type so that the sum wraps around consistently. And just like before, this value does not need to be explicitly casted into unsigned long long for display. Signed-off-by: Alexei Lozovsky --- fs/proc/stat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/proc/stat.c b/fs/proc/stat.c index d31b83b2a175..b7a7de3cd822 100644 --- a/fs/proc/stat.c +++ b/fs/proc/stat.c @@ -111,7 +111,7 @@ static int show_stat(struct seq_file *p, void *v) u64 user, nice, system, idle, iowait, irq, softirq, steal; u64 guest, guest_nice; unsigned int sum = 0; - u64 sum_softirq = 0; + unsigned int sum_softirq = 0; unsigned int per_softirq_sums[NR_SOFTIRQS] = {0}; struct timespec64 boottime; @@ -208,7 +208,7 @@ static int show_stat(struct seq_file *p, void *v) nr_running(), nr_iowait()); - seq_put_decimal_ull(p, "softirq ", (unsigned long long)sum_softirq); + seq_put_decimal_ull(p, "softirq ", sum_softirq); for (i = 0; i < NR_SOFTIRQS; i++) seq_put_decimal_ull(p, " ", per_softirq_sums[i]); From patchwork Sat Sep 11 03:48:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexei Lozovsky X-Patchwork-Id: 12486163 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 04540C433FE for ; Sat, 11 Sep 2021 03:48:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E275E611EF for ; Sat, 11 Sep 2021 03:48:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235404AbhIKDt4 (ORCPT ); Fri, 10 Sep 2021 23:49:56 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:35773 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235326AbhIKDth (ORCPT ); Fri, 10 Sep 2021 23:49:37 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id B87FE5C0178; Fri, 10 Sep 2021 23:48:24 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 10 Sep 2021 23:48:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ilammy.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=NH5HGQ0wFtmZ6 SSZLSPDfXj0zUk85slBKvwDXIdMM4U=; b=Vn/KHzqC53fTdOkNG/PrGKEMB+Co/ tGdcvr4GnbjpoHVYHya+E9c7dpD79gNx2cTygqwXOuiYovPCDpgG5sgiwV0YWZxj VOARSKzV6YqdOdprb5tMYlEmoUg0efp95nr2CRjxY3WrD3Hp7G9FzTtmG02TMZcE 1CXi07t2+/cHALk1mzV7prgIEzc498QTezySR8neuvu5XfxUQiaBaniuCltuv7aA xv1gRb3xVP5H0M40bxfptUZKEN/mxk97UHx00O/CS752CHSCBFMB7ZeL9SLjdQAQ Yn2JMU44AHW2LKrhRI3GCMKBTkhVfKEcqaGCKCwNr7UU0Q7s+qfT0b9ZA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=NH5HGQ0wFtmZ6SSZLSPDfXj0zUk85slBKvwDXIdMM4U=; b=RivrVkVC fEGcSLSIzB5YPciPybnYd5P+O93rt3qTTinINyIvKBYyCGSH+yizMsB9x/KKRF8d GwxQdeXgDJGCBtYseuAJxII7PVkyYDt8T5SM/xJmjjoBm240i9w4yFRN3Zrsj5jb 3IBPhVzoWJuHnXjHmmUsBgsLHUqDHSASEFh8bvmIn69DQYXcxRc01R9/bgnp5BFK IbmnFs/KTyHh7/N/y2cBPcIqI1pg5i5xS4rs8QoWMHw1q+kWJX1yJLwXczAXW4mD zqMJOtWPMbz1nuraKJXpjr75RZ/VgN3ThRQ27DD2/GKSMvjJb/GMVslttCJFLl54 Z5MRihi9oE1e/g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudegvddgjeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeetlhgvgigv ihcunfhoiihovhhskhihuceomhgvsehilhgrmhhmhidrnhgvtheqnecuggftrfgrthhtvg hrnhepteeujeehkeejueevieehgfeuheelleeggfehfefffeekjeduueejjeeugfetueek necuvehluhhsthgvrhfuihiivgepudenucfrrghrrghmpehmrghilhhfrhhomhepmhgvse hilhgrmhhmhidrnhgvth X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 10 Sep 2021 23:48:23 -0400 (EDT) From: Alexei Lozovsky To: Thomas Gleixner Cc: Alexey Dobriyan , Christoph Lameter , LKML , linux-fsdevel@vger.kernel.org Subject: [PATCH 7/7] docs: proc.rst: stat: Note the interrupt counter wrap-around Date: Sat, 11 Sep 2021 12:48:08 +0900 Message-Id: <20210911034808.24252-8-me@ilammy.net> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210911034808.24252-1-me@ilammy.net> References: <06F4B1B0-E4DE-4380-A8E1-A5ACAD285163@ilammy.net> <20210911034808.24252-1-me@ilammy.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Let's make wrap-around documented behavior so that userspace has no excuses for not handling it properly if they want accurate values. Both "intr" and "softirq" counters (as well as many others, actually) can and will wrap-around, given enough time since boot. Signed-off-by: Alexei Lozovsky --- Documentation/filesystems/proc.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Documentation/filesystems/proc.rst b/Documentation/filesystems/proc.rst index 042c418f4090..06a0e3aa2e0e 100644 --- a/Documentation/filesystems/proc.rst +++ b/Documentation/filesystems/proc.rst @@ -1513,6 +1513,13 @@ interrupts serviced including unnumbered architecture specific interrupts; each subsequent column is the total for that particular numbered interrupt. Unnumbered interrupts are not shown, only summed into the total. +.. note:: + + Interrupt counters on most platforms are 32-bit, including the total count. + Depending on the system load, ths values will sooner or later wrap around. + If you want accurate accouting of the rate and *real* number of interrupts + serviced, you should monitor the value closely and handle wrap-arounds. + The "ctxt" line gives the total number of context switches across all CPUs. The "btime" line gives the time at which the system booted, in seconds since