All of lore.kernel.org
 help / color / mirror / Atom feed
From: Con Kolivas <kernel@kolivas.org>
To: AndrewMorton <akpm@osdl.org>
Cc: "Ingo Molnar" <mingo@elte.hu>,
	ck@vds.kolivas.org, "Markus Törnqvist" <mjt@nysv.org>,
	"Carlos Carvalho" <carlos@fisica.ufpr.br>,
	linux-kernel@vger.kernel.org,
	"Peter Williams" <pwil3058@bigpond.net.au>
Subject: [PATCH] SCHED: account_rt_tasks_in_prio_bias
Date: Mon, 23 May 2005 20:07:13 +1000	[thread overview]
Message-ID: <200505232007.16908.kernel@kolivas.org> (raw)
In-Reply-To: <200505231928.13168.kernel@kolivas.org>


[-- Attachment #1.1: Type: text/plain, Size: 542 bytes --]

On Mon, 23 May 2005 19:28, Con Kolivas wrote:
> On Sat, 21 May 2005 15:00, Con Kolivas wrote:
> > Ok I've respun the smp nice support for the cpu scheduler modifications
> > that are in current -mm. Tested on 2.6.12-rc4-mm2 on 4x and seems to work
> > fine.
>
> Thanks to Peter Williams for noting I should only change the prio_bias if
> the task is queued in set_user_nice.

And for completeness the effect of real time tasks' real time priority level 
should be considered in prio_bias instead of their nice level.

Con
---


[-- Attachment #1.2: account_rt_tasks_in_prio_bias.diff --]
[-- Type: text/x-diff, Size: 1818 bytes --]

Real time tasks' effect on prio_bias should be based on their real time
priority level instead of their static_prio which is based on nice.

Signed-off-by: Con Kolivas <kernel@kolivas.org>

Index: linux-2.6.12-rc4-mm2/kernel/sched.c
===================================================================
--- linux-2.6.12-rc4-mm2.orig/kernel/sched.c	2005-05-23 19:23:10.000000000 +1000
+++ linux-2.6.12-rc4-mm2/kernel/sched.c	2005-05-23 19:59:45.000000000 +1000
@@ -659,21 +659,21 @@ static int effective_prio(task_t *p)
 }
 
 #ifdef CONFIG_SMP
-static inline void inc_prio_bias(runqueue_t *rq, int static_prio)
+static inline void inc_prio_bias(runqueue_t *rq, int prio)
 {
-	rq->prio_bias += MAX_PRIO - static_prio;
+	rq->prio_bias += MAX_PRIO - prio;
 }
 
-static inline void dec_prio_bias(runqueue_t *rq, int static_prio)
+static inline void dec_prio_bias(runqueue_t *rq, int prio)
 {
-	rq->prio_bias -= MAX_PRIO - static_prio;
+	rq->prio_bias -= MAX_PRIO - prio;
 }
 #else
-static inline void inc_prio_bias(runqueue_t *rq, int static_prio)
+static inline void inc_prio_bias(runqueue_t *rq, int prio)
 {
 }
 
-static inline void dec_prio_bias(runqueue_t *rq, int static_prio)
+static inline void dec_prio_bias(runqueue_t *rq, int prio)
 {
 }
 #endif
@@ -681,13 +681,19 @@ static inline void dec_prio_bias(runqueu
 static inline void inc_nr_running(task_t *p, runqueue_t *rq)
 {
 	rq->nr_running++;
-	inc_prio_bias(rq, p->static_prio);
+	if (rt_task(p))
+		inc_prio_bias(rq, p->prio);
+	else
+		inc_prio_bias(rq, p->static_prio);
 }
 
 static inline void dec_nr_running(task_t *p, runqueue_t *rq)
 {
 	rq->nr_running--;
-	dec_prio_bias(rq, p->static_prio);
+	if (rt_task(p))
+		dec_prio_bias(rq, p->prio);
+	else
+		dec_prio_bias(rq, p->static_prio);
 }
 
 /*

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

      reply	other threads:[~2005-05-23 10:07 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-07 13:42 [PATCH] implement nice support across physical cpus on SMP Con Kolivas
2005-05-07 17:59 ` Carlos Carvalho
2005-05-07 21:45   ` Con Kolivas
2005-05-09 11:24 ` Markus   Törnqvist
2005-05-09 11:28   ` [ck] " Markus   Törnqvist
2005-05-09 11:47   ` Con Kolivas
2005-05-09 18:55     ` Markus   Törnqvist
2005-05-09 23:54     ` Carlos Carvalho
2005-05-11  2:56       ` Con Kolivas
2005-05-11  3:04       ` [SMP NICE] [PATCH 1/2] SCHED: Implement " Con Kolivas
2005-05-11  3:05         ` [SMP NICE] [PATCH 2/2] SCHED: Make SMP nice a config option Con Kolivas
2005-05-11  7:20           ` Ingo Molnar
2005-05-12 10:49             ` Con Kolivas
2005-05-16 11:33         ` [SMP NICE] [PATCH] SCHED: Implement nice support across physical cpus on SMP Con Kolivas
2005-05-16 18:31           ` Markus   Törnqvist
2005-05-17 13:39           ` Carlos Carvalho
2005-05-18 11:30             ` Markus   Törnqvist
2005-05-18 13:45               ` Con Kolivas
2005-05-21  5:00                 ` Con Kolivas
2005-05-23  9:28                   ` [PATCH] SCHED: change_prio_bias_only_if_queued Con Kolivas
2005-05-23 10:07                     ` Con Kolivas [this message]

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=200505232007.16908.kernel@kolivas.org \
    --to=kernel@kolivas.org \
    --cc=akpm@osdl.org \
    --cc=carlos@fisica.ufpr.br \
    --cc=ck@vds.kolivas.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mjt@nysv.org \
    --cc=pwil3058@bigpond.net.au \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.