Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755169AbbEBTXn (ORCPT ); Sat, 2 May 2015 15:23:43 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:45167 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752979AbbEBTXi (ORCPT ); Sat, 2 May 2015 15:23:38 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Wanpeng Li , Juri Lelli , "Peter Zijlstra (Intel)" , Kirill Tkhai , Juri Lelli , Ingo Molnar Subject: [PATCH 4.0 207/220] sched/deadline: Always enqueue on previous rq when dl_task_timer() fires Date: Sat, 2 May 2015 21:02:02 +0200 Message-Id: <20150502185903.216058575@linuxfoundation.org> X-Mailer: git-send-email 2.3.7 In-Reply-To: <20150502185854.333748961@linuxfoundation.org> References: <20150502185854.333748961@linuxfoundation.org> User-Agent: quilt/0.64 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1898 Lines: 60 4.0-stable review patch. If anyone has any objections, please let me know. ------------------ From: Juri Lelli commit 4cd57f97135840f637431c92380c8da3edbe44ed upstream. 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 Signed-off-by: Juri Lelli Signed-off-by: Peter Zijlstra (Intel) Acked-by: Kirill Tkhai Cc: Juri Lelli 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 Signed-off-by: Greg Kroah-Hartman --- kernel/sched/deadline.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/kernel/sched/deadline.c +++ b/kernel/sched/deadline.c @@ -514,7 +514,7 @@ static enum hrtimer_restart dl_task_time 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_time push_dl_task(rq); #endif unlock: - task_rq_unlock(rq, current, &flags); + task_rq_unlock(rq, p, &flags); return HRTIMER_NORESTART; } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/