The patch titled sched: fix idle load balancing in softirqd context has been added to the -mm tree. Its filename is sched-fix-idle-load-balancing-in-softirqd-context.patch *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: sched: fix idle load balancing in softirqd context From: "Siddha, Suresh B" <suresh.b.siddha@xxxxxxxxx> Periodic load balancing in recent kernels happen in the softirq. In certain -rt configurations, these softirqs are handled in softirqd context. And hence the check for idle processor was always returning busy (as nr_running > 1). This patch captures the idle information at the tick and passes this info to softirq context through an element 'idle_at_tick' in rq. Signed-off-by: Suresh Siddha <suresh.b.siddha@xxxxxxxxx> Cc: Ingo Molnar <mingo@xxxxxxx> Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx> Cc: Nick Piggin <nickpiggin@xxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- kernel/sched.c | 12 +++++------- 1 files changed, 5 insertions(+), 7 deletions(-) diff -puN kernel/sched.c~sched-fix-idle-load-balancing-in-softirqd-context kernel/sched.c --- a/kernel/sched.c~sched-fix-idle-load-balancing-in-softirqd-context +++ a/kernel/sched.c @@ -223,6 +223,7 @@ struct rq { unsigned long raw_weighted_load; #ifdef CONFIG_SMP unsigned long cpu_load[3]; + unsigned char idle_at_tick; #endif unsigned long long nr_switches; @@ -2944,12 +2945,7 @@ static void run_rebalance_domains(struct struct rq *this_rq = cpu_rq(this_cpu); unsigned long interval; struct sched_domain *sd; - /* - * We are idle if there are no processes running. This - * is valid even if we are the idle process (SMT). - */ - enum idle_type idle = !this_rq->nr_running ? - SCHED_IDLE : NOT_IDLE; + enum idle_type idle = this_rq->idle_at_tick ? SCHED_IDLE : NOT_IDLE; /* Earliest time when we have to call run_rebalance_domains again */ unsigned long next_balance = jiffies + 60*HZ; @@ -3236,17 +3232,19 @@ void scheduler_tick(void) unsigned long long now = sched_clock(); struct task_struct *p = current; int cpu = smp_processor_id(); + int idle_at_tick = idle_cpu(cpu); struct rq *rq = cpu_rq(cpu); update_cpu_clock(p, rq, now); - if (p == rq->idle) + if (idle_at_tick) /* Task on the idle queue */ wake_priority_sleeper(rq); else task_running_tick(rq, p); #ifdef CONFIG_SMP update_load(rq); + rq->idle_at_tick = idle_at_tick; if (time_after_eq(jiffies, rq->next_balance)) raise_softirq(SCHED_SOFTIRQ); #endif _ Patches currently in -mm which might be from suresh.b.siddha@xxxxxxxxx are sched-fix-idle-load-balancing-in-softirqd-context.patch sched-dynticks-idle-load-balancing-v2.patch mm-only-sched-add-a-few-scheduler-event-counters.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html