lkml.org 
[lkml]   [2011]   [Jun]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] sched: skip autogroup when looking for all rt sched groups
From
Sorry for my late response and comments below.

On Thu, Jun 23, 2011 at 7:21 PM, Cheng Xu <chengxu@linux.vnet.ibm.com> wrote:
>
> This looks like it works, but seems we might be able to do that with less code...
>
> static inline struct task_group *next_task_group(struct task_group *tg)
> {
>        do {
>                tg = list_entry_rcu(tg->list.next,
>                                    typeof(struct task_group), list);
>        } while ((&tg->list != &task_groups) && (task_group_is_autogroup(tg)));
>        if (&tg->list == &task_groups)
>                tg = NULL;
>        return tg;
> }
>
> #define for_each_rt_rq(rt_rq, iter, rq) \
>        for (iter = container_of(&task_groups, typeof(*iter), list); \
>             (iter = next_task_group(iter)) && \
>             (rt_rq = iter->rt_rq[cpu_of(rq)]);)

Yeah, this works too, and it save some code.

Will update the patch based on it.

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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2011-06-28 04:49    [W:0.197 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site