lkml.org 
[lkml]   [2011]   [Jan]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [patch] Re: autogroup: sched_setscheduler() fails
From
Date
On Thu, 2011-01-13 at 13:59 +0800, Yong Zhang wrote:
> On Thu, Jan 13, 2011 at 11:54 AM, Mike Galbraith <efault@gmx.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@gmx.de>
> > Reported-by: Bharata B Rao <bharata@linux.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



\
 
 \ /
  Last update: 2011-01-13 07:17    [W:0.148 / U:0.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site