public inbox for linux-kernel@vger.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: change_prio_bias_only_if_queued
Date: Mon, 23 May 2005 19:28:10 +1000	[thread overview]
Message-ID: <200505231928.13168.kernel@kolivas.org> (raw)
In-Reply-To: <200505211500.42527.kernel@kolivas.org>


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

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.

Con
---


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

prio_bias should only be adjusted in set_user_nice if p is actually currently
queued.

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-21 14:25:07.000000000 +1000
+++ linux-2.6.12-rc4-mm2/kernel/sched.c	2005-05-23 19:23:10.000000000 +1000
@@ -3399,25 +3399,24 @@ void set_user_nice(task_t *p, long nice)
 	 * not SCHED_NORMAL:
 	 */
 	if (rt_task(p)) {
-		dec_prio_bias(rq, p->static_prio);
 		p->static_prio = NICE_TO_PRIO(nice);
-		inc_prio_bias(rq, p->static_prio);
 		goto out_unlock;
 	}
 	array = p->array;
-	if (array)
+	if (array) {
 		dequeue_task(p, array);
+		dec_prio_bias(rq, p->static_prio);
+	}
 
 	old_prio = p->prio;
 	new_prio = NICE_TO_PRIO(nice);
 	delta = new_prio - old_prio;
-	dec_prio_bias(rq, p->static_prio);
 	p->static_prio = NICE_TO_PRIO(nice);
-	inc_prio_bias(rq, p->static_prio);
 	p->prio += delta;
 
 	if (array) {
 		enqueue_task(p, array);
+		inc_prio_bias(rq, p->static_prio);
 		/*
 		 * If the task increased its priority or is running and
 		 * lowered its priority, then reschedule its CPU:

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

  reply	other threads:[~2005-05-23  9:28 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                   ` Con Kolivas [this message]
2005-05-23 10:07                     ` [PATCH] SCHED: account_rt_tasks_in_prio_bias Con Kolivas

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=200505231928.13168.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox