mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@kernel.org>
To: rcu@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, kernel-team@meta.com,
	rostedt@goodmis.org, Zhen Lei <thunder.leizhen@huawei.com>,
	Elliott@paulmck-ThinkPad-P17-Gen-1.home, Robert <elliott@hpe.com>,
	Tejun Heo <tj@kernel.org>,
	"Peter Zijlstra (Intel)" <peterz@infradead.org>,
	Josh Don <joshdon@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Frederic Weisbecker <frederic@kernel.org>,
	"Paul E . McKenney" <paulmck@kernel.org>
Subject: [PATCH rcu 1/6] genirq: Fix the return type of kstat_cpu_irqs_sum()
Date: Wed,  4 Jan 2023 16:51:21 -0800	[thread overview]
Message-ID: <20230105005126.1772294-1-paulmck@kernel.org> (raw)
In-Reply-To: <20230105005105.GA1772125@paulmck-ThinkPad-P17-Gen-1>

From: Zhen Lei <thunder.leizhen@huawei.com>

The type of member ->irqs_sum is unsigned long, but kstat_cpu_irqs_sum()
returns int, which can result in truncation.  Therefore, change the
kstat_cpu_irqs_sum() function's return value to unsigned long to avoid
truncation.

Fixes: f2c66cd8eedd ("/proc/stat: scalability of irq num per cpu")
Reported-by: Elliott, Robert (Servers) <elliott@hpe.com>
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: "Peter Zijlstra (Intel)" <peterz@infradead.org>
Cc: Josh Don <joshdon@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
---
 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 ddb5a358fd829..90e2fdc17d79f 100644
--- a/include/linux/kernel_stat.h
+++ b/include/linux/kernel_stat.h
@@ -75,7 +75,7 @@ extern unsigned int kstat_irqs_usr(unsigned int irq);
 /*
  * Number of interrupts per cpu, since bootup
  */
-static inline unsigned int kstat_cpu_irqs_sum(unsigned int cpu)
+static inline unsigned long kstat_cpu_irqs_sum(unsigned int cpu)
 {
 	return kstat_cpu(cpu).irqs_sum;
 }
-- 
2.31.1.189.g2e36527f23


  reply	other threads:[~2023-01-05  0:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-05  0:51 [PATCH rcu 0/6] RCU CPU stall-warning updates for v6.3 Paul E. McKenney
2023-01-05  0:51 ` Paul E. McKenney [this message]
2023-01-05  0:51 ` [PATCH rcu 2/6] sched: Add helper kstat_cpu_softirqs_sum() Paul E. McKenney
2023-01-05  0:51 ` [PATCH rcu 3/6] sched: Add helper nr_context_switches_cpu() Paul E. McKenney
2023-01-05  0:51 ` [PATCH rcu 4/6] rcu: Add RCU stall diagnosis information Paul E. McKenney
2023-01-05  0:51 ` [PATCH rcu 5/6] rcu: Align the output of RCU CPU stall warning messages Paul E. McKenney
2023-01-05  0:51 ` [PATCH rcu 6/6] rcu: Allow up to five minutes expedited RCU CPU stall-warning timeouts Paul E. McKenney
2023-01-09 10:10   ` Geert Uytterhoeven
2023-01-09 15:13     ` Paul E. McKenney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230105005126.1772294-1-paulmck@kernel.org \
    --to=paulmck@kernel.org \
    --cc=Elliott@paulmck-ThinkPad-P17-Gen-1.home \
    --cc=akpm@linux-foundation.org \
    --cc=elliott@hpe.com \
    --cc=frederic@kernel.org \
    --cc=joshdon@google.com \
    --cc=kernel-team@meta.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=rcu@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=thunder.leizhen@huawei.com \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®