All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Turner <pjt@google.com>
To: Andrew Vagin <avagin@openvz.org>
Cc: Ingo Molnar <mingo@elte.hu>,
	Peter Zijlstra <peterz@infradead.org>,
	linux-kernel@vger.kernel.org, devel@openvz.org
Subject: Re: [PATCH] sched: don't call task_group() many times in set_task_rq()
Date: Fri, 11 Nov 2011 13:26:05 -0800	[thread overview]
Message-ID: <4EBD92ED.4050701@google.com> (raw)
In-Reply-To: <1321020240-3874331-1-git-send-email-avagin@openvz.org>

On 11/11/2011 06:04 AM, Andrew Vagin wrote:
> It improves perfomance, especially if autogroup enabled.
>
> The size of set_task_rq() was 0x180 and now it is 0xa0.

A slightly more verbose commit message would be helpful here.

>
> Signed-off-by: Andrew Vagin<avagin@openvz.org>

Signed-off-by: Paul Turner <pjt@google.com>

> ---
>   kernel/sched.c |   12 ++++++++----
>   1 files changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/kernel/sched.c b/kernel/sched.c
> index d87c6e5..a740eec 100644
> --- a/kernel/sched.c
> +++ b/kernel/sched.c
> @@ -766,14 +766,18 @@ static inline struct task_group *task_group(struct task_struct *p)
>   /* Change a task's cfs_rq and parent entity if it moves across CPUs/groups */
>   static inline void set_task_rq(struct task_struct *p, unsigned int cpu)
>   {
> +#if defined(CONFIG_FAIR_GROUP_SCHED) || defined(CONFIG_RT_GROUP_SCHED)
> +	struct task_group *tg = task_group(p);
> +#endif
> +
>   #ifdef CONFIG_FAIR_GROUP_SCHED
> -	p->se.cfs_rq = task_group(p)->cfs_rq[cpu];
> -	p->se.parent = task_group(p)->se[cpu];
> +	p->se.cfs_rq = tg->cfs_rq[cpu];
> +	p->se.parent = tg->se[cpu];
>   #endif
>
>   #ifdef CONFIG_RT_GROUP_SCHED
> -	p->rt.rt_rq  = task_group(p)->rt_rq[cpu];
> -	p->rt.parent = task_group(p)->rt_se[cpu];
> +	p->rt.rt_rq  = tg->rt_rq[cpu];
> +	p->rt.parent = tg->rt_se[cpu];
>   #endif
>   }
>


  reply	other threads:[~2011-11-11 21:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-11 14:04 [PATCH] sched: don't call task_group() many times in set_task_rq() Andrew Vagin
2011-11-11 21:26 ` Paul Turner [this message]
2011-11-12  9:21   ` Peter Zijlstra
2011-11-11 21:47 ` Paul Turner
2011-11-18 23:43 ` [tip:sched/core] sched: Don't call task_group() too " tip-bot for Andrew Vagin

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=4EBD92ED.4050701@google.com \
    --to=pjt@google.com \
    --cc=avagin@openvz.org \
    --cc=devel@openvz.org \
    --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.