LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: "Siddha, Suresh B" <suresh.b.siddha@intel.com>
Cc: nickpiggin@yahoo.com.au, vatsa@in.ibm.com, clameter@sgi.com,
	tglx@linutronix.de, arjan@linux.intel.com,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC] Patch: dynticks: idle load balancing
Date: Thu, 14 Dec 2006 00:13:16 +0100	[thread overview]
Message-ID: <20061213231316.GA13849@elte.hu> (raw)
In-Reply-To: <20061213224317.GA2986@elte.hu>


* Ingo Molnar <mingo@elte.hu> 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);
 }

  reply	other threads:[~2006-12-13 23:15 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-11 23:53 Siddha, Suresh B
2006-12-13 22:43 ` Ingo Molnar
2006-12-13 23:13   ` Ingo Molnar [this message]
2006-12-13 23:03     ` Siddha, Suresh B
2006-12-13 23:31       ` Ingo Molnar
2006-12-13 23:19         ` Siddha, Suresh B
2006-12-14  0:34           ` Ingo Molnar
2006-12-19 20:12           ` Ingo Molnar
2006-12-19 21:12             ` Siddha, Suresh B
2007-01-16 11:35               ` Ingo Molnar
2007-01-30 21:57                 ` Siddha, Suresh B
2007-02-07 22:19                   ` Siddha, Suresh B
2007-02-17  2:03                   ` [patch 1/2] sched: fix idle load balancing in softirqd context Siddha, Suresh B
2007-02-17  2:08                     ` [patch 2/2] sched: dynticks idle load balancing - v2 Siddha, Suresh B
2007-02-21 20:23                       ` Andrew Morton
2007-02-22  3:14                         ` Nick Piggin
2007-02-24  2:01                         ` [patch] sched: dynticks idle load balancing - v3 Siddha, Suresh B
2007-02-22  3:26                       ` [patch 2/2] sched: dynticks idle load balancing - v2 Nick Piggin
2007-02-22 22:33                         ` Siddha, Suresh B
2007-02-23  3:43                           ` Nick Piggin
2007-02-17 14:42                     ` [patch 1/2] sched: fix idle load balancing in softirqd context Steven Rostedt
2007-02-21  6:25                       ` Siddha, Suresh B
2007-02-21 20:13                     ` Andrew Morton
2006-12-13 23:48     ` [RFC] Patch: dynticks: idle load balancing Ingo Molnar
2006-12-20  0:49 ` Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061213231316.GA13849@elte.hu \
    --to=mingo@elte.hu \
    --cc=arjan@linux.intel.com \
    --cc=clameter@sgi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nickpiggin@yahoo.com.au \
    --cc=suresh.b.siddha@intel.com \
    --cc=tglx@linutronix.de \
    --cc=vatsa@in.ibm.com \
    --subject='Re: [RFC] Patch: dynticks: idle load balancing' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).