Skip to content

Commit

Permalink
Merge branches 'sched-core-for-linus' and 'sched-urgent-for-linus' of…
Browse files Browse the repository at this point in the history
… git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

* 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (60 commits)
  sched: Fix and optimise calculation of the weight-inverse
  sched: Avoid going ahead if ->cpus_allowed is not changed
  sched, rt: Update rq clock when unthrottling of an otherwise idle CPU
  sched: Remove unused parameters from sched_fork() and wake_up_new_task()
  sched: Shorten the construction of the span cpu mask of sched domain
  sched: Wrap the 'cfs_rq->nr_spread_over' field with CONFIG_SCHED_DEBUG
  sched: Remove unused 'this_best_prio arg' from balance_tasks()
  sched: Remove noop in alloc_rt_sched_group()
  sched: Get rid of lock_depth
  sched: Remove obsolete comment from scheduler_tick()
  sched: Fix sched_domain iterations vs. RCU
  sched: Next buddy hint on sleep and preempt path
  sched: Make set_*_buddy() work on non-task entities
  sched: Remove need_migrate_task()
  sched: Move the second half of ttwu() to the remote cpu
  sched: Restructure ttwu() some more
  sched: Rename ttwu_post_activation() to ttwu_do_wakeup()
  sched: Remove rq argument from ttwu_stat()
  sched: Remove rq->lock from the first half of ttwu()
  sched: Drop rq->lock from sched_exec()
  ...

* 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  sched: Fix rt_rq runtime leakage bug
  • Loading branch information
torvalds committed May 20, 2011
3 parents df48d87 + db670da + ec514c4 commit 80fe02b
Show file tree
Hide file tree
Showing 47 changed files with 928 additions and 1,170 deletions.
1 change: 0 additions & 1 deletion Documentation/trace/kprobetrace.txt
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ format:
field:unsigned char common_flags; offset:2; size:1; signed:0;
field:unsigned char common_preempt_count; offset:3; size:1;signed:0;
field:int common_pid; offset:4; size:4; signed:1;
field:int common_lock_depth; offset:8; size:4; signed:1;

field:unsigned long __probe_ip; offset:12; size:4; signed:0;
field:int __probe_nargs; offset:16; size:4; signed:1;
Expand Down
3 changes: 1 addition & 2 deletions arch/alpha/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -585,8 +585,7 @@ handle_ipi(struct pt_regs *regs)

switch (which) {
case IPI_RESCHEDULE:
/* Reschedule callback. Everything to be done
is done by the interrupt return path. */
scheduler_ipi();
break;

case IPI_CALL_FUNC:
Expand Down
5 changes: 1 addition & 4 deletions arch/arm/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -560,10 +560,7 @@ asmlinkage void __exception_irq_entry do_IPI(int ipinr, struct pt_regs *regs)
break;

case IPI_RESCHEDULE:
/*
* nothing more to do - eveything is
* done on the interrupt return path
*/
scheduler_ipi();
break;

case IPI_CALL_FUNC:
Expand Down
3 changes: 3 additions & 0 deletions arch/blackfin/mach-common/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ static irqreturn_t ipi_handler_int1(int irq, void *dev_instance)
while (msg_queue->count) {
msg = &msg_queue->ipi_message[msg_queue->head];
switch (msg->type) {
case BFIN_IPI_RESCHEDULE:
scheduler_ipi();
break;
case BFIN_IPI_CALL_FUNC:
spin_unlock_irqrestore(&msg_queue->lock, flags);
ipi_call_function(cpu, msg);
Expand Down
13 changes: 8 additions & 5 deletions arch/cris/arch-v32/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,15 +342,18 @@ irqreturn_t crisv32_ipi_interrupt(int irq, void *dev_id)

ipi = REG_RD(intr_vect, irq_regs[smp_processor_id()], rw_ipi);

if (ipi.vector & IPI_SCHEDULE) {
scheduler_ipi();
}
if (ipi.vector & IPI_CALL) {
func(info);
func(info);
}
if (ipi.vector & IPI_FLUSH_TLB) {
if (flush_mm == FLUSH_ALL)
__flush_tlb_all();
else if (flush_vma == FLUSH_ALL)
if (flush_mm == FLUSH_ALL)
__flush_tlb_all();
else if (flush_vma == FLUSH_ALL)
__flush_tlb_mm(flush_mm);
else
else
__flush_tlb_page(flush_vma, flush_addr);
}

Expand Down
2 changes: 2 additions & 0 deletions arch/ia64/kernel/irq_ia64.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <linux/irq.h>
#include <linux/ratelimit.h>
#include <linux/acpi.h>
#include <linux/sched.h>

#include <asm/delay.h>
#include <asm/intrinsics.h>
Expand Down Expand Up @@ -496,6 +497,7 @@ ia64_handle_irq (ia64_vector vector, struct pt_regs *regs)
smp_local_flush_tlb();
kstat_incr_irqs_this_cpu(irq, desc);
} else if (unlikely(IS_RESCHEDULE(vector))) {
scheduler_ipi();
kstat_incr_irqs_this_cpu(irq, desc);
} else {
ia64_setreg(_IA64_REG_CR_TPR, vector);
Expand Down
10 changes: 9 additions & 1 deletion arch/ia64/xen/irq_xen.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,22 @@ static unsigned short saved_irq_cnt;
static int xen_slab_ready;

#ifdef CONFIG_SMP
#include <linux/sched.h>

/* Dummy stub. Though we may check XEN_RESCHEDULE_VECTOR before __do_IRQ,
* it ends up to issue several memory accesses upon percpu data and
* thus adds unnecessary traffic to other paths.
*/
static irqreturn_t
xen_dummy_handler(int irq, void *dev_id)
{
return IRQ_HANDLED;
}

static irqreturn_t
xen_resched_handler(int irq, void *dev_id)
{
scheduler_ipi();
return IRQ_HANDLED;
}

Expand All @@ -110,7 +118,7 @@ static struct irqaction xen_ipi_irqaction = {
};

static struct irqaction xen_resched_irqaction = {
.handler = xen_dummy_handler,
.handler = xen_resched_handler,
.flags = IRQF_DISABLED,
.name = "resched"
};
Expand Down
4 changes: 1 addition & 3 deletions arch/m32r/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,6 @@ void smp_send_reschedule(int cpu_id)
*
* Description: This routine executes on CPU which received
* 'RESCHEDULE_IPI'.
* Rescheduling is processed at the exit of interrupt
* operation.
*
* Born on Date: 2002.02.05
*
Expand All @@ -138,7 +136,7 @@ void smp_send_reschedule(int cpu_id)
*==========================================================================*/
void smp_reschedule_interrupt(void)
{
/* nothing to do */
scheduler_ipi();
}

/*==========================================================================*
Expand Down
2 changes: 2 additions & 0 deletions arch/mips/cavium-octeon/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ static irqreturn_t mailbox_interrupt(int irq, void *dev_id)

if (action & SMP_CALL_FUNCTION)
smp_call_function_interrupt();
if (action & SMP_RESCHEDULE_YOURSELF)
scheduler_ipi();

/* Check if we've been told to flush the icache */
if (action & SMP_ICACHE_FLUSH)
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/kernel/smtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,7 @@ static void post_direct_ipi(int cpu, struct smtc_ipi *pipi)

static void ipi_resched_interrupt(void)
{
/* Return from interrupt should be enough to cause scheduler check */
scheduler_ipi();
}

static void ipi_call_interrupt(void)
Expand Down
2 changes: 2 additions & 0 deletions arch/mips/mti-malta/malta-int.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,8 @@ static void ipi_call_dispatch(void)

static irqreturn_t ipi_resched_interrupt(int irq, void *dev_id)
{
scheduler_ipi();

return IRQ_HANDLED;
}

Expand Down
4 changes: 4 additions & 0 deletions arch/mips/pmc-sierra/yosemite/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ void titan_mailbox_irq(void)

if (status & 0x2)
smp_call_function_interrupt();
if (status & 0x4)
scheduler_ipi();
break;

case 1:
Expand All @@ -63,6 +65,8 @@ void titan_mailbox_irq(void)

if (status & 0x2)
smp_call_function_interrupt();
if (status & 0x4)
scheduler_ipi();
break;
}
}
Expand Down
2 changes: 2 additions & 0 deletions arch/mips/sgi-ip27/ip27-irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,10 @@ static void ip27_do_irq_mask0(void)
#ifdef CONFIG_SMP
if (pend0 & (1UL << CPU_RESCHED_A_IRQ)) {
LOCAL_HUB_CLR_INTR(CPU_RESCHED_A_IRQ);
scheduler_ipi();
} else if (pend0 & (1UL << CPU_RESCHED_B_IRQ)) {
LOCAL_HUB_CLR_INTR(CPU_RESCHED_B_IRQ);
scheduler_ipi();
} else if (pend0 & (1UL << CPU_CALL_A_IRQ)) {
LOCAL_HUB_CLR_INTR(CPU_CALL_A_IRQ);
smp_call_function_interrupt();
Expand Down
7 changes: 3 additions & 4 deletions arch/mips/sibyte/bcm1480/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <linux/delay.h>
#include <linux/smp.h>
#include <linux/kernel_stat.h>
#include <linux/sched.h>

#include <asm/mmu_context.h>
#include <asm/io.h>
Expand Down Expand Up @@ -189,10 +190,8 @@ void bcm1480_mailbox_interrupt(void)
/* Clear the mailbox to clear the interrupt */
__raw_writeq(((u64)action)<<48, mailbox_0_clear_regs[cpu]);

/*
* Nothing to do for SMP_RESCHEDULE_YOURSELF; returning from the
* interrupt will do the reschedule for us
*/
if (action & SMP_RESCHEDULE_YOURSELF)
scheduler_ipi();

if (action & SMP_CALL_FUNCTION)
smp_call_function_interrupt();
Expand Down
7 changes: 3 additions & 4 deletions arch/mips/sibyte/sb1250/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <linux/interrupt.h>
#include <linux/smp.h>
#include <linux/kernel_stat.h>
#include <linux/sched.h>

#include <asm/mmu_context.h>
#include <asm/io.h>
Expand Down Expand Up @@ -177,10 +178,8 @@ void sb1250_mailbox_interrupt(void)
/* Clear the mailbox to clear the interrupt */
____raw_writeq(((u64)action) << 48, mailbox_clear_regs[cpu]);

/*
* Nothing to do for SMP_RESCHEDULE_YOURSELF; returning from the
* interrupt will do the reschedule for us
*/
if (action & SMP_RESCHEDULE_YOURSELF)
scheduler_ipi();

if (action & SMP_CALL_FUNCTION)
smp_call_function_interrupt();
Expand Down
5 changes: 1 addition & 4 deletions arch/mn10300/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,14 +494,11 @@ void smp_send_stop(void)
* @irq: The interrupt number.
* @dev_id: The device ID.
*
* We need do nothing here, since the scheduling will be effected on our way
* back through entry.S.
*
* Returns IRQ_HANDLED to indicate we handled the interrupt successfully.
*/
static irqreturn_t smp_reschedule_interrupt(int irq, void *dev_id)
{
/* do nothing */
scheduler_ipi();
return IRQ_HANDLED;
}

Expand Down
5 changes: 1 addition & 4 deletions arch/parisc/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,7 @@ ipi_interrupt(int irq, void *dev_id)

case IPI_RESCHEDULE:
smp_debug(100, KERN_DEBUG "CPU%d IPI_RESCHEDULE\n", this_cpu);
/*
* Reschedule callback. Everything to be
* done is done by the interrupt return path.
*/
scheduler_ipi();
break;

case IPI_CALL_FUNC:
Expand Down
4 changes: 2 additions & 2 deletions arch/powerpc/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ void smp_message_recv(int msg)
generic_smp_call_function_interrupt();
break;
case PPC_MSG_RESCHEDULE:
/* we notice need_resched on exit */
scheduler_ipi();
break;
case PPC_MSG_CALL_FUNC_SINGLE:
generic_smp_call_function_single_interrupt();
Expand Down Expand Up @@ -146,7 +146,7 @@ static irqreturn_t call_function_action(int irq, void *data)

static irqreturn_t reschedule_action(int irq, void *data)
{
/* we just need the return path side effect of checking need_resched */
scheduler_ipi();
return IRQ_HANDLED;
}

Expand Down
6 changes: 3 additions & 3 deletions arch/s390/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,12 @@ static void do_ext_call_interrupt(unsigned int ext_int_code,
kstat_cpu(smp_processor_id()).irqs[EXTINT_IPI]++;
/*
* handle bit signal external calls
*
* For the ec_schedule signal we have to do nothing. All the work
* is done automatically when we return from the interrupt.
*/
bits = xchg(&S390_lowcore.ext_call_fast, 0);

if (test_bit(ec_schedule, &bits))
scheduler_ipi();

if (test_bit(ec_call_function, &bits))
generic_smp_call_function_interrupt();

Expand Down
2 changes: 2 additions & 0 deletions arch/sh/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <linux/module.h>
#include <linux/cpu.h>
#include <linux/interrupt.h>
#include <linux/sched.h>
#include <asm/atomic.h>
#include <asm/processor.h>
#include <asm/system.h>
Expand Down Expand Up @@ -323,6 +324,7 @@ void smp_message_recv(unsigned int msg)
generic_smp_call_function_interrupt();
break;
case SMP_MSG_RESCHEDULE:
scheduler_ipi();
break;
case SMP_MSG_FUNCTION_SINGLE:
generic_smp_call_function_single_interrupt();
Expand Down
6 changes: 5 additions & 1 deletion arch/sparc/include/asm/topology_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ static inline int pcibus_to_node(struct pci_bus *pbus)
#define smt_capable() (sparc64_multi_core)
#endif /* CONFIG_SMP */

#define cpu_coregroup_mask(cpu) (&cpu_core_map[cpu])
extern cpumask_t cpu_core_map[NR_CPUS];
static inline const struct cpumask *cpu_coregroup_mask(int cpu)
{
return &cpu_core_map[cpu];
}

#endif /* _ASM_SPARC64_TOPOLOGY_H */
4 changes: 3 additions & 1 deletion arch/sparc/kernel/smp_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ struct linux_prom_registers smp_penguin_ctable __cpuinitdata = { 0 };

void smp_send_reschedule(int cpu)
{
/* See sparc64 */
/*
* XXX missing reschedule IPI, see scheduler_ipi()
*/
}

void smp_send_stop(void)
Expand Down
1 change: 1 addition & 0 deletions arch/sparc/kernel/smp_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -1368,6 +1368,7 @@ void smp_send_reschedule(int cpu)
void __irq_entry smp_receive_signal_client(int irq, struct pt_regs *regs)
{
clear_softint(1 << irq);
scheduler_ipi();
}

/* This is a nop because we capture all other cpus
Expand Down
6 changes: 1 addition & 5 deletions arch/tile/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,8 @@ void flush_icache_range(unsigned long start, unsigned long end)
/* Called when smp_send_reschedule() triggers IRQ_RESCHEDULE. */
static irqreturn_t handle_reschedule_ipi(int irq, void *token)
{
/*
* Nothing to do here; when we return from interrupt, the
* rescheduling will occur there. But do bump the interrupt
* profiler count in the meantime.
*/
__get_cpu_var(irq_stat).irq_resched_count++;
scheduler_ipi();

return IRQ_HANDLED;
}
Expand Down
2 changes: 1 addition & 1 deletion arch/um/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ void IPI_handler(int cpu)
break;

case 'R':
set_tsk_need_resched(current);
scheduler_ipi();
break;

case 'S':
Expand Down
5 changes: 2 additions & 3 deletions arch/x86/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,14 +194,13 @@ static void native_stop_other_cpus(int wait)
}

/*
* Reschedule call back. Nothing to do,
* all the work is done automatically when
* we return from the interrupt.
* Reschedule call back.
*/
void smp_reschedule_interrupt(struct pt_regs *regs)
{
ack_APIC_irq();
inc_irq_stat(irq_resched_count);
scheduler_ipi();
/*
* KVM uses this interrupt to force a cpu out of guest mode
*/
Expand Down
5 changes: 2 additions & 3 deletions arch/x86/xen/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,12 @@ static irqreturn_t xen_call_function_interrupt(int irq, void *dev_id);
static irqreturn_t xen_call_function_single_interrupt(int irq, void *dev_id);

/*
* Reschedule call back. Nothing to do,
* all the work is done automatically when
* we return from the interrupt.
* Reschedule call back.
*/
static irqreturn_t xen_reschedule_interrupt(int irq, void *dev_id)
{
inc_irq_stat(irq_resched_count);
scheduler_ipi();

return IRQ_HANDLED;
}
Expand Down
Loading

0 comments on commit 80fe02b

Please sign in to comment.