All of lore.kernel.org
 help / color / mirror / Atom feed
From: Srivatsa Vaddagiri <vatsa@in.ibm.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: torvalds@osdl.org, Ashok Raj <ashok.raj@intel.com>,
	nickpiggin@yahoo.com.au, Andrew Morton <akpm@osdl.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [CPU Hotplug PATCH] Restore Idle task's priority during CPU_DEAD notification
Date: Wed, 26 May 2004 17:21:36 +0530	[thread overview]
Message-ID: <20040526115136.GB20010@in.ibm.com> (raw)
In-Reply-To: <20040526112726.GA8499@elte.hu>

On Wed, May 26, 2004 at 01:27:26PM +0200, Ingo Molnar wrote:
> Looks good. A small nit: while your patch creates a perfectly correct
> idle thread too, i'd prefer the modified variant below. The
> __setscheduler() call is (technically) incorrect because in the
> SCHED_NORMAL case the prio should be zero. So it's a bit cleaner to set
> up the static priority to MAX_PRIO and then revert the policy to
> SCHED_NORMAL via __setscheduler(). Ok?

Fine. Since we will have to setup the static priority everytime CPU_DEAD is
invoked, would it make sense if we setup this static priority (once and for
all) in init_idle instead?

Untested patch below:


---

 linux-2.6.7-rc1-vatsa/kernel/sched.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff -puN kernel/sched.c~restore_idle_prio kernel/sched.c
--- linux-2.6.7-rc1/kernel/sched.c~restore_idle_prio	2004-05-25 17:04:19.000000000 +0530
+++ linux-2.6.7-rc1-vatsa/kernel/sched.c	2004-05-26 17:17:44.000000000 +0530
@@ -3246,7 +3246,7 @@ void __devinit init_idle(task_t *idle, i
 	idle_rq->curr = idle_rq->idle = idle;
 	deactivate_task(idle, rq);
 	idle->array = NULL;
-	idle->prio = MAX_PRIO;
+	idle->prio = idle->static_prio = MAX_PRIO;
 	idle->state = TASK_RUNNING;
 	set_task_cpu(idle, cpu);
 	double_rq_unlock(idle_rq, rq);
@@ -3568,7 +3568,7 @@ static int migration_call(struct notifie
 		/* Idle task back to normal (off runqueue, low prio) */
 		rq = task_rq_lock(rq->idle, &flags);
 		deactivate_task(rq->idle, rq);
-		__setscheduler(rq->idle, SCHED_NORMAL, MAX_PRIO);
+		__setscheduler(rq->idle, SCHED_NORMAL, 0);
 		task_rq_unlock(rq, &flags);
  		BUG_ON(rq->nr_running != 0);
 

_



-- 


Thanks and Regards,
Srivatsa Vaddagiri,
Linux Technology Center,
IBM Software Labs,
Bangalore, INDIA - 560017

      reply	other threads:[~2004-05-26 11:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <A28EFEDC5416054BA1026D892753E9AF059A50EC@orsmsx404.amr.corp.intel.com>
     [not found] ` <1085537205.2639.61.camel@bach>
2004-05-26  6:16   ` [CPU Hotplug PATCH] Restore Idle task's priority during CPU_DEAD notification Srivatsa Vaddagiri
2004-05-26 11:27     ` Ingo Molnar
2004-05-26 11:51       ` Srivatsa Vaddagiri [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=20040526115136.GB20010@in.ibm.com \
    --to=vatsa@in.ibm.com \
    --cc=akpm@osdl.org \
    --cc=ashok.raj@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=nickpiggin@yahoo.com.au \
    --cc=torvalds@osdl.org \
    /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.