Skip to content

Commit 58d4292

Browse files
ingomolnarpaulmckrcu
authored andcommitted
rcu: Uninline multi-use function: finish_rcuwait()
This is a rarely used function, so uninlining its 3 instructions is probably a win or a wash - but the main motivation is to make <linux/rcuwait.h> independent of task_struct details. Signed-off-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
1 parent c099290 commit 58d4292

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

include/linux/rcuwait.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,7 @@ static inline void prepare_to_rcuwait(struct rcuwait *w)
4747
rcu_assign_pointer(w->task, current);
4848
}
4949

50-
static inline void finish_rcuwait(struct rcuwait *w)
51-
{
52-
rcu_assign_pointer(w->task, NULL);
53-
__set_current_state(TASK_RUNNING);
54-
}
50+
extern void finish_rcuwait(struct rcuwait *w);
5551

5652
#define rcuwait_wait_event(w, condition, state) \
5753
({ \

kernel/rcu/update.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,13 @@ void __wait_rcu_gp(bool checktiny, int n, call_rcu_func_t *crcu_array,
407407
}
408408
EXPORT_SYMBOL_GPL(__wait_rcu_gp);
409409

410+
void finish_rcuwait(struct rcuwait *w)
411+
{
412+
rcu_assign_pointer(w->task, NULL);
413+
__set_current_state(TASK_RUNNING);
414+
}
415+
EXPORT_SYMBOL_GPL(finish_rcuwait);
416+
410417
#ifdef CONFIG_DEBUG_OBJECTS_RCU_HEAD
411418
void init_rcu_head(struct rcu_head *head)
412419
{

0 commit comments

Comments
 (0)