From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932538AbcH2TJE (ORCPT ); Mon, 29 Aug 2016 15:09:04 -0400 Received: from mail.konkuk.ac.kr ([202.30.38.143]:41944 "HELO mail.konkuk.ac.kr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751691AbcH2TJC (ORCPT ); Mon, 29 Aug 2016 15:09:02 -0400 X-MsgID: 1472497740717843.0.mail Message-ID: <1472497740717843.0.mail@mail> Y-MAIL-CLASS: None X-RECEIVED-IP: 202.30.38.143 Y-Message-ID: <1D95776B8F994057815591B79AEDC1BC@In9PC> Reply-To: "Yin-goo Yim" From: "Yin-goo Yim" To: "Andreas Mohr" Cc: "Dongsheng Yang" , "Thomas Gleixner" , , , , , References: <1472186868308057.0.mail@mail> In-Reply-To: <1472186868308057.0.mail@mail> Subject: Re: [PATCH] sched: Fix rt_task to work properly Date: Tue, 30 Aug 2016 04:08:55 +0900 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 X-RFC2646: Format=Flowed; Original Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thank you for your immediate response. > AFAICS this change is a larger layer violation (dependency issue) > since AFAIK prio.h is a generic, common base header > which is to provide priority definitions > common to *all* of the > more specific scheduler sub handling > (deadline, rt, ...), > which thus should not have to aggregate > any specific knowledge whatsoever about > various scheduler sub type specific handling. We agree that the prio.h file has to be generic, but we thought that adding the priority information of deadline scheduler (i.e., #define MAX_DL_PRIO 0) to this file should be fine, because prio.h already has the priority information for cfs and rt schedulers (i.e., MAX_PRIO and MAX_RT_PRIO). > rt_prio() quite likely is to be seen as an *rt-specific* API > since it is defined in the *rt-specific* rt.h header. > IOW, rt_prio() is *not to be used* for any areas where we > do not have an RT case > (quite certainly header docs should be added to rt_prio() > to definitely emphasize this fact, > maybe something like > "Note that since this is an RT API it is meaningful for RT tasks only"). The rt_prio() function returns 1 or 0 according to whether or not the corresponding process is an rt task. Thus, we believe that rt_prio() is a suitable function to determine if a task is rt one, and can be called even for non-rt tasks. Indeed we can easily find examples where rt_prio()/rt_task() is called for an arbitrary process without limiting to rt tasks (e.g., sched_fork()). Though our initial intention was to fix the origin of the problem, if you/we are not convinced of our patch due to dependency issues, we can reinforce the conditional statement in tg_has_rt_tasks() by adding !dl_task(p) as follows: if (!dl_task(p) && rt_task(p) && task_group(p) == tg) In this manner, we can avoid modifying the header files in include/linux/sched/, while having the same effect with respect to cgroup. Thanks, Yin-goo Yim