Commit 5b1d07ed0e5b2707f786957c7a40eb2f399c84a8
Committed by
Linus Torvalds
1 parent
da60682c11
RCU: Don't try and predeclare inline funcs as it upsets some versions of gcc
Don't try and predeclare inline funcs like this: static inline void wait_migrated_callbacks(void) ... static void _rcu_barrier(enum rcu_barrier type) { ... wait_migrated_callbacks(); } ... static inline void wait_migrated_callbacks(void) { wait_event(rcu_migrate_wq, !atomic_read(&rcu_migrate_type_count)); } as it upsets some versions of gcc under some circumstances: kernel/rcupdate.c: In function `_rcu_barrier': kernel/rcupdate.c:125: sorry, unimplemented: inlining failed in call to 'wait_migrated_callbacks': function body not available kernel/rcupdate.c:152: sorry, unimplemented: called from here This can be dealt with by simply putting the static variables (rcu_migrate_*) at the top, and moving the implementation of the function up so that it replaces its forward declaration. Signed-off-by: David Howells <dhowells@redhat.com> Cc: Dipankar Sarma <dipankar@in.ibm.com> Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Showing 1 changed file with 8 additions and 10 deletions Side-by-side Diff
kernel/rcupdate.c
... | ... | @@ -58,6 +58,10 @@ |
58 | 58 | static struct completion rcu_barrier_completion; |
59 | 59 | int rcu_scheduler_active __read_mostly; |
60 | 60 | |
61 | +static atomic_t rcu_migrate_type_count = ATOMIC_INIT(0); | |
62 | +static struct rcu_head rcu_migrate_head[3]; | |
63 | +static DECLARE_WAIT_QUEUE_HEAD(rcu_migrate_wq); | |
64 | + | |
61 | 65 | /* |
62 | 66 | * Awaken the corresponding synchronize_rcu() instance now that a |
63 | 67 | * grace period has elapsed. |
... | ... | @@ -122,7 +126,10 @@ |
122 | 126 | } |
123 | 127 | } |
124 | 128 | |
125 | -static inline void wait_migrated_callbacks(void); | |
129 | +static inline void wait_migrated_callbacks(void) | |
130 | +{ | |
131 | + wait_event(rcu_migrate_wq, !atomic_read(&rcu_migrate_type_count)); | |
132 | +} | |
126 | 133 | |
127 | 134 | /* |
128 | 135 | * Orchestrate the specified type of RCU barrier, waiting for all |
129 | 136 | |
... | ... | @@ -179,19 +186,10 @@ |
179 | 186 | } |
180 | 187 | EXPORT_SYMBOL_GPL(rcu_barrier_sched); |
181 | 188 | |
182 | -static atomic_t rcu_migrate_type_count = ATOMIC_INIT(0); | |
183 | -static struct rcu_head rcu_migrate_head[3]; | |
184 | -static DECLARE_WAIT_QUEUE_HEAD(rcu_migrate_wq); | |
185 | - | |
186 | 189 | static void rcu_migrate_callback(struct rcu_head *notused) |
187 | 190 | { |
188 | 191 | if (atomic_dec_and_test(&rcu_migrate_type_count)) |
189 | 192 | wake_up(&rcu_migrate_wq); |
190 | -} | |
191 | - | |
192 | -static inline void wait_migrated_callbacks(void) | |
193 | -{ | |
194 | - wait_event(rcu_migrate_wq, !atomic_read(&rcu_migrate_type_count)); | |
195 | 193 | } |
196 | 194 | |
197 | 195 | static int __cpuinit rcu_barrier_cpu_hotplug(struct notifier_block *self, |