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]);