linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel <linux-kernel@vger.kernel.org>, Ingo Molnar <mingo@elte.hu>
Cc: Dmitry Adamushko <dmitry.adamushko@gmail.com>,
	vatsa@linux.vnet.ibm.com, Balbir Singh <balbir@in.ibm.com>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Gregory Haskins <ghaskins@novell.com>
Subject: [PATCH 3/4 v2] SCHED - Only adjust overload state when changing
Date: Mon, 10 Dec 2007 22:00:36 -0500	[thread overview]
Message-ID: <20071211031458.726479121@goodmis.org> (raw)
In-Reply-To: 20071211030033.632581735@goodmis.org

[-- Attachment #1: sched-only-adjust-overload-state-when-changing.patch --]
[-- Type: text/plain, Size: 1173 bytes --]

From: Gregory Haskins <ghaskins@novell.com>

The overload set/clears were originally idempotent when this logic was first
implemented.  But that is no longer true due to the addition of the atomic
counter and this logic was never updated to work properly with that change.
So only adjust the overload state if it is actually changing to avoid
getting out of sync.

Signed-off-by: Gregory Haskins <ghaskins@novell.com>
---

 kernel/sched_rt.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Index: linux-sched/kernel/sched_rt.c
===================================================================
--- linux-sched.orig/kernel/sched_rt.c	2007-12-10 20:39:17.000000000 -0500
+++ linux-sched/kernel/sched_rt.c	2007-12-10 20:39:19.000000000 -0500
@@ -34,9 +34,11 @@ static inline void rt_clear_overload(str
 static void update_rt_migration(struct rq *rq)
 {
 	if (rq->rt.rt_nr_migratory && (rq->rt.rt_nr_running > 1)) {
-		rt_set_overload(rq);
-		rq->rt.overloaded = 1;
-	} else {
+		if (!rq->rt.overloaded) {
+			rt_set_overload(rq);
+			rq->rt.overloaded = 1;
+		}
+	} else if (rq->rt.overloaded) {
 		rt_clear_overload(rq);
 		rq->rt.overloaded = 0;
 	}

-- 

  parent reply	other threads:[~2007-12-11  3:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-11  3:00 [PATCH 0/4 v2] RT balance updates against sched-devel Steven Rostedt
2007-12-11  3:00 ` [PATCH 1/4 v2] Replace hooks with pre/post schedule and wakeup methods Steven Rostedt
2007-12-11  3:00 ` [PATCH 2/4 v2] added methods for sched_class changes Steven Rostedt
2007-12-11  3:00 ` Steven Rostedt [this message]
2007-12-11  3:00 ` [PATCH 4/4 v2] Subject: SCHED - Clean up some old cpuset logic Steven Rostedt
2007-12-11  8:05 ` [PATCH 0/4 v2] RT balance updates against sched-devel Ingo Molnar

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=20071211031458.726479121@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=balbir@in.ibm.com \
    --cc=dmitry.adamushko@gmail.com \
    --cc=ghaskins@novell.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=vatsa@linux.vnet.ibm.com \
    /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;
as well as URLs for NNTP newsgroup(s).