From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935590AbcIROXX (ORCPT ); Sun, 18 Sep 2016 10:23:23 -0400 Received: from mail.konkuk.ac.kr ([202.30.38.143]:45826 "HELO mail.konkuk.ac.kr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1756138AbcIROXO (ORCPT ); Sun, 18 Sep 2016 10:23:14 -0400 X-MsgID: 1474208588556845.0.mail Message-ID: <1474208588556845.0.mail@mail> Y-MAIL-CLASS: None X-RECEIVED-IP: 202.30.38.143 Y-Message-ID: From: "yingooyim" To: , , Cc: , "LKML" , Subject: [PATCH] cgroup/cpu: Fix tg_has_rt_task() malfunction Date: Sun, 18 Sep 2016 23:23:10 +0900 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="UTF-8"; reply-type=original Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 16.4.3528.331 X-MimeOLE: Produced By Microsoft MimeOLE V16.4.3528.331 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, I am a graduate student of System Software Lab. at Konkuk University (http://sslab.konkuk.ac.kr). This patch is to fix the malfunction of tg_has_rt_tasks(). The tg_has_rt_tasks() function is supposed to determine whether a task group includes an "rt task" or not. However, it returns true for "dl task" too. The origin of this problem is that rt_task() called by tg_has_rt_tasks() returns true for dl tasks. Because of this problem, tg_rt_schedulable() that calls tg_has_rt_tasks() returns –EBUSY if we try to initialize an rt task group, while a dl task is running. That is, you cannot run an rt task group when there exists a dl task in the system. Our patch provided in this post simply makes the tg_has_rt_tasks() function return false for dl tasks by calling dl_task() in the conditional statement. Previously we have provided another patch for rt_task() (more precisely rt_prio()) to resolve this problem as follows: https://patchwork.kernel.org/patch/9299267/ However, a dependency issue were raised. So, we think that it is better to modify tg_has_rt_tasks() instead of rt_task() itself. Signed-off-by: Yin-goo Yim ---- kernel/sched/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 2a906f2..ee5ab2f 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -7846,7 +7846,7 @@ static inline int tg_has_rt_tasks(struct task_group *tg) return 0; for_each_process_thread(g, p) { - if (rt_task(p) && task_group(p) == tg) + if (rt_task(p) && !dl_task(p) && task_group(p) == tg) return 1; }