mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Sébastien Dugué" <sebastien.dugue@bull.net>
To: Linux RT Users <linux-rt-users@vger.kernel.org>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
	Jean Pierre Dion <jean-pierre.dion@bull.net>,
	Darren Hart <dvhltc@us.ibm.com>,
	john stultz <johnstul@us.ibm.com>,
	Josh Triplett <josht@linux.vnet.ibm.com>
Subject: [PATCH RT] Fix RT balancing tasks pulling
Date: Tue, 24 Jul 2007 15:42:02 +0200	[thread overview]
Message-ID: <20070724154202.224f12e8@frecb000686.frec.bull.fr> (raw)



  Hi Ingo, Thomas,

  this one-liner fixes a bug in balance_rt_tasks() which sometimes manifests by
having a lower prio task being scheduled while a higher prio task is sitting
waiting on another runqueue.

  This is pretty hard to reproduce on low cpu count machines, for example, I
had to have sched_football run in a loop for ~38h before it failed on a dual HT
Xeon box.

  Sébastien.

---


  In the CPU loop in balance_rt_tasks(), the 'next' task pointer is only ever
updated if this_rq->lock has been dropped in double_lock_balance().

  This sometimes lead to 'this_cpu' pulling tasks that are only garanteed to
have a higher priority than the 'next' picked before the loop.

  Fix this to update 'next' to the last picked RT task.


Signed-off-by: Sébastien Dugué <sebastien.dugue@bull.net>

---
 kernel/sched.c |    8 ++++++++
 1 file changed, 8 insertions(+)

Index: linux-2.6.22.1-rt6/kernel/sched.c
===================================================================
--- linux-2.6.22.1-rt6.orig/kernel/sched.c	2007-07-24 11:34:18.000000000 +0200
+++ linux-2.6.22.1-rt6/kernel/sched.c	2007-07-24 11:34:35.000000000 +0200
@@ -1499,6 +1499,14 @@ static void balance_rt_tasks(struct rq *
 			 * in another runqueue. (low likelyhood
 			 * but possible)
 			 */
+
+			/*
+			 * Update next so that we won't pick a task
+			 * on another cpu with a priority lower (or equal)
+			 * than the one we just picked.
+			 */
+			next = p;
+
 		}
 		spin_unlock(&src_rq->lock);
 	}

             reply	other threads:[~2007-07-24 13:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-24 13:42 Sébastien Dugué [this message]
2007-07-25  7:27 ` Ingo Molnar
2007-07-30 21:50 ` Josh Triplett
2007-07-31 11:48   ` Sébastien Dugué
2007-08-01  0:18     ` Josh Triplett

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=20070724154202.224f12e8@frecb000686.frec.bull.fr \
    --to=sebastien.dugue@bull.net \
    --cc=dvhltc@us.ibm.com \
    --cc=jean-pierre.dion@bull.net \
    --cc=johnstul@us.ibm.com \
    --cc=josht@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®