mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kirill Tkhai <ktkhai@parallels.com>
To: <linux-kernel@vger.kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@kernel.org>, Juri Lelli <juri.lelli@gmail.com>,
	<tkhai@yandex.ru>
Subject: [PATCH RESEND 2/2] sched/rt: Fix rt_prio()
Date: Wed, 4 Jun 2014 18:04:07 +0400	[thread overview]
Message-ID: <1401890647.4484.7.camel@tkhai> (raw)
In-Reply-To: <20140604124735.3951.61242.stgit@tkhai>


The set of rt_prio() contains dl_prio() subset. Fix that.

Signed-off-by: Kirill Tkhai <ktkhai@parallels.com>
CC: Juri Lelli <juri.lelli@gmail.com>
CC: Peter Zijlstra <peterz@infradead.org>
CC: Ingo Molnar <mingo@kernel.org>
---
 include/linux/sched/deadline.h |    8 +-------
 include/linux/sched/prio.h     |    8 +++++---
 include/linux/sched/rt.h       |    2 +-
 3 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/include/linux/sched/deadline.h b/include/linux/sched/deadline.h
index 9d303b8..e529305 100644
--- a/include/linux/sched/deadline.h
+++ b/include/linux/sched/deadline.h
@@ -1,13 +1,7 @@
 #ifndef _SCHED_DEADLINE_H
 #define _SCHED_DEADLINE_H
 
-/*
- * SCHED_DEADLINE tasks has negative priorities, reflecting
- * the fact that any of them has higher prio than RT and
- * NORMAL/BATCH tasks.
- */
-
-#define MAX_DL_PRIO		0
+#include <linux/sched/prio.h>
 
 static inline int dl_prio(int prio)
 {
diff --git a/include/linux/sched/prio.h b/include/linux/sched/prio.h
index d9cf5a5..0d6c552 100644
--- a/include/linux/sched/prio.h
+++ b/include/linux/sched/prio.h
@@ -6,18 +6,20 @@
 #define NICE_WIDTH	(MAX_NICE - MIN_NICE + 1)
 
 /*
- * Priority of a process goes from 0..MAX_PRIO-1, valid RT
- * priority is 0..MAX_RT_PRIO-1, and SCHED_NORMAL/SCHED_BATCH
+ * Priority of a process goes from MAX_DL_PRIO-1..MAX_PRIO-1,
+ * SCHED_DEADLINE tasks have negative priorities, valid RT
+ * value is 0..MAX_RT_PRIO-1, and SCHED_NORMAL/SCHED_BATCH
  * tasks are in the range MAX_RT_PRIO..MAX_PRIO-1. Priority
  * values are inverted: lower p->prio value means higher priority.
  *
  * The MAX_USER_RT_PRIO value allows the actual maximum
  * RT priority to be separate from the value exported to
  * user-space.  This allows kernel threads to set their
- * priority to a value higher than any user task. Note:
+ * priority to a value higher than any user RT task. Note:
  * MAX_RT_PRIO must not be smaller than MAX_USER_RT_PRIO.
  */
 
+#define MAX_DL_PRIO		0
 #define MAX_USER_RT_PRIO	100
 #define MAX_RT_PRIO		MAX_USER_RT_PRIO
 
diff --git a/include/linux/sched/rt.h b/include/linux/sched/rt.h
index 6341f5b..dca43ed 100644
--- a/include/linux/sched/rt.h
+++ b/include/linux/sched/rt.h
@@ -5,7 +5,7 @@
 
 static inline int rt_prio(int prio)
 {
-	if (unlikely(prio < MAX_RT_PRIO))
+	if (unlikely(prio < MAX_RT_PRIO && prio >= MAX_DL_PRIO))
 		return 1;
 	return 0;
 }






      parent reply	other threads:[~2014-06-04 14:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20140604124735.3951.61242.stgit@tkhai>
2014-06-04 12:57 ` [PATCH 1/2] sched/dl: Add necessary dl_{task,prio} Kirill Tkhai
2014-06-04 12:59 ` [PATCH 2/2] sched/rt: Fix rt_prio() Kirill Tkhai
2014-06-04 14:04 ` [PATCH RESEND 1/2] sched/dl: Add necessary dl_{task,prio} Kirill Tkhai
2014-06-04 14:04 ` Kirill Tkhai [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=1401890647.4484.7.camel@tkhai \
    --to=ktkhai@parallels.com \
    --cc=juri.lelli@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tkhai@yandex.ru \
    /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

all inboxes | Powered by JetHome®