Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 323933
b: refs/heads/master
c: c1cc017
h: refs/heads/master
i:
  323931: 04f6cc5
v: v3
  • Loading branch information
Alex Shi authored and Ingo Molnar committed Sep 13, 2012
1 parent 8d08bcd commit 8c37412
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 20 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: 08bedae1d0acd8c9baf514fb69fa199d0c8345f6
refs/heads/master: c1cc017c59c44d9ede7003631c43adc0cfdce2f9
4 changes: 2 additions & 2 deletions trunk/include/linux/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,11 +273,11 @@ extern void init_idle_bootup_task(struct task_struct *idle);
extern int runqueue_is_locked(int cpu);

#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ)
extern void select_nohz_load_balancer(int stop_tick);
extern void nohz_balance_enter_idle(int cpu);
extern void set_cpu_sd_state_idle(void);
extern int get_nohz_timer_target(void);
#else
static inline void select_nohz_load_balancer(int stop_tick) { }
static inline void nohz_balance_enter_idle(int cpu) { }
static inline void set_cpu_sd_state_idle(void) { }
#endif

Expand Down
25 changes: 10 additions & 15 deletions trunk/kernel/sched/fair.c
Original file line number Diff line number Diff line change
Expand Up @@ -4603,7 +4603,7 @@ static void nohz_balancer_kick(int cpu)
return;
}

static inline void clear_nohz_tick_stopped(int cpu)
static inline void nohz_balance_exit_idle(int cpu)
{
if (unlikely(test_bit(NOHZ_TICK_STOPPED, nohz_flags(cpu)))) {
cpumask_clear_cpu(cpu, nohz.idle_cpus_mask);
Expand Down Expand Up @@ -4643,36 +4643,31 @@ void set_cpu_sd_state_idle(void)
}

/*
* This routine will record that this cpu is going idle with tick stopped.
* This routine will record that the cpu is going idle with tick stopped.
* This info will be used in performing idle load balancing in the future.
*/
void select_nohz_load_balancer(int stop_tick)
void nohz_balance_enter_idle(int cpu)
{
int cpu = smp_processor_id();

/*
* If this cpu is going down, then nothing needs to be done.
*/
if (!cpu_active(cpu))
return;

if (stop_tick) {
if (test_bit(NOHZ_TICK_STOPPED, nohz_flags(cpu)))
return;
if (test_bit(NOHZ_TICK_STOPPED, nohz_flags(cpu)))
return;

cpumask_set_cpu(cpu, nohz.idle_cpus_mask);
atomic_inc(&nohz.nr_cpus);
set_bit(NOHZ_TICK_STOPPED, nohz_flags(cpu));
}
return;
cpumask_set_cpu(cpu, nohz.idle_cpus_mask);
atomic_inc(&nohz.nr_cpus);
set_bit(NOHZ_TICK_STOPPED, nohz_flags(cpu));
}

static int __cpuinit sched_ilb_notifier(struct notifier_block *nfb,
unsigned long action, void *hcpu)
{
switch (action & ~CPU_TASKS_FROZEN) {
case CPU_DYING:
clear_nohz_tick_stopped(smp_processor_id());
nohz_balance_exit_idle(smp_processor_id());
return NOTIFY_OK;
default:
return NOTIFY_DONE;
Expand Down Expand Up @@ -4833,7 +4828,7 @@ static inline int nohz_kick_needed(struct rq *rq, int cpu)
* busy tick after returning from idle, we will update the busy stats.
*/
set_cpu_sd_state_busy();
clear_nohz_tick_stopped(cpu);
nohz_balance_exit_idle(cpu);

/*
* None are in tickless mode and hence no need for NOHZ idle load
Expand Down
3 changes: 1 addition & 2 deletions trunk/kernel/time/tick-sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ static ktime_t tick_nohz_stop_sched_tick(struct tick_sched *ts,
* the scheduler tick in nohz_restart_sched_tick.
*/
if (!ts->tick_stopped) {
select_nohz_load_balancer(1);
nohz_balance_enter_idle(cpu);
calc_load_enter_idle();

ts->last_tick = hrtimer_get_expires(&ts->sched_timer);
Expand Down Expand Up @@ -569,7 +569,6 @@ static void tick_nohz_restart(struct tick_sched *ts, ktime_t now)
static void tick_nohz_restart_sched_tick(struct tick_sched *ts, ktime_t now)
{
/* Update jiffies first */
select_nohz_load_balancer(0);
tick_do_update_jiffies64(now);
update_cpu_load_nohz();

Expand Down

0 comments on commit 8c37412

Please sign in to comment.