Skip to content

Commit

Permalink
Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/l…
Browse files Browse the repository at this point in the history
…inux/kernel/git/tip/tip

Pull scheduler changes for v3.4 from Ingo Molnar

* 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (27 commits)
  printk: Make it compile with !CONFIG_PRINTK
  sched/x86: Fix overflow in cyc2ns_offset
  sched: Fix nohz load accounting -- again!
  sched: Update yield() docs
  printk/sched: Introduce special printk_sched() for those awkward moments
  sched/nohz: Correctly initialize 'next_balance' in 'nohz' idle balancer
  sched: Cleanup cpu_active madness
  sched: Fix load-balance wreckage
  sched: Clean up parameter passing of proc_sched_autogroup_set_nice()
  sched: Ditch per cgroup task lists for load-balancing
  sched: Rename load-balancing fields
  sched: Move load-balancing arguments into helper struct
  sched/rt: Do not submit new work when PI-blocked
  sched/rt: Prevent idle task boosting
  sched/wait: Add __wake_up_all_locked() API
  sched/rt: Document scheduler related skip-resched-check sites
  sched/rt: Use schedule_preempt_disabled()
  sched/rt: Add schedule_preempt_disabled()
  sched/rt: Do not throttle when PI boosting
  sched/rt: Keep period timer ticking when rt throttling is active
  ...
  • Loading branch information
torvalds committed Mar 20, 2012
2 parents 9c2b957 + 600e145 commit 2ba6894
Show file tree
Hide file tree
Showing 52 changed files with 462 additions and 462 deletions.
3 changes: 2 additions & 1 deletion Documentation/scheduler/sched-stats.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ First field is a sched_yield() statistic:
1) # of times sched_yield() was called

Next three are schedule() statistics:
2) # of times we switched to the expired queue and reused it
2) This field is a legacy array expiration count field used in the O(1)
scheduler. We kept it for ABI compatibility, but it is always set to zero.
3) # of times schedule() was called
4) # of times schedule() left the processor idle

Expand Down
4 changes: 1 addition & 3 deletions arch/arm/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,7 @@ void cpu_idle(void)
leds_event(led_idle_end);
rcu_idle_exit();
tick_nohz_idle_exit();
preempt_enable_no_resched();
schedule();
preempt_disable();
schedule_preempt_disabled();
}
}

Expand Down
7 changes: 0 additions & 7 deletions arch/arm/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,13 +295,6 @@ asmlinkage void __cpuinit secondary_start_kernel(void)
*/
percpu_timer_setup();

while (!cpu_active(cpu))
cpu_relax();

/*
* cpu_active bit is set, so it's safe to enalbe interrupts
* now.
*/
local_irq_enable();
local_fiq_enable();

Expand Down
4 changes: 1 addition & 3 deletions arch/avr32/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ void cpu_idle(void)
cpu_idle_sleep();
rcu_idle_exit();
tick_nohz_idle_exit();
preempt_enable_no_resched();
schedule();
preempt_disable();
schedule_preempt_disabled();
}
}

Expand Down
4 changes: 1 addition & 3 deletions arch/blackfin/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,7 @@ void cpu_idle(void)
idle();
rcu_idle_exit();
tick_nohz_idle_exit();
preempt_enable_no_resched();
schedule();
preempt_disable();
schedule_preempt_disabled();
}
}

Expand Down
4 changes: 1 addition & 3 deletions arch/cris/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,7 @@ void cpu_idle (void)
idle = default_idle;
idle();
}
preempt_enable_no_resched();
schedule();
preempt_disable();
schedule_preempt_disabled();
}
}

Expand Down
4 changes: 1 addition & 3 deletions arch/frv/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,7 @@ void cpu_idle(void)
idle();
}

preempt_enable_no_resched();
schedule();
preempt_disable();
schedule_preempt_disabled();
}
}

Expand Down
4 changes: 1 addition & 3 deletions arch/h8300/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,7 @@ void cpu_idle(void)
while (1) {
while (!need_resched())
idle();
preempt_enable_no_resched();
schedule();
preempt_disable();
schedule_preempt_disabled();
}
}

Expand Down
2 changes: 0 additions & 2 deletions arch/hexagon/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,6 @@ void __cpuinit start_secondary(void)
printk(KERN_INFO "%s cpu %d\n", __func__, current_thread_info()->cpu);

set_cpu_online(cpu, true);
while (!cpumask_test_cpu(cpu, cpu_active_mask))
cpu_relax();
local_irq_enable();

cpu_idle();
Expand Down
4 changes: 1 addition & 3 deletions arch/ia64/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,7 @@ cpu_idle (void)
normal_xtp();
#endif
}
preempt_enable_no_resched();
schedule();
preempt_disable();
schedule_preempt_disabled();
check_pgt_cache();
if (cpu_is_offline(cpu))
play_dead();
Expand Down
4 changes: 1 addition & 3 deletions arch/m32r/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,7 @@ void cpu_idle (void)

idle();
}
preempt_enable_no_resched();
schedule();
preempt_disable();
schedule_preempt_disabled();
}
}

Expand Down
4 changes: 1 addition & 3 deletions arch/m68k/kernel/process_mm.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ void cpu_idle(void)
while (1) {
while (!need_resched())
idle();
preempt_enable_no_resched();
schedule();
preempt_disable();
schedule_preempt_disabled();
}
}

Expand Down
4 changes: 1 addition & 3 deletions arch/m68k/kernel/process_no.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,7 @@ void cpu_idle(void)
/* endless idle loop with no priority at all */
while (1) {
idle();
preempt_enable_no_resched();
schedule();
preempt_disable();
schedule_preempt_disabled();
}
}

Expand Down
4 changes: 1 addition & 3 deletions arch/microblaze/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,7 @@ void cpu_idle(void)
rcu_idle_exit();
tick_nohz_idle_exit();

preempt_enable_no_resched();
schedule();
preempt_disable();
schedule_preempt_disabled();
check_pgt_cache();
}
}
Expand Down
4 changes: 1 addition & 3 deletions arch/mips/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,7 @@ void __noreturn cpu_idle(void)
#endif
rcu_idle_exit();
tick_nohz_idle_exit();
preempt_enable_no_resched();
schedule();
preempt_disable();
schedule_preempt_disabled();
}
}

Expand Down
4 changes: 1 addition & 3 deletions arch/mn10300/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,7 @@ void cpu_idle(void)
idle();
}

preempt_enable_no_resched();
schedule();
preempt_disable();
schedule_preempt_disabled();
}
}

Expand Down
4 changes: 1 addition & 3 deletions arch/parisc/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,7 @@ void cpu_idle(void)
while (1) {
while (!need_resched())
barrier();
preempt_enable_no_resched();
schedule();
preempt_disable();
schedule_preempt_disabled();
check_pgt_cache();
}
}
Expand Down
8 changes: 4 additions & 4 deletions arch/powerpc/kernel/idle.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ void cpu_idle(void)
ppc64_runlatch_on();
rcu_idle_exit();
tick_nohz_idle_exit();
preempt_enable_no_resched();
if (cpu_should_die())
if (cpu_should_die()) {
sched_preempt_enable_no_resched();
cpu_die();
schedule();
preempt_disable();
}
schedule_preempt_disabled();
}
}

Expand Down
8 changes: 2 additions & 6 deletions arch/powerpc/platforms/iseries/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -584,9 +584,7 @@ static void iseries_shared_idle(void)
if (hvlpevent_is_pending())
process_iSeries_events();

preempt_enable_no_resched();
schedule();
preempt_disable();
schedule_preempt_disabled();
}
}

Expand Down Expand Up @@ -615,9 +613,7 @@ static void iseries_dedicated_idle(void)
ppc64_runlatch_on();
rcu_idle_exit();
tick_nohz_idle_exit();
preempt_enable_no_resched();
schedule();
preempt_disable();
schedule_preempt_disabled();
}
}

Expand Down
4 changes: 1 addition & 3 deletions arch/s390/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,7 @@ void cpu_idle(void)
tick_nohz_idle_exit();
if (test_thread_flag(TIF_MCCK_PENDING))
s390_handle_mcck();
preempt_enable_no_resched();
schedule();
preempt_disable();
schedule_preempt_disabled();
}
}

Expand Down
6 changes: 0 additions & 6 deletions arch/s390/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -550,12 +550,6 @@ int __cpuinit start_secondary(void *cpuvoid)
S390_lowcore.restart_psw.addr =
PSW_ADDR_AMODE | (unsigned long) psw_restart_int_handler;
__ctl_set_bit(0, 28); /* Enable lowcore protection */
/*
* Wait until the cpu which brought this one up marked it
* active before enabling interrupts.
*/
while (!cpumask_test_cpu(smp_processor_id(), cpu_active_mask))
cpu_relax();
local_irq_enable();
/* cpu_idle will call schedule for us */
cpu_idle();
Expand Down
4 changes: 1 addition & 3 deletions arch/score/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ void __noreturn cpu_idle(void)
while (!need_resched())
barrier();

preempt_enable_no_resched();
schedule();
preempt_disable();
schedule_preempt_disabled();
}
}

Expand Down
4 changes: 1 addition & 3 deletions arch/sh/kernel/idle.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,7 @@ void cpu_idle(void)

rcu_idle_exit();
tick_nohz_idle_exit();
preempt_enable_no_resched();
schedule();
preempt_disable();
schedule_preempt_disabled();
}
}

Expand Down
8 changes: 2 additions & 6 deletions arch/sparc/kernel/process_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,7 @@ void cpu_idle(void)
while (!need_resched())
cpu_relax();
}
preempt_enable_no_resched();
schedule();
preempt_disable();
schedule_preempt_disabled();
check_pgt_cache();
}
}
Expand All @@ -138,9 +136,7 @@ void cpu_idle(void)
while (!need_resched())
cpu_relax();
}
preempt_enable_no_resched();
schedule();
preempt_disable();
schedule_preempt_disabled();
check_pgt_cache();
}
}
Expand Down
10 changes: 4 additions & 6 deletions arch/sparc/kernel/process_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,13 @@ void cpu_idle(void)
rcu_idle_exit();
tick_nohz_idle_exit();

preempt_enable_no_resched();

#ifdef CONFIG_HOTPLUG_CPU
if (cpu_is_offline(cpu))
if (cpu_is_offline(cpu)) {
sched_preempt_enable_no_resched();
cpu_play_dead();
}
#endif

schedule();
preempt_disable();
schedule_preempt_disabled();
}
}

Expand Down
4 changes: 1 addition & 3 deletions arch/tile/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,7 @@ void cpu_idle(void)
}
rcu_idle_exit();
tick_nohz_idle_exit();
preempt_enable_no_resched();
schedule();
preempt_disable();
schedule_preempt_disabled();
}
}

Expand Down
8 changes: 2 additions & 6 deletions arch/x86/include/asm/timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,10 @@ DECLARE_PER_CPU(unsigned long long, cyc2ns_offset);

static inline unsigned long long __cycles_2_ns(unsigned long long cyc)
{
unsigned long long quot;
unsigned long long rem;
int cpu = smp_processor_id();
unsigned long long ns = per_cpu(cyc2ns_offset, cpu);
quot = (cyc >> CYC2NS_SCALE_FACTOR);
rem = cyc & ((1ULL << CYC2NS_SCALE_FACTOR) - 1);
ns += quot * per_cpu(cyc2ns, cpu) +
((rem * per_cpu(cyc2ns, cpu)) >> CYC2NS_SCALE_FACTOR);
ns += mult_frac(cyc, per_cpu(cyc2ns, cpu),
(1UL << CYC2NS_SCALE_FACTOR));
return ns;
}

Expand Down
4 changes: 1 addition & 3 deletions arch/x86/kernel/process_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,7 @@ void cpu_idle(void)
}
rcu_idle_exit();
tick_nohz_idle_exit();
preempt_enable_no_resched();
schedule();
preempt_disable();
schedule_preempt_disabled();
}
}

Expand Down
4 changes: 1 addition & 3 deletions arch/x86/kernel/process_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,7 @@ void cpu_idle(void)
}

tick_nohz_idle_exit();
preempt_enable_no_resched();
schedule();
preempt_disable();
schedule_preempt_disabled();
}
}

Expand Down
13 changes: 0 additions & 13 deletions arch/x86/kernel/smpboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,19 +291,6 @@ notrace static void __cpuinit start_secondary(void *unused)
per_cpu(cpu_state, smp_processor_id()) = CPU_ONLINE;
x86_platform.nmi_init();

/*
* Wait until the cpu which brought this one up marked it
* online before enabling interrupts. If we don't do that then
* we can end up waking up the softirq thread before this cpu
* reached the active state, which makes the scheduler unhappy
* and schedule the softirq thread on the wrong cpu. This is
* only observable with forced threaded interrupts, but in
* theory it could also happen w/o them. It's just way harder
* to achieve.
*/
while (!cpumask_test_cpu(smp_processor_id(), cpu_active_mask))
cpu_relax();

/* enable local interrupts */
local_irq_enable();

Expand Down
3 changes: 2 additions & 1 deletion arch/x86/kernel/tsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,8 @@ static void set_cyc2ns_scale(unsigned long cpu_khz, int cpu)

if (cpu_khz) {
*scale = (NSEC_PER_MSEC << CYC2NS_SCALE_FACTOR)/cpu_khz;
*offset = ns_now - (tsc_now * *scale >> CYC2NS_SCALE_FACTOR);
*offset = ns_now - mult_frac(tsc_now, *scale,
(1UL << CYC2NS_SCALE_FACTOR));
}

sched_clock_idle_wakeup_event(0);
Expand Down
Loading

0 comments on commit 2ba6894

Please sign in to comment.