[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1294899188.8089.44.camel@marge.simson.net>
Date: Thu, 13 Jan 2011 07:13:08 +0100
From: Mike Galbraith <efault@....de>
To: Yong Zhang <yong.zhang0@...il.com>
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, 2011-01-13 at 13:59 +0800, Yong Zhang 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?
>
> 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.
Yes, it's intended to fail. I intend to make it explicit throughout
autogroup that root_task_group is not an autogroup, and will drop the
test for root_task_group then.
-Mike
--
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