From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754178AbXJWDaf (ORCPT ); Mon, 22 Oct 2007 23:30:35 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752181AbXJWD3l (ORCPT ); Mon, 22 Oct 2007 23:29:41 -0400 Received: from ms-smtp-04.nyroc.rr.com ([24.24.2.58]:50303 "EHLO ms-smtp-04.nyroc.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751916AbXJWD3h (ORCPT ); Mon, 22 Oct 2007 23:29:37 -0400 Message-Id: <20071023032916.963188616@goodmis.org> References: <20071023025900.927578809@goodmis.org> User-Agent: quilt/0.46-1 Date: Mon, 22 Oct 2007 22:59:06 -0400 From: Steven Rostedt To: LKML , RT Cc: Linus Torvalds , Andrew Morton , Ingo Molnar , Dmitry Adamushko , Paul Jackson , Gregory Haskins , Peter Zijlstra Subject: [PATCH -v2 6/7] wake up balance RT Content-Disposition: inline; filename=rt-balance-wakeup.patch Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org This patch adds pushing of overloaded RT tasks from a runqueue that is having tasks (most likely RT tasks) added to the run queue. TODO: We don't cover the case of waking of new RT tasks (yet). Signed-off-by: Steven Rostedt --- kernel/sched.c | 2 ++ kernel/sched_rt.c | 12 ++++++++++++ 2 files changed, 14 insertions(+) Index: linux-test.git/kernel/sched_rt.c =================================================================== --- linux-test.git.orig/kernel/sched_rt.c 2007-10-22 22:37:28.000000000 -0400 +++ linux-test.git/kernel/sched_rt.c 2007-10-22 22:38:04.000000000 -0400 @@ -559,9 +559,21 @@ static void schedule_tail_balance_rt(str spin_unlock_irq(&rq->lock); } } + +static void wakeup_balance_rt(struct rq *rq, struct task_struct *p) +{ + if (unlikely(rt_task(p)) && + (p->prio >= rq->curr->prio)) { + /* pull_rt_task needs task to be running */ + p->state = TASK_RUNNING; + push_rt_tasks(rq); + } +} + #else /* CONFIG_SMP */ # define schedule_tail_balance_rt(rq) do { } while (0) # define schedule_balance_rt(rq) do { } while (0) +# define wakeup_balance_rt(rq, p) do { } while (0) #endif /* CONFIG_SMP */ Index: linux-test.git/kernel/sched.c =================================================================== --- linux-test.git.orig/kernel/sched.c 2007-10-22 22:37:28.000000000 -0400 +++ linux-test.git/kernel/sched.c 2007-10-22 22:38:04.000000000 -0400 @@ -22,6 +22,7 @@ * by Peter Williams * 2007-05-06 Interactivity improvements to CFS by Mike Galbraith * 2007-07-01 Group scheduling enhancements by Srivatsa Vaddagiri + * 2007-10-22 RT overload balancing by Steven Rostedt */ #include @@ -1614,6 +1615,7 @@ out_activate: update_rq_clock(rq); activate_task(rq, p, 1); check_preempt_curr(rq, p); + wakeup_balance_rt(rq, p); success = 1; out_running: --