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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 100E0C4332F for ; Tue, 8 Nov 2022 18:21:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234546AbiKHSVq (ORCPT ); Tue, 8 Nov 2022 13:21:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233995AbiKHSVk (ORCPT ); Tue, 8 Nov 2022 13:21:40 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E121BBDE; Tue, 8 Nov 2022 10:21:39 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A48A8B81BED; Tue, 8 Nov 2022 18:21:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 41DCEC433C1; Tue, 8 Nov 2022 18:21:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667931697; bh=WivBg608EwuEkpMMcwoY2eMo338QcvFPVcdyOYtBcs8=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=fQxth3NhguGl4JRjEau4ytkdZ9OuCi0m5Oa8yPalGPwNuYR3jqD3f/zBm/XPoCQAM x3BIGW5EcHG7d0G2vep6xG1Bea6auPxDonXIlv0c2xAAuDVWIvjZ0u9kUEAV2H/nN9 mM3DxGamSHBwoIM9MLKnnD+2Wk0w67IzmlMwd1sf4S/l6LyCOkssENcdn1FMIfLbh6 Q1ZtuJVE/oG3F9M7WL48Wk8kr+aNokZhvOhiE1uQBarhvEFvdE61eikNm1SfFTPJW/ ABpJep8a5s/QY366WHT7POv05C+HL9VPivRSzMKfmG75Gu/BxjhOMoiG4iLFKIlN8c dq/p+Qr+9Ch3Q== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 93C715C1E87; Tue, 8 Nov 2022 10:21:35 -0800 (PST) Date: Tue, 8 Nov 2022 10:21:35 -0800 From: "Paul E. McKenney" To: Mukesh Ojha Cc: Zhen Lei , Frederic Weisbecker , Neeraj Upadhyay , Josh Triplett , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Joel Fernandes , rcu@vger.kernel.org, linux-kernel@vger.kernel.org, Robert Elliott Subject: Re: [PATCH v5 2/4] sched: Add helper kstat_cpu_softirqs_sum() Message-ID: <20221108182135.GD3907045@paulmck-ThinkPad-P17-Gen-1> Reply-To: paulmck@kernel.org References: <20221104141118.119-1-thunder.leizhen@huawei.com> <20221104141118.119-3-thunder.leizhen@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 08, 2022 at 08:00:56PM +0530, Mukesh Ojha wrote: > Hi, > > On 11/4/2022 7:41 PM, Zhen Lei wrote: > > Similar to kstat_cpu_irqs_sum(), it counts the sum of all software > > interrupts on a specified CPU. > > > > Signed-off-by: Zhen Lei > > --- > > include/linux/kernel_stat.h | 11 +++++++++++ > > 1 file changed, 11 insertions(+) > > > > diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h > > index 90e2fdc17d79ff8..898076e173a928a 100644 > > --- a/include/linux/kernel_stat.h > > +++ b/include/linux/kernel_stat.h > > @@ -67,6 +67,17 @@ static inline unsigned int kstat_softirqs_cpu(unsigned int irq, int cpu) > > return kstat_cpu(cpu).softirqs[irq]; > > } > > One header comment would have been good. No argument, except that the other functions in this file are also quite innocent of header comments. :-/ I have no idea what the maintainer(s) of this code would think of a separate patch supplying the header comments. > > +static inline unsigned int kstat_cpu_softirqs_sum(int cpu) > > +{ > > + int i; > > + unsigned int sum = 0; > > + > > + for (i = 0; i < NR_SOFTIRQS; i++) > > + sum += kstat_softirqs_cpu(i, cpu); > > + > > + return sum; > > +} > > + > > /* > > * Number of interrupts per specific IRQ source, since bootup > > */ > > LGTM. > Reviewed-by: Mukesh Ojha Applied all three, thank you! Thanx, Paul