[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AANLkTinsdFAkSouApSYDehtMEA41POWYF3dKvrMTO1Q9@mail.gmail.com>
Date: Thu, 13 Jan 2011 14:02:19 +0800
From: Yong Zhang <yong.zhang0@...il.com>
To: Mike Galbraith <efault@....de>
Cc: bharata@...ux.vnet.ibm.com,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Ingo Molnar <mingo@...e.hu>, linux-kernel@...r.kernel.org
Subject: Re: [patch] Re: autogroup: sched_setscheduler() fails
On Thu, Jan 13, 2011 at 1:59 PM, Yong Zhang <yong.zhang0@...il.com> wrote:
> On Thu, Jan 13, 2011 at 11:54 AM, Mike Galbraith <efault@....de> wrote:
>> sched, autogroup: fix CONFIG_RT_GROUP_SCHED sched_setscheduler() failure.
>>
>> If CONFIG_RT_GROUP_SCHED is set, __sched_setscheduler() fails due to autogroup
>> not allocating rt_runtime. Free unused/unusable rt_se and rt_rq, redirect RT
>> tasks to the root task group, and tell __sched_setscheduler() that it's ok.
>>
>> Signed-off-by: Mike Galbraith <efault@....de>
>> Reported-by: Bharata B Rao <bharata@...ux.vnet.ibm.com>
>
> This looks more clear ;)
>
> And a little comment below
>
>>
>> ---
>> kernel/sched.c | 3 ++-
>> kernel/sched_autogroup.c | 27 +++++++++++++++++++++++++++
>> kernel/sched_autogroup.h | 4 ++++
>> 3 files changed, 33 insertions(+), 1 deletion(-)
>> @@ -106,6 +128,11 @@ task_wants_autogroup(struct task_struct
>> return true;
>> }
>>
>> +static inline bool task_group_is_autogroup(struct task_group *tg)
>> +{
>> + return tg != &root_task_group && tg->autogroup;
>
> Isn't just checking tg->autogroup sufficient?
But if task_group_is_autogroup() will be called in other place in the future,
checking (tg != &root_task_group) is needed.
>
> if tg == &root_task_group
>
>> --- linux-2.6.orig/kernel/sched.c
>> +++ linux-2.6/kernel/sched.c
>> @@ -4874,7 +4874,8 @@ recheck:
>> * assigned.
>> */
>> if (rt_bandwidth_enabled() && rt_policy(policy) &&
>> - task_group(p)->rt_bandwidth.rt_runtime == 0) {
>> + task_group(p)->rt_bandwidth.rt_runtime == 0 &&
>
> this check will fail.
>
> Thanks,
> Yong
>
> --
> Only stand for myself
>
--
Only stand for myself
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists