public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Juri Lelli <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: peterz@infradead.org, wanpeng.li@linux.intel.com,
	ktkhai@parallels.com, mingo@kernel.org, juri.lelli@arm.com,
	linux-kernel@vger.kernel.org, hpa@zytor.com, tglx@linutronix.de,
	juri.lelli@gmail.com
Subject: [tip:sched/core] sched/deadline: Always enqueue on previous rq when dl_task_timer() fires
Date: Thu, 2 Apr 2015 11:46:47 -0700	[thread overview]
Message-ID: <tip-4cd57f97135840f637431c92380c8da3edbe44ed@git.kernel.org> (raw)
In-Reply-To: <1427792017-7356-1-git-send-email-juri.lelli@arm.com>

Commit-ID:  4cd57f97135840f637431c92380c8da3edbe44ed
Gitweb:     http://git.kernel.org/tip/4cd57f97135840f637431c92380c8da3edbe44ed
Author:     Juri Lelli <juri.lelli@arm.com>
AuthorDate: Tue, 31 Mar 2015 09:53:36 +0100
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 2 Apr 2015 17:42:56 +0200

sched/deadline: Always enqueue on previous rq when dl_task_timer() fires

dl_task_timer() may fire on a different rq from where a task was removed
after throttling. Since the call path is:

  dl_task_timer() ->
    enqueue_task_dl() ->
      enqueue_dl_entity() ->
        replenish_dl_entity()

and replenish_dl_entity() uses dl_se's rq, we can't use current's rq
in dl_task_timer(), but we need to lock the task's previous one.

Tested-by: Wanpeng Li <wanpeng.li@linux.intel.com>
Signed-off-by: Juri Lelli <juri.lelli@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Kirill Tkhai <ktkhai@parallels.com>
Cc: Juri Lelli <juri.lelli@gmail.com>
Fixes: 3960c8c0c789 ("sched: Make dl_task_time() use task_rq_lock()")
Link: http://lkml.kernel.org/r/1427792017-7356-1-git-send-email-juri.lelli@arm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 kernel/sched/deadline.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index 5e2f99b..9d3ad64 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -514,7 +514,7 @@ static enum hrtimer_restart dl_task_timer(struct hrtimer *timer)
 	unsigned long flags;
 	struct rq *rq;
 
-	rq = task_rq_lock(current, &flags);
+	rq = task_rq_lock(p, &flags);
 
 	/*
 	 * We need to take care of several possible races here:
@@ -569,7 +569,7 @@ static enum hrtimer_restart dl_task_timer(struct hrtimer *timer)
 		push_dl_task(rq);
 #endif
 unlock:
-	task_rq_unlock(rq, current, &flags);
+	task_rq_unlock(rq, p, &flags);
 
 	return HRTIMER_NORESTART;
 }

      parent reply	other threads:[~2015-04-02 18:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-31  8:53 [PATCH] sched/deadline: always enqueue on previous rq when dl_task_timer fires Juri Lelli
2015-03-31  8:53 ` [PATCH] sched/core: check for available -dl bandwidth in cpuset_cpu_inactive Juri Lelli
2015-04-02 18:47   ` [tip:sched/core] sched/core: Check for available DL bandwidth in cpuset_cpu_inactive() tip-bot for Juri Lelli
2015-04-03  8:42     ` Borislav Petkov
2015-04-03 14:21       ` Peter Zijlstra
2015-04-03 15:26         ` Borislav Petkov
2015-04-02 18:46 ` tip-bot for Juri Lelli [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=tip-4cd57f97135840f637431c92380c8da3edbe44ed@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=hpa@zytor.com \
    --cc=juri.lelli@arm.com \
    --cc=juri.lelli@gmail.com \
    --cc=ktkhai@parallels.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=wanpeng.li@linux.intel.com \
    /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