From mboxrd@z Thu Jan 1 00:00:00 1970 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=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable 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 6471DC433EF 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 437916121E for ; Sat, 11 Sep 2021 03:48:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235287AbhIKDt3 (ORCPT ); Fri, 10 Sep 2021 23:49:29 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:45725 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230442AbhIKDtY (ORCPT ); Fri, 10 Sep 2021 23:49:24 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 4E3BC5C0178; Fri, 10 Sep 2021 23:48:12 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 10 Sep 2021 23:48:12 -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=8hUfaqG2iqGw/ zAQdkcBvqhTyxx4oaltsi3KSY1CXU8=; b=Ua+F6S9yCbNpg5/Sog7Hovd1Xj/CX VL9JZbKDx9UiCQcmBmZwgSC7JZAzStS1O9UFfAO85rObZH8ZbZxI0bulTojoTLDa TLNJT8Ono/AyYo0DykesRnDW5/reFYIkpS2Ltp2g3gDyYBgbVtL3tWFsHk4XT0e4 ezismw0S4SQij/U3gfEBkJvafAGg+gRgWoH1YGLnNAbsue7TgEnqA1R5y655+JkS wniU925xXWR4Vc2y1RzVfvFqvrEjUUYl4L1iFAwj+NpMa4OPMNDImhrHx+Z2WSda O3yrNdAveUBXfVKUvy/Hqkr69BnYO5x3qvvRke+NxP4t48D2cAHRAlSbg== 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=8hUfaqG2iqGw/zAQdkcBvqhTyxx4oaltsi3KSY1CXU8=; b=O9qEa6MQ h/VH421hkcjpZRoJiaynZwlgj6EcLgdNIU85qhzlPOxBs6nC2cCiEMlLpxj/eV+a 6WHABSN0QMdeT9L0SP37TzD6Xk7vzx7d//e9rxDLUHPAyeFnU1ScJAhs0lPGesO4 Ml1/6dCx7iCbMq6tRmIwpUlVcAb5kc208CQ1Fs4Pi706ehb+a8vjSw06D09AiG+h to+TlC/BdM5zpgbPvwFYZq3NJxz9ZyKfY36TwfmHexUqDEIxnToNouZcglOE3Ls2 lNF5m5kRHgJpelAGNYkyrTJmjAGejASklGEzrjSPBkznUwJcI1cua6Jh4WjbeWXG +9py6WccnFLnZQ== 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:10 -0400 (EDT) From: Alexei Lozovsky To: Thomas Gleixner Cc: Alexey Dobriyan , Christoph Lameter , LKML , linux-fsdevel@vger.kernel.org Subject: [PATCH 0/7] proc/stat: Maintain monotonicity of "intr" and "softirq" Date: Sat, 11 Sep 2021 12:48:01 +0900 Message-Id: <20210911034808.24252-1-me@ilammy.net> X-Mailer: git-send-email 2.25.1 In-Reply-To: <06F4B1B0-E4DE-4380-A8E1-A5ACAD285163@ilammy.net> References: <06F4B1B0-E4DE-4380-A8E1-A5ACAD285163@ilammy.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Here's a patch set that makes /proc/stat report total interrupt counts as monotonically increasing values, just like individual counters for interrupt types and CPUs are. This is as if the sum was a shared counter that all CPUs increment atomically together with their individual counters, with the sum correctly and expectedly wrapping around to zero once it reaches UINT_MAX. I've also added some documentation bits to codify this behavior and make it explicit that wrap-arounds must be expected and handled if userspace wants to maintain accurate total interrupt count for whatever reasons. Alexei Lozovsky (7): genirq: Use unsigned int for irqs_sum powerpc/irq: arch_irq_stat_cpu() returns unsigned int x86/irq: arch_irq_stat_cpu() returns unsigned int x86/irq: arch_irq_stat() returns unsigned int proc/stat: Use unsigned int for "intr" sum proc/stat: Use unsigned int for "softirq" sum docs: proc.rst: stat: Note the interrupt counter wrap-around Documentation/filesystems/proc.rst | 7 +++++++ arch/powerpc/include/asm/hardirq.h | 2 +- arch/powerpc/kernel/irq.c | 4 ++-- arch/x86/include/asm/hardirq.h | 4 ++-- arch/x86/kernel/irq.c | 8 ++++---- fs/proc/stat.c | 8 ++++---- include/linux/kernel_stat.h | 2 +- 7 files changed, 21 insertions(+), 14 deletions(-) -- 2.25.1