Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 302737
b: refs/heads/master
c: 2ee3dc8
h: refs/heads/master
i:
  302735: c1fc25c
v: v3
  • Loading branch information
Paul E. McKenney authored and Paul E. McKenney committed Apr 25, 2012
1 parent e12c3db commit 8a525c4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 29 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: 2fdbb31b662787f78bb78b3e4e18f1a072058ffc
refs/heads/master: 2ee3dc80660ac8285a37e662fd91b2e45c46f06a
40 changes: 12 additions & 28 deletions trunk/kernel/rcutree_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -1980,9 +1980,7 @@ static void rcu_prepare_for_idle(int cpu)

static DEFINE_PER_CPU(int, rcu_dyntick_drain);
static DEFINE_PER_CPU(unsigned long, rcu_dyntick_holdoff);
static DEFINE_PER_CPU(struct hrtimer, rcu_idle_gp_timer);
static ktime_t rcu_idle_gp_wait; /* If some non-lazy callbacks. */
static ktime_t rcu_idle_lazy_gp_wait; /* If only lazy callbacks. */
static DEFINE_PER_CPU(struct timer_list, rcu_idle_gp_timer);

/*
* Allow the CPU to enter dyntick-idle mode if either: (1) There are no
Expand Down Expand Up @@ -2051,30 +2049,18 @@ static bool rcu_cpu_has_nonlazy_callbacks(int cpu)
* real work is done upon re-entry to idle, or by the next scheduling-clock
* interrupt should idle not be re-entered.
*/
static enum hrtimer_restart rcu_idle_gp_timer_func(struct hrtimer *hrtp)
static void rcu_idle_gp_timer_func(unsigned long unused)
{
trace_rcu_prep_idle("Timer");
return HRTIMER_NORESTART;
}

/*
* Initialize the timer used to pull CPUs out of dyntick-idle mode.
*/
static void rcu_prepare_for_idle_init(int cpu)
{
static int firsttime = 1;
struct hrtimer *hrtp = &per_cpu(rcu_idle_gp_timer, cpu);

hrtimer_init(hrtp, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
hrtp->function = rcu_idle_gp_timer_func;
if (firsttime) {
unsigned int upj = jiffies_to_usecs(RCU_IDLE_GP_DELAY);

rcu_idle_gp_wait = ns_to_ktime(upj * (u64)1000);
upj = jiffies_to_usecs(RCU_IDLE_LAZY_GP_DELAY);
rcu_idle_lazy_gp_wait = ns_to_ktime(upj * (u64)1000);
firsttime = 0;
}
setup_timer(&per_cpu(rcu_idle_gp_timer, cpu),
rcu_idle_gp_timer_func, 0);
}

/*
Expand All @@ -2084,7 +2070,7 @@ static void rcu_prepare_for_idle_init(int cpu)
*/
static void rcu_cleanup_after_idle(int cpu)
{
hrtimer_cancel(&per_cpu(rcu_idle_gp_timer, cpu));
del_timer(&per_cpu(rcu_idle_gp_timer, cpu));
trace_rcu_prep_idle("Cleanup after idle");
}

Expand Down Expand Up @@ -2141,11 +2127,11 @@ static void rcu_prepare_for_idle(int cpu)
per_cpu(rcu_dyntick_drain, cpu) = 0;
per_cpu(rcu_dyntick_holdoff, cpu) = jiffies;
if (rcu_cpu_has_nonlazy_callbacks(cpu))
hrtimer_start(&per_cpu(rcu_idle_gp_timer, cpu),
rcu_idle_gp_wait, HRTIMER_MODE_REL);
mod_timer(&per_cpu(rcu_idle_gp_timer, cpu),
jiffies + RCU_IDLE_GP_DELAY);
else
hrtimer_start(&per_cpu(rcu_idle_gp_timer, cpu),
rcu_idle_lazy_gp_wait, HRTIMER_MODE_REL);
mod_timer(&per_cpu(rcu_idle_gp_timer, cpu),
jiffies + RCU_IDLE_LAZY_GP_DELAY);
return; /* Nothing more to do immediately. */
} else if (--per_cpu(rcu_dyntick_drain, cpu) <= 0) {
/* We have hit the limit, so time to give up. */
Expand Down Expand Up @@ -2193,14 +2179,12 @@ static void rcu_prepare_for_idle(int cpu)

static void print_cpu_stall_fast_no_hz(char *cp, int cpu)
{
struct hrtimer *hrtp = &per_cpu(rcu_idle_gp_timer, cpu);
struct timer_list *tltp = &per_cpu(rcu_idle_gp_timer, cpu);

sprintf(cp, "drain=%d %c timer=%lld",
sprintf(cp, "drain=%d %c timer=%lu",
per_cpu(rcu_dyntick_drain, cpu),
per_cpu(rcu_dyntick_holdoff, cpu) == jiffies ? 'H' : '.',
hrtimer_active(hrtp)
? ktime_to_us(hrtimer_get_remaining(hrtp))
: -1);
timer_pending(tltp) ? tltp->expires - jiffies : -1);
}

#else /* #ifdef CONFIG_RCU_FAST_NO_HZ */
Expand Down

0 comments on commit 8a525c4

Please sign in to comment.