public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: jia zhang <jia.zhang2008@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@elte.hu>
Subject: [PATCH] sched: inaccurate calculation for normal priority
Date: Mon, 24 Nov 2008 20:05:01 +0800	[thread overview]
Message-ID: <492A986D.8030809@gmail.com> (raw)


Here we should check to see if the task is a rt ktherad or normal rt process, although right now MAX_USER_RT_PRIO is equal MAX_RT_PRIO.

Signed-off-by: jia zhang <jia.zhang2008@gmail.com>
---
 b/kernel/sched.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/sched.c b/kernel/sched.c
index 9b1e793..b3038e4 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -1711,7 +1711,8 @@ static inline int normal_prio(struct task_struct *p)
 	int prio;
 
 	if (task_has_rt_policy(p))
-		prio = MAX_RT_PRIO-1 - p->rt_priority;
+		prio = p->mm ? MAX_USER_RT_PRIO-1 - p->rt_priority :
+			MAX_RT_PRIO-1 - p->rt_priority;
 	else
 		prio = __normal_prio(p);
 	return prio;


                 reply	other threads:[~2008-11-24 12:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=492A986D.8030809@gmail.com \
    --to=jia.zhang2008@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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