Re: [RFC] Patch: dynticks: idle load balancing




* Ingo Molnar <mingo@xxxxxxx> wrote:

Appended patch attempts to fix the process idle load balancing in
the presence of dynticks. cpus for which ticks are stopped will
sleep till the next event wakes it up. Potentially these sleeps can
be for large durations and during which today, there is no idle load
balancing being done. There was some discussion happened(last year)
on this topic on lkml, where two main approaches were gettting
debated. One is to back off the idle load balancing for bigger
intervals and the second is a watchdog mechanism where the busy cpu
will trigger the load balance on an idle cpu. Both of these
mechanisms have its drawbacks.

nice work! I have added your patch to -rt. Btw., it needs the patch
below to work on 64-bit.

there's another bug as well: in schedule() resched_cpu() is called with
the current runqueue held in two places, which is deadlock potential.
The easiest fix for this is to use trylock - find the patch for that.
This is a hint only anyway - and if a CPU is idle its runqueue will be
lockable. (fixing it via double-locking is easy in the first call site,
but the second one looks harder)

Ingo

Index: linux/kernel/sched.c
===================================================================
--- linux.orig/kernel/sched.c
+++ linux/kernel/sched.c
@@ -1167,12 +1167,14 @@ static void resched_task(struct task_str
if (!tsk_is_polling(p))
smp_send_reschedule(cpu);
}
+
static void resched_cpu(int cpu)
{
struct rq *rq = cpu_rq(cpu);
- unsigned int flags;
+ unsigned long flags;

- spin_lock_irqsave(&rq->lock, flags);
+ if (!spin_trylock_irqsave(&rq->lock, flags))
+ return;
resched_task(cpu_curr(cpu));
spin_unlock_irqrestore(&rq->lock, flags);
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: cpufreq est and Enhanced Sleep (Cx) States for Intel Core and above
    ... Adam McDougall wrote: ... >> Another thing I wish could work is the Enhanced cpu Sleep States; ... The major reason being that the acpi cpu> driver does not support well multiprocessor systems. ... I've not updated the patch since then so> it might or might not apply cleanly to a recent current. ...
    (freebsd-current)
  • Re: SMP cpu deep sleep
    ... >> extra heat and power consuption even on idle load. ... > With Rusty's Hotplug CPU, a userspace script should be able to do this ... How much time does it take to take the cpu up again? ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • Re: RT patch acceptance (scheduler)
    ... > lock up the CPU in IRQ mode for human-perceptible time, ... For non-DMA IDE access data copies are CPU driven ... which can create tons of latency problems for that case. ... I suggest that you read the patch for the answer to softirq ...
    (Linux-Kernel)
  • Re: better wake-balancing: respin
    ... >>I guess I missed the objection for dropping the patch. ... correlation between the CPU the interrupt arrives on and the CPU the ... There is no point in immediate balancing either: ... If this patch hurts other workloads (and please ...
    (Linux-Kernel)
  • Re: Re-entrancy???
    ... Sleep calls will just slow the application down. ... Whether or not PeekMessage is occuring in DoEvents ... has no impact on the overall CPU utilization. ... correctly, using the timeXXXX-APIs. ...
    (microsoft.public.vb.general.discussion)