[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <bccb731a-f99d-91ab-6dca-c1182d55ff28@quicinc.com>
Date: Tue, 8 Nov 2022 20:00:56 +0530
From: Mukesh Ojha <quic_mojha@...cinc.com>
To: Zhen Lei <thunder.leizhen@...wei.com>,
"Paul E . McKenney" <paulmck@...nel.org>,
Frederic Weisbecker <frederic@...nel.org>,
"Neeraj Upadhyay" <quic_neeraju@...cinc.com>,
Josh Triplett <josh@...htriplett.org>,
Steven Rostedt <rostedt@...dmis.org>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Lai Jiangshan <jiangshanlai@...il.com>,
Joel Fernandes <joel@...lfernandes.org>, <rcu@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <quic_mojha@...cinc.com>
CC: Robert Elliott <elliott@....com>
Subject: Re: [PATCH v5 2/4] sched: Add helper kstat_cpu_softirqs_sum()
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 <thunder.leizhen@...wei.com>
> ---
> 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.
> +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 <quic_mojha@...cinc.com>
-Mukesh
Powered by blists - more mailing lists