Skip to content

Commit

Permalink
rcu: provide rcu_virt_note_context_switch() function.
Browse files Browse the repository at this point in the history
Provide rcu_virt_note_context_switch() for vitalization use to note
quiescent state during guest entry.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
  • Loading branch information
Gleb Natapov authored and paulmck committed May 6, 2011
1 parent bad6e13 commit 29ce831
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
8 changes: 8 additions & 0 deletions include/linux/rcutiny.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,14 @@ static inline void rcu_note_context_switch(int cpu)
rcu_preempt_note_context_switch();
}

/*
* Take advantage of the fact that there is only one CPU, which
* allows us to ignore virtualization-based context switches.
*/
static inline void rcu_virt_note_context_switch(int cpu)
{
}

/*
* Return the number of grace periods.
*/
Expand Down
10 changes: 10 additions & 0 deletions include/linux/rcutree.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@ extern void rcu_note_context_switch(int cpu);
extern int rcu_needs_cpu(int cpu);
extern void rcu_cpu_stall_reset(void);

/*
* Note a virtualization-based context switch. This is simply a
* wrapper around rcu_note_context_switch(), which allows TINY_RCU
* to save a few bytes.
*/
static inline void rcu_virt_note_context_switch(int cpu)
{
rcu_note_context_switch(cpu);
}

#ifdef CONFIG_TREE_PREEMPT_RCU

extern void exit_rcu(void);
Expand Down
1 change: 1 addition & 0 deletions kernel/rcutree.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ void rcu_note_context_switch(int cpu)
rcu_sched_qs(cpu);
rcu_preempt_note_context_switch(cpu);
}
EXPORT_SYMBOL_GPL(rcu_note_context_switch);

#ifdef CONFIG_NO_HZ
DEFINE_PER_CPU(struct rcu_dynticks, rcu_dynticks) = {
Expand Down

0 comments on commit 29ce831

Please sign in to comment.