From: Cyrill Gorcunov <gorcunov@gmail.com>
To: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Cc: linux-kernel@vger.kernel.org, Juri Lelli <juri.lelli@redhat.com>,
Vincent Guittot <vincent.guittot@linaro.org>,
Peter Zijlstra <peterz@infradead.org>,
Steven Rostedt <rostedt@goodmis.org>,
Ben Segall <bsegall@google.com>, Ingo Molnar <mingo@redhat.com>,
Mel Gorman <mgorman@suse.de>,
Dietmar Eggemann <dietmar.eggemann@arm.com>
Subject: Re: [PATCH] sched/rt: optimize checking group rt scheduler constraints
Date: Sat, 25 Jan 2020 18:32:11 +0300 [thread overview]
Message-ID: <20200125153211.GP2437@uranus> (raw)
In-Reply-To: <157996383820.4651.11292439232549211693.stgit@buzz>
On Sat, Jan 25, 2020 at 05:50:38PM +0300, Konstantin Khlebnikov wrote:
...
> -/* Must be called with tasklist_lock held */
> static inline int tg_has_rt_tasks(struct task_group *tg)
> {
> - struct task_struct *g, *p;
> + struct task_struct *task;
> + struct css_task_iter it;
> + int ret = 0;
>
> /*
> * Autogroups do not have RT tasks; see autogroup_create().
> @@ -2407,12 +2408,12 @@ static inline int tg_has_rt_tasks(struct task_group *tg)
> if (task_group_is_autogroup(tg))
> return 0;
>
> - for_each_process_thread(g, p) {
> - if (rt_task(p) && task_group(p) == tg)
> - return 1;
> - }
> + css_task_iter_start(&tg->css, 0, &it);
> + while (!ret && (task = css_task_iter_next(&it)))
> + ret |= rt_task(task);
Plain 'ret = rt_task(task);' won't work?
> + css_task_iter_end(&it);
>
> - return 0;
> + return ret;
> }
next prev parent reply other threads:[~2020-01-25 15:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-25 14:50 [PATCH] sched/rt: optimize checking group rt scheduler constraints Konstantin Khlebnikov
2020-01-25 15:32 ` Cyrill Gorcunov [this message]
2020-01-25 16:15 ` Konstantin Khlebnikov
2020-01-25 16:40 ` Cyrill Gorcunov
2020-01-27 17:47 ` Phil Auld
2020-01-29 11:32 ` [tip: sched/core] sched/rt: Optimize checking group RT " tip-bot2 for Konstantin Khlebnikov
2020-01-30 19:10 ` Phil Auld
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=20200125153211.GP2437@uranus \
--to=gorcunov@gmail.com \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=juri.lelli@redhat.com \
--cc=khlebnikov@yandex-team.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=vincent.guittot@linaro.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.