diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2014-10-21 15:50:04 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2014-11-03 22:20:34 -0500 |
commit | 38200cf24702e5d79ce6c8f4c62036c41845c62d (patch) | |
tree | 840642332deb3f091142c78994de1f8db73b4f8c | |
parent | 86aea0e6e7d571a9452082a7198d0603cc5dd965 (diff) |
rcu: Remove "cpu" argument to rcu_note_context_switch()
The "cpu" argument to rcu_note_context_switch() is always the current
CPU, so drop it. This in turn allows the "cpu" argument to
rcu_preempt_note_context_switch() to be removed, which allows the sole
use of "cpu" in both functions to be replaced with a this_cpu_ptr().
Again, the anticipated cross-CPU uses of these functions has been
replaced by NO_HZ_FULL.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Pranith Kumar <bobby.prani@gmail.com>
-rw-r--r-- | include/linux/rcutiny.h | 2 | ||||
-rw-r--r-- | include/linux/rcutree.h | 4 | ||||
-rw-r--r-- | kernel/rcu/tree.c | 4 | ||||
-rw-r--r-- | kernel/rcu/tree.h | 2 | ||||
-rw-r--r-- | kernel/rcu/tree_plugin.h | 6 | ||||
-rw-r--r-- | kernel/sched/core.c | 2 | ||||
-rw-r--r-- | kernel/softirq.c | 2 |
7 files changed, 11 insertions, 11 deletions
diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h index 38cc5b1e252d..0e5366200154 100644 --- a/include/linux/rcutiny.h +++ b/include/linux/rcutiny.h | |||
@@ -78,7 +78,7 @@ static inline void kfree_call_rcu(struct rcu_head *head, | |||
78 | call_rcu(head, func); | 78 | call_rcu(head, func); |
79 | } | 79 | } |
80 | 80 | ||
81 | static inline void rcu_note_context_switch(int cpu) | 81 | static inline void rcu_note_context_switch(void) |
82 | { | 82 | { |
83 | rcu_sched_qs(); | 83 | rcu_sched_qs(); |
84 | } | 84 | } |
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h index 3e2f5d432743..7b5484db1857 100644 --- a/include/linux/rcutree.h +++ b/include/linux/rcutree.h | |||
@@ -30,7 +30,7 @@ | |||
30 | #ifndef __LINUX_RCUTREE_H | 30 | #ifndef __LINUX_RCUTREE_H |
31 | #define __LINUX_RCUTREE_H | 31 | #define __LINUX_RCUTREE_H |
32 | 32 | ||
33 | void rcu_note_context_switch(int cpu); | 33 | void rcu_note_context_switch(void); |
34 | #ifndef CONFIG_RCU_NOCB_CPU_ALL | 34 | #ifndef CONFIG_RCU_NOCB_CPU_ALL |
35 | int rcu_needs_cpu(int cpu, unsigned long *delta_jiffies); | 35 | int rcu_needs_cpu(int cpu, unsigned long *delta_jiffies); |
36 | #endif /* #ifndef CONFIG_RCU_NOCB_CPU_ALL */ | 36 | #endif /* #ifndef CONFIG_RCU_NOCB_CPU_ALL */ |
@@ -43,7 +43,7 @@ void rcu_cpu_stall_reset(void); | |||
43 | */ | 43 | */ |
44 | static inline void rcu_virt_note_context_switch(int cpu) | 44 | static inline void rcu_virt_note_context_switch(int cpu) |
45 | { | 45 | { |
46 | rcu_note_context_switch(cpu); | 46 | rcu_note_context_switch(); |
47 | } | 47 | } |
48 | 48 | ||
49 | void synchronize_rcu_bh(void); | 49 | void synchronize_rcu_bh(void); |
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 1af5e2cdcbeb..b591f1459240 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c | |||
@@ -286,11 +286,11 @@ static void rcu_momentary_dyntick_idle(void) | |||
286 | * and requires special handling for preemptible RCU. | 286 | * and requires special handling for preemptible RCU. |
287 | * The caller must have disabled preemption. | 287 | * The caller must have disabled preemption. |
288 | */ | 288 | */ |
289 | void rcu_note_context_switch(int cpu) | 289 | void rcu_note_context_switch(void) |
290 | { | 290 | { |
291 | trace_rcu_utilization(TPS("Start context switch")); | 291 | trace_rcu_utilization(TPS("Start context switch")); |
292 | rcu_sched_qs(); | 292 | rcu_sched_qs(); |
293 | rcu_preempt_note_context_switch(cpu); | 293 | rcu_preempt_note_context_switch(); |
294 | if (unlikely(raw_cpu_read(rcu_sched_qs_mask))) | 294 | if (unlikely(raw_cpu_read(rcu_sched_qs_mask))) |
295 | rcu_momentary_dyntick_idle(); | 295 | rcu_momentary_dyntick_idle(); |
296 | trace_rcu_utilization(TPS("End context switch")); | 296 | trace_rcu_utilization(TPS("End context switch")); |
diff --git a/kernel/rcu/tree.h b/kernel/rcu/tree.h index 94a26e330c1b..238ac39053fc 100644 --- a/kernel/rcu/tree.h +++ b/kernel/rcu/tree.h | |||
@@ -547,7 +547,7 @@ DECLARE_PER_CPU(char, rcu_cpu_has_work); | |||
547 | /* Forward declarations for rcutree_plugin.h */ | 547 | /* Forward declarations for rcutree_plugin.h */ |
548 | static void rcu_bootup_announce(void); | 548 | static void rcu_bootup_announce(void); |
549 | long rcu_batches_completed(void); | 549 | long rcu_batches_completed(void); |
550 | static void rcu_preempt_note_context_switch(int cpu); | 550 | static void rcu_preempt_note_context_switch(void); |
551 | static int rcu_preempt_blocked_readers_cgp(struct rcu_node *rnp); | 551 | static int rcu_preempt_blocked_readers_cgp(struct rcu_node *rnp); |
552 | #ifdef CONFIG_HOTPLUG_CPU | 552 | #ifdef CONFIG_HOTPLUG_CPU |
553 | static void rcu_report_unblock_qs_rnp(struct rcu_node *rnp, | 553 | static void rcu_report_unblock_qs_rnp(struct rcu_node *rnp, |
diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h index 7158814b7b4a..495d4cce47a7 100644 --- a/kernel/rcu/tree_plugin.h +++ b/kernel/rcu/tree_plugin.h | |||
@@ -156,7 +156,7 @@ static void rcu_preempt_qs(void) | |||
156 | * | 156 | * |
157 | * Caller must disable preemption. | 157 | * Caller must disable preemption. |
158 | */ | 158 | */ |
159 | static void rcu_preempt_note_context_switch(int cpu) | 159 | static void rcu_preempt_note_context_switch(void) |
160 | { | 160 | { |
161 | struct task_struct *t = current; | 161 | struct task_struct *t = current; |
162 | unsigned long flags; | 162 | unsigned long flags; |
@@ -167,7 +167,7 @@ static void rcu_preempt_note_context_switch(int cpu) | |||
167 | !t->rcu_read_unlock_special.b.blocked) { | 167 | !t->rcu_read_unlock_special.b.blocked) { |
168 | 168 | ||
169 | /* Possibly blocking in an RCU read-side critical section. */ | 169 | /* Possibly blocking in an RCU read-side critical section. */ |
170 | rdp = per_cpu_ptr(rcu_preempt_state.rda, cpu); | 170 | rdp = this_cpu_ptr(rcu_preempt_state.rda); |
171 | rnp = rdp->mynode; | 171 | rnp = rdp->mynode; |
172 | raw_spin_lock_irqsave(&rnp->lock, flags); | 172 | raw_spin_lock_irqsave(&rnp->lock, flags); |
173 | smp_mb__after_unlock_lock(); | 173 | smp_mb__after_unlock_lock(); |
@@ -945,7 +945,7 @@ EXPORT_SYMBOL_GPL(rcu_batches_completed); | |||
945 | * Because preemptible RCU does not exist, we never have to check for | 945 | * Because preemptible RCU does not exist, we never have to check for |
946 | * CPUs being in quiescent states. | 946 | * CPUs being in quiescent states. |
947 | */ | 947 | */ |
948 | static void rcu_preempt_note_context_switch(int cpu) | 948 | static void rcu_preempt_note_context_switch(void) |
949 | { | 949 | { |
950 | } | 950 | } |
951 | 951 | ||
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 44999505e1bf..cc186945296d 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c | |||
@@ -2802,7 +2802,7 @@ need_resched: | |||
2802 | preempt_disable(); | 2802 | preempt_disable(); |
2803 | cpu = smp_processor_id(); | 2803 | cpu = smp_processor_id(); |
2804 | rq = cpu_rq(cpu); | 2804 | rq = cpu_rq(cpu); |
2805 | rcu_note_context_switch(cpu); | 2805 | rcu_note_context_switch(); |
2806 | prev = rq->curr; | 2806 | prev = rq->curr; |
2807 | 2807 | ||
2808 | schedule_debug(prev); | 2808 | schedule_debug(prev); |
diff --git a/kernel/softirq.c b/kernel/softirq.c index 0699add19164..501baa9ac1be 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c | |||
@@ -656,7 +656,7 @@ static void run_ksoftirqd(unsigned int cpu) | |||
656 | * in the task stack here. | 656 | * in the task stack here. |
657 | */ | 657 | */ |
658 | __do_softirq(); | 658 | __do_softirq(); |
659 | rcu_note_context_switch(cpu); | 659 | rcu_note_context_switch(); |
660 | local_irq_enable(); | 660 | local_irq_enable(); |
661 | cond_resched(); | 661 | cond_resched(); |
662 | return; | 662 | return; |