Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 302741
b: refs/heads/master
c: 21e52e1
h: refs/heads/master
i:
  302739: 5e893d3
v: v3
  • Loading branch information
Paul E. McKenney authored and Paul E. McKenney committed May 9, 2012
1 parent 6ed69fd commit 9f2a702
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f511fc624642f0bb8cf65aaa28979737514d4746
refs/heads/master: 21e52e15666323078b8517a4312712579176b56f
1 change: 1 addition & 0 deletions trunk/include/trace/events/rcu.h
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ TRACE_EVENT(rcu_dyntick,
* "More callbacks": Still more callbacks, try again to clear them out.
* "Callbacks drained": All callbacks processed, off to dyntick idle!
* "Timer": Timer fired to cause CPU to continue processing callbacks.
* "Demigrate": Timer fired on wrong CPU, woke up correct CPU.
* "Cleanup after idle": Idle exited, timer canceled.
*/
TRACE_EVENT(rcu_prep_idle,
Expand Down
24 changes: 21 additions & 3 deletions trunk/kernel/rcutree_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -2056,17 +2056,35 @@ static bool rcu_cpu_has_nonlazy_callbacks(int cpu)
rcu_preempt_cpu_has_nonlazy_callbacks(cpu);
}

/*
* Handler for smp_call_function_single(). The only point of this
* handler is to wake the CPU up, so the handler does only tracing.
*/
void rcu_idle_demigrate(void *unused)
{
trace_rcu_prep_idle("Demigrate");
}

/*
* Timer handler used to force CPU to start pushing its remaining RCU
* callbacks in the case where it entered dyntick-idle mode with callbacks
* pending. The hander doesn't really need to do anything because the
* real work is done upon re-entry to idle, or by the next scheduling-clock
* interrupt should idle not be re-entered.
*
* One special case: the timer gets migrated without awakening the CPU
* on which the timer was scheduled on. In this case, we must wake up
* that CPU. We do so with smp_call_function_single().
*/
static void rcu_idle_gp_timer_func(unsigned long unused)
static void rcu_idle_gp_timer_func(unsigned long cpu_in)
{
WARN_ON_ONCE(1); /* Getting here can hang the system... */
int cpu = (int)cpu_in;

trace_rcu_prep_idle("Timer");
if (cpu != smp_processor_id())
smp_call_function_single(cpu, rcu_idle_demigrate, NULL, 0);
else
WARN_ON_ONCE(1); /* Getting here can hang the system... */
}

/*
Expand All @@ -2075,7 +2093,7 @@ static void rcu_idle_gp_timer_func(unsigned long unused)
static void rcu_prepare_for_idle_init(int cpu)
{
setup_timer(&per_cpu(rcu_idle_gp_timer, cpu),
rcu_idle_gp_timer_func, 0);
rcu_idle_gp_timer_func, cpu);
}

/*
Expand Down

0 comments on commit 9f2a702

Please sign in to comment.