Messages in this thread | | | Date | Thu, 13 Jan 2011 14:02:19 +0800 | Subject | Re: [patch] Re: autogroup: sched_setscheduler() fails | From | Yong Zhang <> |
| |
On Thu, Jan 13, 2011 at 1:59 PM, Yong Zhang <yong.zhang0@gmail.com> 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?
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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |