* [PATCH tip/core/rcu 02/13] rcu: Remove show_tiny_preempt_stats()
2013-05-20 14:58 ` [PATCH tip/core/rcu 01/13] rcu: Remove TINY_PREEMPT_RCU Paul E. McKenney
@ 2013-05-20 14:58 ` Paul E. McKenney
2013-05-20 14:58 ` [PATCH tip/core/rcu 03/13] rcu: Remove rcu_preempt_check_callbacks() Paul E. McKenney
` (10 subsequent siblings)
11 siblings, 0 replies; 17+ messages in thread
From: Paul E. McKenney @ 2013-05-20 14:58 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, Valdis.Kletnieks, dhowells, edumazet, darren,
fweisbec, sbw, Paul E. McKenney
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
With the removal of CONFIG_TINY_PREEMPT_RCU, show_tiny_preempt_stats()
is now an empty function. This commit therefore eliminates it by
inlining it.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
---
kernel/rcutiny_plugin.h | 13 -------------
1 file changed, 13 deletions(-)
diff --git a/kernel/rcutiny_plugin.h b/kernel/rcutiny_plugin.h
index 29a4dd7..cf0bc22 100644
--- a/kernel/rcutiny_plugin.h
+++ b/kernel/rcutiny_plugin.h
@@ -102,18 +102,6 @@ static void check_cpu_stalls(void)
RCU_TRACE(check_cpu_stall_preempt());
}
-#ifdef CONFIG_RCU_TRACE
-
-/*
- * Because preemptible RCU does not exist, it is not necessary to
- * dump out its statistics.
- */
-static void show_tiny_preempt_stats(struct seq_file *m)
-{
-}
-
-#endif /* #ifdef CONFIG_RCU_TRACE */
-
/*
* Because preemptible RCU does not exist, it never has any callbacks
* to check.
@@ -202,7 +190,6 @@ static void rcu_trace_sub_qlen(struct rcu_ctrlblk *rcp, int n)
*/
static int show_tiny_stats(struct seq_file *m, void *unused)
{
- show_tiny_preempt_stats(m);
seq_printf(m, "rcu_sched: qlen: %ld\n", rcu_sched_ctrlblk.qlen);
seq_printf(m, "rcu_bh: qlen: %ld\n", rcu_bh_ctrlblk.qlen);
return 0;
--
1.8.1.5
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH tip/core/rcu 03/13] rcu: Remove rcu_preempt_check_callbacks()
2013-05-20 14:58 ` [PATCH tip/core/rcu 01/13] rcu: Remove TINY_PREEMPT_RCU Paul E. McKenney
2013-05-20 14:58 ` [PATCH tip/core/rcu 02/13] rcu: Remove show_tiny_preempt_stats() Paul E. McKenney
@ 2013-05-20 14:58 ` Paul E. McKenney
2013-05-20 14:58 ` [PATCH tip/core/rcu 04/13] rcu: Remove rcu_preempt_remove_callbacks() Paul E. McKenney
` (9 subsequent siblings)
11 siblings, 0 replies; 17+ messages in thread
From: Paul E. McKenney @ 2013-05-20 14:58 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, Valdis.Kletnieks, dhowells, edumazet, darren,
fweisbec, sbw, Paul E. McKenney
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
With the removal of CONFIG_TINY_PREEMPT_RCU, rcu_preempt_check_callbacks()
is now an empty function. This commit therefore eliminates it by
inlining it.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
---
kernel/rcutiny.c | 1 -
kernel/rcutiny_plugin.h | 8 --------
2 files changed, 9 deletions(-)
diff --git a/kernel/rcutiny.c b/kernel/rcutiny.c
index a0714a5..9178282 100644
--- a/kernel/rcutiny.c
+++ b/kernel/rcutiny.c
@@ -257,7 +257,6 @@ void rcu_check_callbacks(int cpu, int user)
rcu_sched_qs(cpu);
else if (!in_softirq())
rcu_bh_qs(cpu);
- rcu_preempt_check_callbacks();
}
/*
diff --git a/kernel/rcutiny_plugin.h b/kernel/rcutiny_plugin.h
index cf0bc22..404b3a3 100644
--- a/kernel/rcutiny_plugin.h
+++ b/kernel/rcutiny_plugin.h
@@ -104,14 +104,6 @@ static void check_cpu_stalls(void)
/*
* Because preemptible RCU does not exist, it never has any callbacks
- * to check.
- */
-static void rcu_preempt_check_callbacks(void)
-{
-}
-
-/*
- * Because preemptible RCU does not exist, it never has any callbacks
* to remove.
*/
static void rcu_preempt_remove_callbacks(struct rcu_ctrlblk *rcp)
--
1.8.1.5
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH tip/core/rcu 04/13] rcu: Remove rcu_preempt_remove_callbacks()
2013-05-20 14:58 ` [PATCH tip/core/rcu 01/13] rcu: Remove TINY_PREEMPT_RCU Paul E. McKenney
2013-05-20 14:58 ` [PATCH tip/core/rcu 02/13] rcu: Remove show_tiny_preempt_stats() Paul E. McKenney
2013-05-20 14:58 ` [PATCH tip/core/rcu 03/13] rcu: Remove rcu_preempt_check_callbacks() Paul E. McKenney
@ 2013-05-20 14:58 ` Paul E. McKenney
2013-05-20 14:58 ` [PATCH tip/core/rcu 05/13] rcu: Remove rcu_preempt_process_callbacks() Paul E. McKenney
` (8 subsequent siblings)
11 siblings, 0 replies; 17+ messages in thread
From: Paul E. McKenney @ 2013-05-20 14:58 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, Valdis.Kletnieks, dhowells, edumazet, darren,
fweisbec, sbw, Paul E. McKenney
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
With the removal of CONFIG_TINY_PREEMPT_RCU, rcu_preempt_remove_callbacks()
is now an empty function. This commit therefore eliminates it by
inlining it.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
---
kernel/rcutiny.c | 1 -
kernel/rcutiny_plugin.h | 8 --------
2 files changed, 9 deletions(-)
diff --git a/kernel/rcutiny.c b/kernel/rcutiny.c
index 9178282..6f5a2a6 100644
--- a/kernel/rcutiny.c
+++ b/kernel/rcutiny.c
@@ -289,7 +289,6 @@ static void __rcu_process_callbacks(struct rcu_ctrlblk *rcp)
*rcp->donetail = NULL;
if (rcp->curtail == rcp->donetail)
rcp->curtail = &rcp->rcucblist;
- rcu_preempt_remove_callbacks(rcp);
rcp->donetail = &rcp->rcucblist;
local_irq_restore(flags);
diff --git a/kernel/rcutiny_plugin.h b/kernel/rcutiny_plugin.h
index 404b3a3..8b835b9 100644
--- a/kernel/rcutiny_plugin.h
+++ b/kernel/rcutiny_plugin.h
@@ -104,14 +104,6 @@ static void check_cpu_stalls(void)
/*
* Because preemptible RCU does not exist, it never has any callbacks
- * to remove.
- */
-static void rcu_preempt_remove_callbacks(struct rcu_ctrlblk *rcp)
-{
-}
-
-/*
- * Because preemptible RCU does not exist, it never has any callbacks
* to process.
*/
static void rcu_preempt_process_callbacks(void)
--
1.8.1.5
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH tip/core/rcu 05/13] rcu: Remove rcu_preempt_process_callbacks()
2013-05-20 14:58 ` [PATCH tip/core/rcu 01/13] rcu: Remove TINY_PREEMPT_RCU Paul E. McKenney
` (2 preceding siblings ...)
2013-05-20 14:58 ` [PATCH tip/core/rcu 04/13] rcu: Remove rcu_preempt_remove_callbacks() Paul E. McKenney
@ 2013-05-20 14:58 ` Paul E. McKenney
2013-05-20 14:58 ` [PATCH tip/core/rcu 06/13] rcu: Simplify RCU_TINY RCU callback invocation Paul E. McKenney
` (7 subsequent siblings)
11 siblings, 0 replies; 17+ messages in thread
From: Paul E. McKenney @ 2013-05-20 14:58 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, Valdis.Kletnieks, dhowells, edumazet, darren,
fweisbec, sbw, Paul E. McKenney
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
With the removal of CONFIG_TINY_PREEMPT_RCU, rcu_preempt_process_callbacks()
is now an empty function. This commit therefore eliminates it by
inlining it.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
---
kernel/rcutiny.c | 1 -
kernel/rcutiny_plugin.h | 8 --------
2 files changed, 9 deletions(-)
diff --git a/kernel/rcutiny.c b/kernel/rcutiny.c
index 6f5a2a6..7fc2339 100644
--- a/kernel/rcutiny.c
+++ b/kernel/rcutiny.c
@@ -314,7 +314,6 @@ static void rcu_process_callbacks(struct softirq_action *unused)
{
__rcu_process_callbacks(&rcu_sched_ctrlblk);
__rcu_process_callbacks(&rcu_bh_ctrlblk);
- rcu_preempt_process_callbacks();
}
/*
diff --git a/kernel/rcutiny_plugin.h b/kernel/rcutiny_plugin.h
index 8b835b9..bfe9924 100644
--- a/kernel/rcutiny_plugin.h
+++ b/kernel/rcutiny_plugin.h
@@ -102,14 +102,6 @@ static void check_cpu_stalls(void)
RCU_TRACE(check_cpu_stall_preempt());
}
-/*
- * Because preemptible RCU does not exist, it never has any callbacks
- * to process.
- */
-static void rcu_preempt_process_callbacks(void)
-{
-}
-
/* Hold off callback invocation until early_initcall() time. */
static int rcu_scheduler_fully_active __read_mostly;
--
1.8.1.5
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH tip/core/rcu 06/13] rcu: Simplify RCU_TINY RCU callback invocation
2013-05-20 14:58 ` [PATCH tip/core/rcu 01/13] rcu: Remove TINY_PREEMPT_RCU Paul E. McKenney
` (3 preceding siblings ...)
2013-05-20 14:58 ` [PATCH tip/core/rcu 05/13] rcu: Remove rcu_preempt_process_callbacks() Paul E. McKenney
@ 2013-05-20 14:58 ` Paul E. McKenney
2013-05-20 14:58 ` [PATCH tip/core/rcu 07/13] rcu: Remove check_cpu_stall_preempt() Paul E. McKenney
` (6 subsequent siblings)
11 siblings, 0 replies; 17+ messages in thread
From: Paul E. McKenney @ 2013-05-20 14:58 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, Valdis.Kletnieks, dhowells, edumazet, darren,
fweisbec, sbw, Paul E. McKenney
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
TINY_PREEMPT_RCU could use a kthread to handle RCU callback invocation,
which required an API to abstract kthread vs. softirq invocation.
Now that TINY_PREEMPT_RCU is no longer with us, this commit retires
this API in favor of direct use of the relevant softirq primitives.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
---
include/linux/rcupdate.h | 1 +
include/linux/rcutiny.h | 4 ----
include/linux/rcutree.h | 1 -
kernel/rcutiny.c | 14 +++++++++-----
kernel/rcutiny_plugin.h | 33 ---------------------------------
5 files changed, 10 insertions(+), 43 deletions(-)
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index b6dc04d..cfb02ee 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -216,6 +216,7 @@ static inline int rcu_preempt_depth(void)
#endif /* #else #ifdef CONFIG_PREEMPT_RCU */
/* Internal to kernel */
+extern void rcu_init(void);
extern void rcu_sched_qs(int cpu);
extern void rcu_bh_qs(int cpu);
extern void rcu_check_callbacks(int cpu, int user);
diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h
index d3c094f..e756251 100644
--- a/include/linux/rcutiny.h
+++ b/include/linux/rcutiny.h
@@ -27,10 +27,6 @@
#include <linux/cache.h>
-static inline void rcu_init(void)
-{
-}
-
static inline void rcu_barrier_bh(void)
{
wait_rcu_gp(call_rcu_bh);
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h
index 952b793..3f1aa8f 100644
--- a/include/linux/rcutree.h
+++ b/include/linux/rcutree.h
@@ -30,7 +30,6 @@
#ifndef __LINUX_RCUTREE_H
#define __LINUX_RCUTREE_H
-extern void rcu_init(void);
extern void rcu_note_context_switch(int cpu);
extern int rcu_needs_cpu(int cpu, unsigned long *delta_jiffies);
extern void rcu_cpu_stall_reset(void);
diff --git a/kernel/rcutiny.c b/kernel/rcutiny.c
index 7fc2339..4adc9e2 100644
--- a/kernel/rcutiny.c
+++ b/kernel/rcutiny.c
@@ -44,7 +44,6 @@
/* Forward declarations for rcutiny_plugin.h. */
struct rcu_ctrlblk;
-static void invoke_rcu_callbacks(void);
static void __rcu_process_callbacks(struct rcu_ctrlblk *rcp);
static void rcu_process_callbacks(struct softirq_action *unused);
static void __call_rcu(struct rcu_head *head,
@@ -227,7 +226,7 @@ void rcu_sched_qs(int cpu)
local_irq_save(flags);
if (rcu_qsctr_help(&rcu_sched_ctrlblk) +
rcu_qsctr_help(&rcu_bh_ctrlblk))
- invoke_rcu_callbacks();
+ raise_softirq(RCU_SOFTIRQ);
local_irq_restore(flags);
}
@@ -240,7 +239,7 @@ void rcu_bh_qs(int cpu)
local_irq_save(flags);
if (rcu_qsctr_help(&rcu_bh_ctrlblk))
- invoke_rcu_callbacks();
+ raise_softirq(RCU_SOFTIRQ);
local_irq_restore(flags);
}
@@ -277,7 +276,7 @@ static void __rcu_process_callbacks(struct rcu_ctrlblk *rcp)
ACCESS_ONCE(rcp->rcucblist),
need_resched(),
is_idle_task(current),
- rcu_is_callbacks_kthread()));
+ false));
return;
}
@@ -307,7 +306,7 @@ static void __rcu_process_callbacks(struct rcu_ctrlblk *rcp)
RCU_TRACE(rcu_trace_sub_qlen(rcp, cb_count));
RCU_TRACE(trace_rcu_batch_end(rcp->name, cb_count, 0, need_resched(),
is_idle_task(current),
- rcu_is_callbacks_kthread()));
+ false));
}
static void rcu_process_callbacks(struct softirq_action *unused)
@@ -379,3 +378,8 @@ void call_rcu_bh(struct rcu_head *head, void (*func)(struct rcu_head *rcu))
__call_rcu(head, func, &rcu_bh_ctrlblk);
}
EXPORT_SYMBOL_GPL(call_rcu_bh);
+
+void rcu_init(void)
+{
+ open_softirq(RCU_SOFTIRQ, rcu_process_callbacks);
+}
diff --git a/kernel/rcutiny_plugin.h b/kernel/rcutiny_plugin.h
index bfe9924..36fd83c 100644
--- a/kernel/rcutiny_plugin.h
+++ b/kernel/rcutiny_plugin.h
@@ -102,39 +102,6 @@ static void check_cpu_stalls(void)
RCU_TRACE(check_cpu_stall_preempt());
}
-/* Hold off callback invocation until early_initcall() time. */
-static int rcu_scheduler_fully_active __read_mostly;
-
-/*
- * Start up softirq processing of callbacks.
- */
-void invoke_rcu_callbacks(void)
-{
- if (rcu_scheduler_fully_active)
- raise_softirq(RCU_SOFTIRQ);
-}
-
-#ifdef CONFIG_RCU_TRACE
-
-/*
- * There is no callback kthread, so this thread is never it.
- */
-static bool rcu_is_callbacks_kthread(void)
-{
- return false;
-}
-
-#endif /* #ifdef CONFIG_RCU_TRACE */
-
-static int __init rcu_scheduler_really_started(void)
-{
- rcu_scheduler_fully_active = 1;
- open_softirq(RCU_SOFTIRQ, rcu_process_callbacks);
- raise_softirq(RCU_SOFTIRQ); /* Invoke any callbacks from early boot. */
- return 0;
-}
-early_initcall(rcu_scheduler_really_started);
-
#ifdef CONFIG_DEBUG_LOCK_ALLOC
#include <linux/kernel_stat.h>
--
1.8.1.5
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH tip/core/rcu 07/13] rcu: Remove check_cpu_stall_preempt()
2013-05-20 14:58 ` [PATCH tip/core/rcu 01/13] rcu: Remove TINY_PREEMPT_RCU Paul E. McKenney
` (4 preceding siblings ...)
2013-05-20 14:58 ` [PATCH tip/core/rcu 06/13] rcu: Simplify RCU_TINY RCU callback invocation Paul E. McKenney
@ 2013-05-20 14:58 ` Paul E. McKenney
2013-05-20 14:58 ` [PATCH tip/core/rcu 08/13] rcu: Remove the CONFIG_TINY_RCU ifdefs in rcutiny.h Paul E. McKenney
` (5 subsequent siblings)
11 siblings, 0 replies; 17+ messages in thread
From: Paul E. McKenney @ 2013-05-20 14:58 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, Valdis.Kletnieks, dhowells, edumazet, darren,
fweisbec, sbw, Paul E. McKenney
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
With the removal of CONFIG_TINY_PREEMPT_RCU, check_cpu_stall_preempt()
is now an empty function. This commit therefore eliminates it by
inlining it.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
---
kernel/rcutiny_plugin.h | 7 -------
1 file changed, 7 deletions(-)
diff --git a/kernel/rcutiny_plugin.h b/kernel/rcutiny_plugin.h
index 36fd83c..bac3a6e 100644
--- a/kernel/rcutiny_plugin.h
+++ b/kernel/rcutiny_plugin.h
@@ -82,8 +82,6 @@ static void check_cpu_stall(struct rcu_ctrlblk *rcp)
rcp->jiffies_stall = jiffies + rcu_jiffies_till_stall_check();
}
-static void check_cpu_stall_preempt(void);
-
#endif /* #ifdef CONFIG_RCU_TRACE */
static void reset_cpu_stall_ticks(struct rcu_ctrlblk *rcp)
@@ -99,7 +97,6 @@ static void check_cpu_stalls(void)
{
RCU_TRACE(check_cpu_stall(&rcu_bh_ctrlblk));
RCU_TRACE(check_cpu_stall(&rcu_sched_ctrlblk));
- RCU_TRACE(check_cpu_stall_preempt());
}
#ifdef CONFIG_DEBUG_LOCK_ALLOC
@@ -182,8 +179,4 @@ MODULE_AUTHOR("Paul E. McKenney");
MODULE_DESCRIPTION("Read-Copy Update tracing for tiny implementation");
MODULE_LICENSE("GPL");
-static void check_cpu_stall_preempt(void)
-{
-}
-
#endif /* #ifdef CONFIG_RCU_TRACE */
--
1.8.1.5
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH tip/core/rcu 08/13] rcu: Remove the CONFIG_TINY_RCU ifdefs in rcutiny.h
2013-05-20 14:58 ` [PATCH tip/core/rcu 01/13] rcu: Remove TINY_PREEMPT_RCU Paul E. McKenney
` (5 preceding siblings ...)
2013-05-20 14:58 ` [PATCH tip/core/rcu 07/13] rcu: Remove check_cpu_stall_preempt() Paul E. McKenney
@ 2013-05-20 14:58 ` Paul E. McKenney
2013-05-20 14:58 ` [PATCH tip/core/rcu 09/13] rcu: Remove rcu_preempt_note_context_switch() Paul E. McKenney
` (4 subsequent siblings)
11 siblings, 0 replies; 17+ messages in thread
From: Paul E. McKenney @ 2013-05-20 14:58 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, Valdis.Kletnieks, dhowells, edumazet, darren,
fweisbec, sbw, Paul E. McKenney
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Now that CONFIG_TINY_PREEMPT_RCU is no more, this commit removes
the CONFIG_TINY_RCU ifdefs from include/linux/rcutiny.h in favor of
unconditionally compiling the CONFIG_TINY_RCU legs of those ifdefs.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
[ paulmck: Moved removal of #else to "Remove TINY_PREEMPT_RCU" as
suggested by Josh Triplett. ]
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
---
include/linux/rcutiny.h | 8 --------
1 file changed, 8 deletions(-)
diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h
index e756251..07b5aff 100644
--- a/include/linux/rcutiny.h
+++ b/include/linux/rcutiny.h
@@ -37,8 +37,6 @@ static inline void rcu_barrier_sched(void)
wait_rcu_gp(call_rcu_sched);
}
-#ifdef CONFIG_TINY_RCU
-
static inline void synchronize_rcu_expedited(void)
{
synchronize_sched(); /* Only one CPU, so pretty fast anyway!!! */
@@ -49,8 +47,6 @@ static inline void rcu_barrier(void)
rcu_barrier_sched(); /* Only one CPU, so only one list of callbacks! */
}
-#endif /* #ifdef CONFIG_TINY_RCU */
-
static inline void synchronize_rcu_bh(void)
{
synchronize_sched();
@@ -72,8 +68,6 @@ static inline void kfree_call_rcu(struct rcu_head *head,
call_rcu(head, func);
}
-#ifdef CONFIG_TINY_RCU
-
static inline void rcu_preempt_note_context_switch(void)
{
}
@@ -84,8 +78,6 @@ static inline int rcu_needs_cpu(int cpu, unsigned long *delta_jiffies)
return 0;
}
-#endif /* #ifdef CONFIG_TINY_RCU */
-
static inline void rcu_note_context_switch(int cpu)
{
rcu_sched_qs(cpu);
--
1.8.1.5
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH tip/core/rcu 09/13] rcu: Remove rcu_preempt_note_context_switch()
2013-05-20 14:58 ` [PATCH tip/core/rcu 01/13] rcu: Remove TINY_PREEMPT_RCU Paul E. McKenney
` (6 preceding siblings ...)
2013-05-20 14:58 ` [PATCH tip/core/rcu 08/13] rcu: Remove the CONFIG_TINY_RCU ifdefs in rcutiny.h Paul E. McKenney
@ 2013-05-20 14:58 ` Paul E. McKenney
2013-05-20 14:58 ` [PATCH tip/core/rcu 10/13] rcu: Consolidate rcutiny_plugin.h ifdefs Paul E. McKenney
` (3 subsequent siblings)
11 siblings, 0 replies; 17+ messages in thread
From: Paul E. McKenney @ 2013-05-20 14:58 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, Valdis.Kletnieks, dhowells, edumazet, darren,
fweisbec, sbw, Paul E. McKenney
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
With the removal of CONFIG_TINY_PREEMPT_RCU, rcu_preempt_note_context_switch()
is now an empty function. This commit therefore eliminates it by inlining it.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
---
include/linux/rcutiny.h | 5 -----
1 file changed, 5 deletions(-)
diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h
index 07b5aff..51230b6 100644
--- a/include/linux/rcutiny.h
+++ b/include/linux/rcutiny.h
@@ -68,10 +68,6 @@ static inline void kfree_call_rcu(struct rcu_head *head,
call_rcu(head, func);
}
-static inline void rcu_preempt_note_context_switch(void)
-{
-}
-
static inline int rcu_needs_cpu(int cpu, unsigned long *delta_jiffies)
{
*delta_jiffies = ULONG_MAX;
@@ -81,7 +77,6 @@ static inline int rcu_needs_cpu(int cpu, unsigned long *delta_jiffies)
static inline void rcu_note_context_switch(int cpu)
{
rcu_sched_qs(cpu);
- rcu_preempt_note_context_switch();
}
/*
--
1.8.1.5
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH tip/core/rcu 10/13] rcu: Consolidate rcutiny_plugin.h ifdefs
2013-05-20 14:58 ` [PATCH tip/core/rcu 01/13] rcu: Remove TINY_PREEMPT_RCU Paul E. McKenney
` (7 preceding siblings ...)
2013-05-20 14:58 ` [PATCH tip/core/rcu 09/13] rcu: Remove rcu_preempt_note_context_switch() Paul E. McKenney
@ 2013-05-20 14:58 ` Paul E. McKenney
2013-05-20 14:58 ` [PATCH tip/core/rcu 11/13] rcu: Remove TINY_PREEMPT_RCU tracing documentation Paul E. McKenney
` (2 subsequent siblings)
11 siblings, 0 replies; 17+ messages in thread
From: Paul E. McKenney @ 2013-05-20 14:58 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, Valdis.Kletnieks, dhowells, edumazet, darren,
fweisbec, sbw, Paul E. McKenney
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
This commit rearranges code in order to allow ifdefs to be consolidated
in kernel/rcutiny_plugin.h, simplifying the code.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
---
kernel/rcutiny_plugin.h | 86 +++++++++++++++++++++++--------------------------
1 file changed, 40 insertions(+), 46 deletions(-)
diff --git a/kernel/rcutiny_plugin.h b/kernel/rcutiny_plugin.h
index bac3a6e..65ef180 100644
--- a/kernel/rcutiny_plugin.h
+++ b/kernel/rcutiny_plugin.h
@@ -53,54 +53,10 @@ static struct rcu_ctrlblk rcu_bh_ctrlblk = {
};
#ifdef CONFIG_DEBUG_LOCK_ALLOC
+#include <linux/kernel_stat.h>
+
int rcu_scheduler_active __read_mostly;
EXPORT_SYMBOL_GPL(rcu_scheduler_active);
-#endif /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */
-
-#ifdef CONFIG_RCU_TRACE
-
-static void check_cpu_stall(struct rcu_ctrlblk *rcp)
-{
- unsigned long j;
- unsigned long js;
-
- if (rcu_cpu_stall_suppress)
- return;
- rcp->ticks_this_gp++;
- j = jiffies;
- js = rcp->jiffies_stall;
- if (*rcp->curtail && ULONG_CMP_GE(j, js)) {
- pr_err("INFO: %s stall on CPU (%lu ticks this GP) idle=%llx (t=%lu jiffies q=%ld)\n",
- rcp->name, rcp->ticks_this_gp, rcu_dynticks_nesting,
- jiffies - rcp->gp_start, rcp->qlen);
- dump_stack();
- }
- if (*rcp->curtail && ULONG_CMP_GE(j, js))
- rcp->jiffies_stall = jiffies +
- 3 * rcu_jiffies_till_stall_check() + 3;
- else if (ULONG_CMP_GE(j, js))
- rcp->jiffies_stall = jiffies + rcu_jiffies_till_stall_check();
-}
-
-#endif /* #ifdef CONFIG_RCU_TRACE */
-
-static void reset_cpu_stall_ticks(struct rcu_ctrlblk *rcp)
-{
-#ifdef CONFIG_RCU_TRACE
- rcp->ticks_this_gp = 0;
- rcp->gp_start = jiffies;
- rcp->jiffies_stall = jiffies + rcu_jiffies_till_stall_check();
-#endif /* #ifdef CONFIG_RCU_TRACE */
-}
-
-static void check_cpu_stalls(void)
-{
- RCU_TRACE(check_cpu_stall(&rcu_bh_ctrlblk));
- RCU_TRACE(check_cpu_stall(&rcu_sched_ctrlblk));
-}
-
-#ifdef CONFIG_DEBUG_LOCK_ALLOC
-#include <linux/kernel_stat.h>
/*
* During boot, we forgive RCU lockdep issues. After this function is
@@ -179,4 +135,42 @@ MODULE_AUTHOR("Paul E. McKenney");
MODULE_DESCRIPTION("Read-Copy Update tracing for tiny implementation");
MODULE_LICENSE("GPL");
+static void check_cpu_stall(struct rcu_ctrlblk *rcp)
+{
+ unsigned long j;
+ unsigned long js;
+
+ if (rcu_cpu_stall_suppress)
+ return;
+ rcp->ticks_this_gp++;
+ j = jiffies;
+ js = rcp->jiffies_stall;
+ if (*rcp->curtail && ULONG_CMP_GE(j, js)) {
+ pr_err("INFO: %s stall on CPU (%lu ticks this GP) idle=%llx (t=%lu jiffies q=%ld)\n",
+ rcp->name, rcp->ticks_this_gp, rcu_dynticks_nesting,
+ jiffies - rcp->gp_start, rcp->qlen);
+ dump_stack();
+ }
+ if (*rcp->curtail && ULONG_CMP_GE(j, js))
+ rcp->jiffies_stall = jiffies +
+ 3 * rcu_jiffies_till_stall_check() + 3;
+ else if (ULONG_CMP_GE(j, js))
+ rcp->jiffies_stall = jiffies + rcu_jiffies_till_stall_check();
+}
+
#endif /* #ifdef CONFIG_RCU_TRACE */
+
+static void reset_cpu_stall_ticks(struct rcu_ctrlblk *rcp)
+{
+#ifdef CONFIG_RCU_TRACE
+ rcp->ticks_this_gp = 0;
+ rcp->gp_start = jiffies;
+ rcp->jiffies_stall = jiffies + rcu_jiffies_till_stall_check();
+#endif /* #ifdef CONFIG_RCU_TRACE */
+}
+
+static void check_cpu_stalls(void)
+{
+ RCU_TRACE(check_cpu_stall(&rcu_bh_ctrlblk));
+ RCU_TRACE(check_cpu_stall(&rcu_sched_ctrlblk));
+}
--
1.8.1.5
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH tip/core/rcu 11/13] rcu: Remove TINY_PREEMPT_RCU tracing documentation
2013-05-20 14:58 ` [PATCH tip/core/rcu 01/13] rcu: Remove TINY_PREEMPT_RCU Paul E. McKenney
` (8 preceding siblings ...)
2013-05-20 14:58 ` [PATCH tip/core/rcu 10/13] rcu: Consolidate rcutiny_plugin.h ifdefs Paul E. McKenney
@ 2013-05-20 14:58 ` Paul E. McKenney
2013-05-20 14:58 ` [PATCH tip/core/rcu 12/13] rcu: Shrink TINY_RCU by moving exit_rcu() Paul E. McKenney
2013-05-20 14:58 ` [PATCH tip/core/rcu 13/13] rcu: Shrink TINY_RCU by reworking CPU-stall ifdefs Paul E. McKenney
11 siblings, 0 replies; 17+ messages in thread
From: Paul E. McKenney @ 2013-05-20 14:58 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, Valdis.Kletnieks, dhowells, edumazet, darren,
fweisbec, sbw, Paul E. McKenney
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Because TINY_PREEMPT_RCU is no more, this commit removes its tracing
formats from the documentation.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
---
Documentation/RCU/trace.txt | 100 ++------------------------------------------
1 file changed, 4 insertions(+), 96 deletions(-)
diff --git a/Documentation/RCU/trace.txt b/Documentation/RCU/trace.txt
index c776968..f3778f8 100644
--- a/Documentation/RCU/trace.txt
+++ b/Documentation/RCU/trace.txt
@@ -530,113 +530,21 @@ o "nos" counts the number of times we balked for other
reasons, e.g., the grace period ended first.
-CONFIG_TINY_RCU and CONFIG_TINY_PREEMPT_RCU debugfs Files and Formats
+CONFIG_TINY_RCU debugfs Files and Formats
These implementations of RCU provides a single debugfs file under the
top-level directory RCU, namely rcu/rcudata, which displays fields in
-rcu_bh_ctrlblk, rcu_sched_ctrlblk and, for CONFIG_TINY_PREEMPT_RCU,
-rcu_preempt_ctrlblk.
+rcu_bh_ctrlblk and rcu_sched_ctrlblk.
The output of "cat rcu/rcudata" is as follows:
-rcu_preempt: qlen=24 gp=1097669 g197/p197/c197 tasks=...
- ttb=. btg=no ntb=184 neb=0 nnb=183 j=01f7 bt=0274
- normal balk: nt=1097669 gt=0 bt=371 b=0 ny=25073378 nos=0
- exp balk: bt=0 nos=0
rcu_sched: qlen: 0
rcu_bh: qlen: 0
-This is split into rcu_preempt, rcu_sched, and rcu_bh sections, with the
-rcu_preempt section appearing only in CONFIG_TINY_PREEMPT_RCU builds.
-The last three lines of the rcu_preempt section appear only in
-CONFIG_RCU_BOOST kernel builds. The fields are as follows:
+This is split into rcu_sched and rcu_bh sections. The field is as
+follows:
o "qlen" is the number of RCU callbacks currently waiting either
for an RCU grace period or waiting to be invoked. This is the
only field present for rcu_sched and rcu_bh, due to the
short-circuiting of grace period in those two cases.
-
-o "gp" is the number of grace periods that have completed.
-
-o "g197/p197/c197" displays the grace-period state, with the
- "g" number being the number of grace periods that have started
- (mod 256), the "p" number being the number of grace periods
- that the CPU has responded to (also mod 256), and the "c"
- number being the number of grace periods that have completed
- (once again mode 256).
-
- Why have both "gp" and "g"? Because the data flowing into
- "gp" is only present in a CONFIG_RCU_TRACE kernel.
-
-o "tasks" is a set of bits. The first bit is "T" if there are
- currently tasks that have recently blocked within an RCU
- read-side critical section, the second bit is "N" if any of the
- aforementioned tasks are blocking the current RCU grace period,
- and the third bit is "E" if any of the aforementioned tasks are
- blocking the current expedited grace period. Each bit is "."
- if the corresponding condition does not hold.
-
-o "ttb" is a single bit. It is "B" if any of the blocked tasks
- need to be priority boosted and "." otherwise.
-
-o "btg" indicates whether boosting has been carried out during
- the current grace period, with "exp" indicating that boosting
- is in progress for an expedited grace period, "no" indicating
- that boosting has not yet started for a normal grace period,
- "begun" indicating that boosting has bebug for a normal grace
- period, and "done" indicating that boosting has completed for
- a normal grace period.
-
-o "ntb" is the total number of tasks subjected to RCU priority boosting
- periods since boot.
-
-o "neb" is the number of expedited grace periods that have had
- to resort to RCU priority boosting since boot.
-
-o "nnb" is the number of normal grace periods that have had
- to resort to RCU priority boosting since boot.
-
-o "j" is the low-order 16 bits of the jiffies counter in hexadecimal.
-
-o "bt" is the low-order 16 bits of the value that the jiffies counter
- will have at the next time that boosting is scheduled to begin.
-
-o In the line beginning with "normal balk", the fields are as follows:
-
- o "nt" is the number of times that the system balked from
- boosting because there were no blocked tasks to boost.
- Note that the system will balk from boosting even if the
- grace period is overdue when the currently running task
- is looping within an RCU read-side critical section.
- There is no point in boosting in this case, because
- boosting a running task won't make it run any faster.
-
- o "gt" is the number of times that the system balked
- from boosting because, although there were blocked tasks,
- none of them were preventing the current grace period
- from completing.
-
- o "bt" is the number of times that the system balked
- from boosting because boosting was already in progress.
-
- o "b" is the number of times that the system balked from
- boosting because boosting had already completed for
- the grace period in question.
-
- o "ny" is the number of times that the system balked from
- boosting because it was not yet time to start boosting
- the grace period in question.
-
- o "nos" is the number of times that the system balked from
- boosting for inexplicable ("not otherwise specified")
- reasons. This can actually happen due to races involving
- increments of the jiffies counter.
-
-o In the line beginning with "exp balk", the fields are as follows:
-
- o "bt" is the number of times that the system balked from
- boosting because there were no blocked tasks to boost.
-
- o "nos" is the number of times that the system balked from
- boosting for inexplicable ("not otherwise specified")
- reasons.
--
1.8.1.5
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH tip/core/rcu 12/13] rcu: Shrink TINY_RCU by moving exit_rcu()
2013-05-20 14:58 ` [PATCH tip/core/rcu 01/13] rcu: Remove TINY_PREEMPT_RCU Paul E. McKenney
` (9 preceding siblings ...)
2013-05-20 14:58 ` [PATCH tip/core/rcu 11/13] rcu: Remove TINY_PREEMPT_RCU tracing documentation Paul E. McKenney
@ 2013-05-20 14:58 ` Paul E. McKenney
2013-05-20 14:58 ` [PATCH tip/core/rcu 13/13] rcu: Shrink TINY_RCU by reworking CPU-stall ifdefs Paul E. McKenney
11 siblings, 0 replies; 17+ messages in thread
From: Paul E. McKenney @ 2013-05-20 14:58 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, Valdis.Kletnieks, dhowells, edumazet, darren,
fweisbec, sbw, Paul E. McKenney
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Now that TINY_PREEMPT_RCU is no more, exit_rcu() is always an empty
function. But if TINY_RCU is going to have an empty function, it should
be in include/linux/rcutiny.h, where it does not bloat the kernel.
This commit therefore moves exit_rcu() out of kernel/rcupdate.c to
kernel/rcutree_plugin.h, and places a static inline empty function in
include/linux/rcutiny.h in order to shrink TINY_RCU a bit.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
---
include/linux/rcupdate.h | 2 --
include/linux/rcutiny.h | 4 ++++
include/linux/rcutree.h | 2 ++
kernel/rcupdate.c | 26 +-------------------------
kernel/rcutree_plugin.h | 26 ++++++++++++++++++++++++++
5 files changed, 33 insertions(+), 27 deletions(-)
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index cfb02ee..9275dc2 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -240,8 +240,6 @@ static inline void rcu_user_hooks_switch(struct task_struct *prev,
struct task_struct *next) { }
#endif /* CONFIG_RCU_USER_QS */
-extern void exit_rcu(void);
-
/**
* RCU_NONIDLE - Indicate idle-loop code that needs RCU readers
* @a: Code that RCU needs to pay attention to.
diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h
index 51230b6..e31005e 100644
--- a/include/linux/rcutiny.h
+++ b/include/linux/rcutiny.h
@@ -119,6 +119,10 @@ static inline void rcu_cpu_stall_reset(void)
{
}
+static inline void exit_rcu(void)
+{
+}
+
#ifdef CONFIG_DEBUG_LOCK_ALLOC
extern int rcu_scheduler_active __read_mostly;
extern void rcu_scheduler_starting(void);
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h
index 3f1aa8f..226169d 100644
--- a/include/linux/rcutree.h
+++ b/include/linux/rcutree.h
@@ -85,6 +85,8 @@ extern void rcu_force_quiescent_state(void);
extern void rcu_bh_force_quiescent_state(void);
extern void rcu_sched_force_quiescent_state(void);
+extern void exit_rcu(void);
+
extern void rcu_scheduler_starting(void);
extern int rcu_scheduler_active __read_mostly;
diff --git a/kernel/rcupdate.c b/kernel/rcupdate.c
index 48ab703..0be1fa2 100644
--- a/kernel/rcupdate.c
+++ b/kernel/rcupdate.c
@@ -104,31 +104,7 @@ void __rcu_read_unlock(void)
}
EXPORT_SYMBOL_GPL(__rcu_read_unlock);
-/*
- * Check for a task exiting while in a preemptible-RCU read-side
- * critical section, clean up if so. No need to issue warnings,
- * as debug_check_no_locks_held() already does this if lockdep
- * is enabled.
- */
-void exit_rcu(void)
-{
- struct task_struct *t = current;
-
- if (likely(list_empty(¤t->rcu_node_entry)))
- return;
- t->rcu_read_lock_nesting = 1;
- barrier();
- t->rcu_read_unlock_special = RCU_READ_UNLOCK_BLOCKED;
- __rcu_read_unlock();
-}
-
-#else /* #ifdef CONFIG_PREEMPT_RCU */
-
-void exit_rcu(void)
-{
-}
-
-#endif /* #else #ifdef CONFIG_PREEMPT_RCU */
+#endif /* #ifdef CONFIG_PREEMPT_RCU */
#ifdef CONFIG_DEBUG_LOCK_ALLOC
static struct lock_class_key rcu_lock_key;
diff --git a/kernel/rcutree_plugin.h b/kernel/rcutree_plugin.h
index 207844e..de701bb 100644
--- a/kernel/rcutree_plugin.h
+++ b/kernel/rcutree_plugin.h
@@ -932,6 +932,24 @@ static void __init __rcu_init_preempt(void)
rcu_init_one(&rcu_preempt_state, &rcu_preempt_data);
}
+/*
+ * Check for a task exiting while in a preemptible-RCU read-side
+ * critical section, clean up if so. No need to issue warnings,
+ * as debug_check_no_locks_held() already does this if lockdep
+ * is enabled.
+ */
+void exit_rcu(void)
+{
+ struct task_struct *t = current;
+
+ if (likely(list_empty(¤t->rcu_node_entry)))
+ return;
+ t->rcu_read_lock_nesting = 1;
+ barrier();
+ t->rcu_read_unlock_special = RCU_READ_UNLOCK_BLOCKED;
+ __rcu_read_unlock();
+}
+
#else /* #ifdef CONFIG_TREE_PREEMPT_RCU */
static struct rcu_state *rcu_state = &rcu_sched_state;
@@ -1100,6 +1118,14 @@ static void __init __rcu_init_preempt(void)
{
}
+/*
+ * Because preemptible RCU does not exist, tasks cannot possibly exit
+ * while in preemptible RCU read-side critical sections.
+ */
+void exit_rcu(void)
+{
+}
+
#endif /* #else #ifdef CONFIG_TREE_PREEMPT_RCU */
#ifdef CONFIG_RCU_BOOST
--
1.8.1.5
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH tip/core/rcu 13/13] rcu: Shrink TINY_RCU by reworking CPU-stall ifdefs
2013-05-20 14:58 ` [PATCH tip/core/rcu 01/13] rcu: Remove TINY_PREEMPT_RCU Paul E. McKenney
` (10 preceding siblings ...)
2013-05-20 14:58 ` [PATCH tip/core/rcu 12/13] rcu: Shrink TINY_RCU by moving exit_rcu() Paul E. McKenney
@ 2013-05-20 14:58 ` Paul E. McKenney
2013-05-21 17:31 ` Josh Triplett
11 siblings, 1 reply; 17+ messages in thread
From: Paul E. McKenney @ 2013-05-20 14:58 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, Valdis.Kletnieks, dhowells, edumazet, darren,
fweisbec, sbw, Paul E. McKenney
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
TINY_RCU's reset_cpu_stall_ticks() and check_cpu_stalls() functions
are defined unconditionally, and are empty functions if CONFIG_RCU_TRACE
is disabled (which in turns disables detection of RCU CPU stalls).
These empty functions can add a bit of bloat to TINY_RCU, so this
commit reworks the ifdefs so that these functions are defined only
if they actually do something.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
kernel/rcutiny.c | 4 ++--
kernel/rcutiny_plugin.h | 6 ++----
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/kernel/rcutiny.c b/kernel/rcutiny.c
index 4adc9e2..aa34411 100644
--- a/kernel/rcutiny.c
+++ b/kernel/rcutiny.c
@@ -204,7 +204,7 @@ static int rcu_is_cpu_rrupt_from_idle(void)
*/
static int rcu_qsctr_help(struct rcu_ctrlblk *rcp)
{
- reset_cpu_stall_ticks(rcp);
+ RCU_TRACE(reset_cpu_stall_ticks(rcp));
if (rcp->rcucblist != NULL &&
rcp->donetail != rcp->curtail) {
rcp->donetail = rcp->curtail;
@@ -251,7 +251,7 @@ void rcu_bh_qs(int cpu)
*/
void rcu_check_callbacks(int cpu, int user)
{
- check_cpu_stalls();
+ RCU_TRACE(check_cpu_stalls());
if (user || rcu_is_cpu_rrupt_from_idle())
rcu_sched_qs(cpu);
else if (!in_softirq())
diff --git a/kernel/rcutiny_plugin.h b/kernel/rcutiny_plugin.h
index 65ef180..0cd385a 100644
--- a/kernel/rcutiny_plugin.h
+++ b/kernel/rcutiny_plugin.h
@@ -158,15 +158,11 @@ static void check_cpu_stall(struct rcu_ctrlblk *rcp)
rcp->jiffies_stall = jiffies + rcu_jiffies_till_stall_check();
}
-#endif /* #ifdef CONFIG_RCU_TRACE */
-
static void reset_cpu_stall_ticks(struct rcu_ctrlblk *rcp)
{
-#ifdef CONFIG_RCU_TRACE
rcp->ticks_this_gp = 0;
rcp->gp_start = jiffies;
rcp->jiffies_stall = jiffies + rcu_jiffies_till_stall_check();
-#endif /* #ifdef CONFIG_RCU_TRACE */
}
static void check_cpu_stalls(void)
@@ -174,3 +170,5 @@ static void check_cpu_stalls(void)
RCU_TRACE(check_cpu_stall(&rcu_bh_ctrlblk));
RCU_TRACE(check_cpu_stall(&rcu_sched_ctrlblk));
}
+
+#endif /* #ifdef CONFIG_RCU_TRACE */
--
1.8.1.5
^ permalink raw reply related [flat|nested] 17+ messages in thread* Re: [PATCH tip/core/rcu 13/13] rcu: Shrink TINY_RCU by reworking CPU-stall ifdefs
2013-05-20 14:58 ` [PATCH tip/core/rcu 13/13] rcu: Shrink TINY_RCU by reworking CPU-stall ifdefs Paul E. McKenney
@ 2013-05-21 17:31 ` Josh Triplett
2013-05-21 21:09 ` Paul E. McKenney
0 siblings, 1 reply; 17+ messages in thread
From: Josh Triplett @ 2013-05-21 17:31 UTC (permalink / raw)
To: Paul E. McKenney
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, Valdis.Kletnieks, dhowells, edumazet,
darren, fweisbec, sbw
On Mon, May 20, 2013 at 07:58:20AM -0700, Paul E. McKenney wrote:
> From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
>
> TINY_RCU's reset_cpu_stall_ticks() and check_cpu_stalls() functions
> are defined unconditionally, and are empty functions if CONFIG_RCU_TRACE
> is disabled (which in turns disables detection of RCU CPU stalls).
> These empty functions can add a bit of bloat to TINY_RCU, so this
> commit reworks the ifdefs so that these functions are defined only
> if they actually do something.
>
> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Strange. Both of these functions are static, and called in only one
place, so shouldn't the compiler inline them (and thus throw them away
completely when empty)? Why does it not do so?
- Josh Triplett
> ---
> kernel/rcutiny.c | 4 ++--
> kernel/rcutiny_plugin.h | 6 ++----
> 2 files changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/kernel/rcutiny.c b/kernel/rcutiny.c
> index 4adc9e2..aa34411 100644
> --- a/kernel/rcutiny.c
> +++ b/kernel/rcutiny.c
> @@ -204,7 +204,7 @@ static int rcu_is_cpu_rrupt_from_idle(void)
> */
> static int rcu_qsctr_help(struct rcu_ctrlblk *rcp)
> {
> - reset_cpu_stall_ticks(rcp);
> + RCU_TRACE(reset_cpu_stall_ticks(rcp));
> if (rcp->rcucblist != NULL &&
> rcp->donetail != rcp->curtail) {
> rcp->donetail = rcp->curtail;
> @@ -251,7 +251,7 @@ void rcu_bh_qs(int cpu)
> */
> void rcu_check_callbacks(int cpu, int user)
> {
> - check_cpu_stalls();
> + RCU_TRACE(check_cpu_stalls());
> if (user || rcu_is_cpu_rrupt_from_idle())
> rcu_sched_qs(cpu);
> else if (!in_softirq())
> diff --git a/kernel/rcutiny_plugin.h b/kernel/rcutiny_plugin.h
> index 65ef180..0cd385a 100644
> --- a/kernel/rcutiny_plugin.h
> +++ b/kernel/rcutiny_plugin.h
> @@ -158,15 +158,11 @@ static void check_cpu_stall(struct rcu_ctrlblk *rcp)
> rcp->jiffies_stall = jiffies + rcu_jiffies_till_stall_check();
> }
>
> -#endif /* #ifdef CONFIG_RCU_TRACE */
> -
> static void reset_cpu_stall_ticks(struct rcu_ctrlblk *rcp)
> {
> -#ifdef CONFIG_RCU_TRACE
> rcp->ticks_this_gp = 0;
> rcp->gp_start = jiffies;
> rcp->jiffies_stall = jiffies + rcu_jiffies_till_stall_check();
> -#endif /* #ifdef CONFIG_RCU_TRACE */
> }
>
> static void check_cpu_stalls(void)
> @@ -174,3 +170,5 @@ static void check_cpu_stalls(void)
> RCU_TRACE(check_cpu_stall(&rcu_bh_ctrlblk));
> RCU_TRACE(check_cpu_stall(&rcu_sched_ctrlblk));
> }
> +
> +#endif /* #ifdef CONFIG_RCU_TRACE */
> --
> 1.8.1.5
>
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: [PATCH tip/core/rcu 13/13] rcu: Shrink TINY_RCU by reworking CPU-stall ifdefs
2013-05-21 17:31 ` Josh Triplett
@ 2013-05-21 21:09 ` Paul E. McKenney
2013-05-21 21:48 ` Josh Triplett
0 siblings, 1 reply; 17+ messages in thread
From: Paul E. McKenney @ 2013-05-21 21:09 UTC (permalink / raw)
To: Josh Triplett
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, Valdis.Kletnieks, dhowells, edumazet,
darren, fweisbec, sbw
On Tue, May 21, 2013 at 10:31:41AM -0700, Josh Triplett wrote:
> On Mon, May 20, 2013 at 07:58:20AM -0700, Paul E. McKenney wrote:
> > From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> >
> > TINY_RCU's reset_cpu_stall_ticks() and check_cpu_stalls() functions
> > are defined unconditionally, and are empty functions if CONFIG_RCU_TRACE
> > is disabled (which in turns disables detection of RCU CPU stalls).
> > These empty functions can add a bit of bloat to TINY_RCU, so this
> > commit reworks the ifdefs so that these functions are defined only
> > if they actually do something.
> >
> > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
>
> Strange. Both of these functions are static, and called in only one
> place, so shouldn't the compiler inline them (and thus throw them away
> completely when empty)? Why does it not do so?
Good point for most architectures. But given Tiny RCU's purpose, it
should allow for stupid compilers. And I do need to fix the commit
message to call out the other benefit, namely saving a couple of
lines of source code.
Thanx, Paul
> - Josh Triplett
>
> > ---
> > kernel/rcutiny.c | 4 ++--
> > kernel/rcutiny_plugin.h | 6 ++----
> > 2 files changed, 4 insertions(+), 6 deletions(-)
> >
> > diff --git a/kernel/rcutiny.c b/kernel/rcutiny.c
> > index 4adc9e2..aa34411 100644
> > --- a/kernel/rcutiny.c
> > +++ b/kernel/rcutiny.c
> > @@ -204,7 +204,7 @@ static int rcu_is_cpu_rrupt_from_idle(void)
> > */
> > static int rcu_qsctr_help(struct rcu_ctrlblk *rcp)
> > {
> > - reset_cpu_stall_ticks(rcp);
> > + RCU_TRACE(reset_cpu_stall_ticks(rcp));
> > if (rcp->rcucblist != NULL &&
> > rcp->donetail != rcp->curtail) {
> > rcp->donetail = rcp->curtail;
> > @@ -251,7 +251,7 @@ void rcu_bh_qs(int cpu)
> > */
> > void rcu_check_callbacks(int cpu, int user)
> > {
> > - check_cpu_stalls();
> > + RCU_TRACE(check_cpu_stalls());
> > if (user || rcu_is_cpu_rrupt_from_idle())
> > rcu_sched_qs(cpu);
> > else if (!in_softirq())
> > diff --git a/kernel/rcutiny_plugin.h b/kernel/rcutiny_plugin.h
> > index 65ef180..0cd385a 100644
> > --- a/kernel/rcutiny_plugin.h
> > +++ b/kernel/rcutiny_plugin.h
> > @@ -158,15 +158,11 @@ static void check_cpu_stall(struct rcu_ctrlblk *rcp)
> > rcp->jiffies_stall = jiffies + rcu_jiffies_till_stall_check();
> > }
> >
> > -#endif /* #ifdef CONFIG_RCU_TRACE */
> > -
> > static void reset_cpu_stall_ticks(struct rcu_ctrlblk *rcp)
> > {
> > -#ifdef CONFIG_RCU_TRACE
> > rcp->ticks_this_gp = 0;
> > rcp->gp_start = jiffies;
> > rcp->jiffies_stall = jiffies + rcu_jiffies_till_stall_check();
> > -#endif /* #ifdef CONFIG_RCU_TRACE */
> > }
> >
> > static void check_cpu_stalls(void)
> > @@ -174,3 +170,5 @@ static void check_cpu_stalls(void)
> > RCU_TRACE(check_cpu_stall(&rcu_bh_ctrlblk));
> > RCU_TRACE(check_cpu_stall(&rcu_sched_ctrlblk));
> > }
> > +
> > +#endif /* #ifdef CONFIG_RCU_TRACE */
> > --
> > 1.8.1.5
> >
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: [PATCH tip/core/rcu 13/13] rcu: Shrink TINY_RCU by reworking CPU-stall ifdefs
2013-05-21 21:09 ` Paul E. McKenney
@ 2013-05-21 21:48 ` Josh Triplett
0 siblings, 0 replies; 17+ messages in thread
From: Josh Triplett @ 2013-05-21 21:48 UTC (permalink / raw)
To: Paul E. McKenney
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, Valdis.Kletnieks, dhowells, edumazet,
darren, fweisbec, sbw
On Tue, May 21, 2013 at 02:09:57PM -0700, Paul E. McKenney wrote:
> On Tue, May 21, 2013 at 10:31:41AM -0700, Josh Triplett wrote:
> > On Mon, May 20, 2013 at 07:58:20AM -0700, Paul E. McKenney wrote:
> > > From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> > >
> > > TINY_RCU's reset_cpu_stall_ticks() and check_cpu_stalls() functions
> > > are defined unconditionally, and are empty functions if CONFIG_RCU_TRACE
> > > is disabled (which in turns disables detection of RCU CPU stalls).
> > > These empty functions can add a bit of bloat to TINY_RCU, so this
> > > commit reworks the ifdefs so that these functions are defined only
> > > if they actually do something.
> > >
> > > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> >
> > Strange. Both of these functions are static, and called in only one
> > place, so shouldn't the compiler inline them (and thus throw them away
> > completely when empty)? Why does it not do so?
>
> Good point for most architectures. But given Tiny RCU's purpose, it
> should allow for stupid compilers. And I do need to fix the commit
> message to call out the other benefit, namely saving a couple of
> lines of source code.
Regarding function inlining, at least, GCC is usually equally stupid on
all architectures. I'd be quite surprised if any architecture actually
emits code for these functions. You could also try changing them to
"static inline", in which case GCC should *definitely* never emit code
for them when empty.
- Josh Triplett
> Thanx, Paul
>
> > - Josh Triplett
> >
> > > ---
> > > kernel/rcutiny.c | 4 ++--
> > > kernel/rcutiny_plugin.h | 6 ++----
> > > 2 files changed, 4 insertions(+), 6 deletions(-)
> > >
> > > diff --git a/kernel/rcutiny.c b/kernel/rcutiny.c
> > > index 4adc9e2..aa34411 100644
> > > --- a/kernel/rcutiny.c
> > > +++ b/kernel/rcutiny.c
> > > @@ -204,7 +204,7 @@ static int rcu_is_cpu_rrupt_from_idle(void)
> > > */
> > > static int rcu_qsctr_help(struct rcu_ctrlblk *rcp)
> > > {
> > > - reset_cpu_stall_ticks(rcp);
> > > + RCU_TRACE(reset_cpu_stall_ticks(rcp));
> > > if (rcp->rcucblist != NULL &&
> > > rcp->donetail != rcp->curtail) {
> > > rcp->donetail = rcp->curtail;
> > > @@ -251,7 +251,7 @@ void rcu_bh_qs(int cpu)
> > > */
> > > void rcu_check_callbacks(int cpu, int user)
> > > {
> > > - check_cpu_stalls();
> > > + RCU_TRACE(check_cpu_stalls());
> > > if (user || rcu_is_cpu_rrupt_from_idle())
> > > rcu_sched_qs(cpu);
> > > else if (!in_softirq())
> > > diff --git a/kernel/rcutiny_plugin.h b/kernel/rcutiny_plugin.h
> > > index 65ef180..0cd385a 100644
> > > --- a/kernel/rcutiny_plugin.h
> > > +++ b/kernel/rcutiny_plugin.h
> > > @@ -158,15 +158,11 @@ static void check_cpu_stall(struct rcu_ctrlblk *rcp)
> > > rcp->jiffies_stall = jiffies + rcu_jiffies_till_stall_check();
> > > }
> > >
> > > -#endif /* #ifdef CONFIG_RCU_TRACE */
> > > -
> > > static void reset_cpu_stall_ticks(struct rcu_ctrlblk *rcp)
> > > {
> > > -#ifdef CONFIG_RCU_TRACE
> > > rcp->ticks_this_gp = 0;
> > > rcp->gp_start = jiffies;
> > > rcp->jiffies_stall = jiffies + rcu_jiffies_till_stall_check();
> > > -#endif /* #ifdef CONFIG_RCU_TRACE */
> > > }
> > >
> > > static void check_cpu_stalls(void)
> > > @@ -174,3 +170,5 @@ static void check_cpu_stalls(void)
> > > RCU_TRACE(check_cpu_stall(&rcu_bh_ctrlblk));
> > > RCU_TRACE(check_cpu_stall(&rcu_sched_ctrlblk));
> > > }
> > > +
> > > +#endif /* #ifdef CONFIG_RCU_TRACE */
> > > --
> > > 1.8.1.5
> > >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
> > Please read the FAQ at http://www.tux.org/lkml/
> >
>
^ permalink raw reply [flat|nested] 17+ messages in thread