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 1/2] sched/dl: Add necessary dl_{task,prio}
Date: Wed, 4 Jun 2014 18:04:02 +0400	[thread overview]
Message-ID: <1401890642.4484.6.camel@tkhai> (raw)
In-Reply-To: <20140604124735.3951.61242.stgit@tkhai>


Add some symmetric to rt checks.

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>
---
 kernel/locking/mutex.c |    8 +++++---
 kernel/sched/core.c    |    4 ++--
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/kernel/locking/mutex.c b/kernel/locking/mutex.c
index bc73d33..cb9f381 100644
--- a/kernel/locking/mutex.c
+++ b/kernel/locking/mutex.c
@@ -21,6 +21,7 @@
 #include <linux/ww_mutex.h>
 #include <linux/sched.h>
 #include <linux/sched/rt.h>
+#include <linux/sched/deadline.h>
 #include <linux/export.h>
 #include <linux/spinlock.h>
 #include <linux/interrupt.h>
@@ -459,10 +460,11 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass,
 		/*
 		 * When there's no owner, we might have preempted between the
 		 * owner acquiring the lock and setting the owner field. If
-		 * we're an RT task that will live-lock because we won't let
-		 * the owner complete.
+		 * we're an RT or DL task that will live-lock because we won't
+		 * let the owner complete.
 		 */
-		if (!owner && (need_resched() || rt_task(task)))
+		if (!owner &&
+		    (need_resched() || rt_task(task) || dl_task(task)))
 			break;
 
 		/*
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 240aa83..ba7617a 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -962,11 +962,11 @@ static int effective_prio(struct task_struct *p)
 {
 	p->normal_prio = normal_prio(p);
 	/*
-	 * If we are RT tasks or we were boosted to RT priority,
+	 * If we are RT or DL tasks or we were boosted to RT or DL priority,
 	 * keep the priority unchanged. Otherwise, update priority
 	 * to the normal priority:
 	 */
-	if (!rt_prio(p->prio))
+	if (!rt_prio(p->prio) && !dl_prio(p->prio))
 		return p->normal_prio;
 	return p->prio;
 }





  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 " Kirill Tkhai
2014-06-04 12:59 ` [PATCH 2/2] sched/rt: Fix rt_prio() Kirill Tkhai
2014-06-04 14:04 ` Kirill Tkhai [this message]
2014-06-04 14:04 ` [PATCH RESEND " Kirill Tkhai

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=1401890642.4484.6.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®