All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yong Zhang <yong.zhang0@gmail.com>
To: Cheng Xu <chengxu@linux.vnet.ibm.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@elte.hu>, Mike Galbraith <efault@gmx.de>
Subject: Re: [PATCH] sched: skip autogroup when looking for all rt sched groups
Date: Tue, 28 Jun 2011 10:40:54 +0800	[thread overview]
Message-ID: <BANLkTinacDgzZenwmG4==1gYfEaQg-YQ-g@mail.gmail.com> (raw)
In-Reply-To: <4E0321AD.2080308@linux.vnet.ibm.com>

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

  reply	other threads:[~2011-06-28  2:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-22  5:22 [PATCH] sched: skip autogroup when looking for all rt sched groups Yong Zhang
2011-06-23 11:21 ` Cheng Xu
2011-06-28  2:40   ` Yong Zhang [this message]
2011-06-28  2:51     ` [PATCH V2] " Yong Zhang
2011-06-30  3:33       ` Cheng Xu
2011-07-01 15:17       ` [tip:sched/core] sched: Skip " tip-bot for Yong Zhang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='BANLkTinacDgzZenwmG4==1gYfEaQg-YQ-g@mail.gmail.com' \
    --to=yong.zhang0@gmail.com \
    --cc=chengxu@linux.vnet.ibm.com \
    --cc=efault@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.