From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: linux-kernel@vger.kernel.org
Cc: mingo@kernel.org, laijs@cn.fujitsu.com, dipankar@in.ibm.com,
akpm@linux-foundation.org, mathieu.desnoyers@efficios.com,
josh@joshtriplett.org, tglx@linutronix.de, peterz@infradead.org,
rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com,
dvhart@linux.intel.com, fweisbec@gmail.com, oleg@redhat.com,
bobby.prani@gmail.com,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Subject: [PATCH tip/core/rcu 02/12] rcu: Make _batches_completed() functions return unsigned long
Date: Wed, 7 Jan 2015 10:19:28 -0800 [thread overview]
Message-ID: <1420654779-11213-2-git-send-email-paulmck@linux.vnet.ibm.com> (raw)
In-Reply-To: <1420654779-11213-1-git-send-email-paulmck@linux.vnet.ibm.com>
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Long ago, the various ->completed fields were of type long, but now are
unsigned long due to signed-integer-overflow concerns. However, the
various _batches_completed() functions remained of type long, even though
their only purpose in life is to return the corresponding ->completed
field. This patch cleans this up by changing these functions' return
types to unsigned long.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
include/linux/rcutiny.h | 4 ++--
include/linux/rcutree.h | 6 +++---
kernel/rcu/tree.c | 4 ++--
kernel/rcu/tree.h | 2 +-
kernel/rcu/tree_plugin.h | 6 +++---
5 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h
index 0e5366200154..91f7e4c37800 100644
--- a/include/linux/rcutiny.h
+++ b/include/linux/rcutiny.h
@@ -94,7 +94,7 @@ static inline void rcu_virt_note_context_switch(int cpu)
/*
* Return the number of grace periods.
*/
-static inline long rcu_batches_completed(void)
+static inline unsigned long rcu_batches_completed(void)
{
return 0;
}
@@ -102,7 +102,7 @@ static inline long rcu_batches_completed(void)
/*
* Return the number of bottom-half grace periods.
*/
-static inline long rcu_batches_completed_bh(void)
+static inline unsigned long rcu_batches_completed_bh(void)
{
return 0;
}
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h
index 52953790dcca..9885bfb6b123 100644
--- a/include/linux/rcutree.h
+++ b/include/linux/rcutree.h
@@ -81,9 +81,9 @@ void cond_synchronize_rcu(unsigned long oldstate);
extern unsigned long rcutorture_testseq;
extern unsigned long rcutorture_vernum;
-long rcu_batches_completed(void);
-long rcu_batches_completed_bh(void);
-long rcu_batches_completed_sched(void);
+unsigned long rcu_batches_completed(void);
+unsigned long rcu_batches_completed_bh(void);
+unsigned long rcu_batches_completed_sched(void);
void show_rcu_gp_kthreads(void);
void rcu_force_quiescent_state(void);
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 4c106fcc0d54..e26d78712e16 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -317,7 +317,7 @@ static int rcu_pending(void);
/*
* Return the number of RCU-sched batches processed thus far for debug & stats.
*/
-long rcu_batches_completed_sched(void)
+unsigned long rcu_batches_completed_sched(void)
{
return rcu_sched_state.completed;
}
@@ -326,7 +326,7 @@ EXPORT_SYMBOL_GPL(rcu_batches_completed_sched);
/*
* Return the number of RCU BH batches processed thus far for debug & stats.
*/
-long rcu_batches_completed_bh(void)
+unsigned long rcu_batches_completed_bh(void)
{
return rcu_bh_state.completed;
}
diff --git a/kernel/rcu/tree.h b/kernel/rcu/tree.h
index 8e7b1843896e..1a07d7379ac6 100644
--- a/kernel/rcu/tree.h
+++ b/kernel/rcu/tree.h
@@ -546,7 +546,7 @@ DECLARE_PER_CPU(char, rcu_cpu_has_work);
/* Forward declarations for rcutree_plugin.h */
static void rcu_bootup_announce(void);
-long rcu_batches_completed(void);
+unsigned long rcu_batches_completed(void);
static void rcu_preempt_note_context_switch(void);
static int rcu_preempt_blocked_readers_cgp(struct rcu_node *rnp);
#ifdef CONFIG_HOTPLUG_CPU
diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
index 3ec85cb5d544..f69300d4a51f 100644
--- a/kernel/rcu/tree_plugin.h
+++ b/kernel/rcu/tree_plugin.h
@@ -117,7 +117,7 @@ static void __init rcu_bootup_announce(void)
* Return the number of RCU-preempt batches processed thus far
* for debug and statistics.
*/
-static long rcu_batches_completed_preempt(void)
+static unsigned long rcu_batches_completed_preempt(void)
{
return rcu_preempt_state.completed;
}
@@ -126,7 +126,7 @@ EXPORT_SYMBOL_GPL(rcu_batches_completed_preempt);
/*
* Return the number of RCU batches processed thus far for debug & stats.
*/
-long rcu_batches_completed(void)
+unsigned long rcu_batches_completed(void)
{
return rcu_batches_completed_preempt();
}
@@ -935,7 +935,7 @@ static void __init rcu_bootup_announce(void)
/*
* Return the number of RCU batches processed thus far for debug & stats.
*/
-long rcu_batches_completed(void)
+unsigned long rcu_batches_completed(void)
{
return rcu_batches_completed_sched();
}
--
1.8.1.5
next prev parent reply other threads:[~2015-01-07 18:19 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-07 18:19 [PATCH tip/core/rcu 0/12] rcutorture changes for 3.20 Paul E. McKenney
2015-01-07 18:19 ` [PATCH tip/core/rcu 01/12] rcutorture: Issue warnings on close calls due to Reader Batch blows Paul E. McKenney
2015-01-07 18:19 ` Paul E. McKenney [this message]
2015-01-07 18:19 ` [PATCH tip/core/rcu 03/12] rcutorture: Make build-output parsing correctly flag RCU's warnings Paul E. McKenney
2015-01-07 18:19 ` [PATCH tip/core/rcu 04/12] rcutorture: Use unsigned for Reader Batch computations Paul E. McKenney
2015-01-07 18:19 ` [PATCH tip/core/rcu 05/12] rcu: provide rcu_batches_completed_sched() for TINY_RCU Paul E. McKenney
2015-01-07 18:19 ` [PATCH tip/core/rcu 06/12] rcutorture: Drop rcu_torture_completed() and friends Paul E. McKenney
2015-01-07 18:19 ` [PATCH tip/core/rcu 07/12] rcu: Remove redundant rcu_batches_completed() declaration Paul E. McKenney
2015-01-07 18:19 ` [PATCH tip/core/rcu 08/12] rcutorture: Check from beginning to end of grace period Paul E. McKenney
2015-01-07 18:19 ` [PATCH tip/core/rcu 09/12] rcutorture: Handle different mpstat versions Paul E. McKenney
2015-01-07 18:19 ` [PATCH tip/core/rcu 10/12] torture: Add "-enable-kvm -soundhw pcspk" to qemu command line Paul E. McKenney
2015-01-07 18:19 ` [PATCH tip/core/rcu 11/12] torture: Flag console.log file to prevent holdovers from earlier runs Paul E. McKenney
2015-01-07 18:19 ` [PATCH tip/core/rcu 12/12] rcutorture: Add more diagnostics in rcu_barrier() test failure case 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=1420654779-11213-2-git-send-email-paulmck@linux.vnet.ibm.com \
--to=paulmck@linux.vnet.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=bobby.prani@gmail.com \
--cc=dhowells@redhat.com \
--cc=dipankar@in.ibm.com \
--cc=dvhart@linux.intel.com \
--cc=edumazet@google.com \
--cc=fweisbec@gmail.com \
--cc=josh@joshtriplett.org \
--cc=laijs@cn.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mingo@kernel.org \
--cc=oleg@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
/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;
as well as URLs for NNTP newsgroup(s).