Messages in this thread | | | Date | Tue, 28 Jun 2011 10:40:54 +0800 | Subject | Re: [PATCH] sched: skip autogroup when looking for all rt sched groups | From | Yong Zhang <> |
| |
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/
| |