lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 12 Jan 2011 14:32:54 +0800
From:	Yong Zhang <yong.zhang0@...il.com>
To:	Mike Galbraith <mgalbraith@...e.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 Wed, Jan 12, 2011 at 1:40 PM, Mike Galbraith <mgalbraith@...e.de> wrote:
> But it'd be better to not touch anything, just deflect RT tasks away
> from useless queues from the start.
>
> 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.  Squirrel allocated but useless rt_se and rt_rq
> away for group destruction time, and deflect RT tasks to the root task group.
>
> Signed-off-by: Mike Galbraith <efault@....de>
> Reported-by: Bharata B Rao <bharata@...ux.vnet.ibm.com>
>
> ---
>  kernel/sched_autogroup.c |   13 +++++++++++++
>  kernel/sched_autogroup.h |    4 ++++
>  2 files changed, 17 insertions(+)
>
> Index: linux-2.6/kernel/sched_autogroup.c
> ===================================================================
> --- linux-2.6.orig/kernel/sched_autogroup.c
> +++ linux-2.6/kernel/sched_autogroup.c
> @@ -27,6 +27,11 @@ static inline void autogroup_destroy(str
>  {
>        struct autogroup *ag = container_of(kref, struct autogroup, kref);
>
> +#ifdef CONFIG_RT_GROUP_SCHED
> +       ag->tg->rt_se = ag->rt_se;
> +       ag->tg->rt_rq = ag->rt_rq;
> +       ag->tg->rt_bandwidth.rt_runtime = 0;
> +#endif
>        sched_destroy_group(ag->tg);
>  }
>
> @@ -72,6 +77,14 @@ static inline struct autogroup *autogrou
>        init_rwsem(&ag->lock);
>        ag->id = atomic_inc_return(&autogroup_seq_nr);
>        ag->tg = tg;
> +#ifdef CONFIG_RT_GROUP_SCHED
> +       /* Sorry, we don't do RT, go away. */
> +       ag->rt_se = tg->rt_se;
> +       ag->rt_rq = tg->rt_rq;
> +       tg->rt_se = root_task_group.rt_se;
> +       tg->rt_rq = root_task_group.rt_rq;
> +       tg->rt_bandwidth.rt_runtime = root_task_group.rt_bandwidth.rt_runtime;

Setting rt_runtime both in this patch and the previous one will make tune
other's rt_runtime/rt_period trouble, I guess.

Thanks,
Yong

-- 
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ