sched: RT-balance, only adjust overload state when changing
authorGregory Haskins <ghaskins@novell.com>
Fri, 25 Jan 2008 20:08:23 +0000 (21:08 +0100)
committerIngo Molnar <mingo@elte.hu>
Fri, 25 Jan 2008 20:08:23 +0000 (21:08 +0100)
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>
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/sched_rt.c

index 57fa3d96847bb505320f65ad137528d21a7c1949..a386758ffebb14c701a3cca37cdb9962162c71c9 100644 (file)
@@ -34,9 +34,11 @@ static inline void rt_clear_overload(struct rq *rq)
 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;
        }