public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
To: Shan Hai <haishan.bai@gmail.com>
Cc: linux-kernel@vger.kernel.org, peterz@infradead.org,
	mingo@elte.hu, tglx@linutronix.de
Subject: Re: [PATCH 1/1] sched/rt: code cleanup, remove a redundant function call
Date: Tue, 29 Nov 2011 12:23:15 +0530	[thread overview]
Message-ID: <20111129065315.GA15774@linux.vnet.ibm.com> (raw)
In-Reply-To: <1322535836-13590-2-git-send-email-haishan.bai@gmail.com>

* Shan Hai <haishan.bai@gmail.com> [2011-11-29 11:03:56]:

> The second time call to sched_rt_period is redundant, because the value of the
> rt_runtime was already read and it was protected by the rurt_runtime_lock.
> 
> Signed-off-by: Shan Hai <haishan.bai@gmail.com>

Reviewed-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>

> ---
>  kernel/sched_rt.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c
> index 056cbd2..2171ac8 100644
> --- a/kernel/sched_rt.c
> +++ b/kernel/sched_rt.c
> @@ -645,7 +645,7 @@ static int sched_rt_runtime_exceeded(struct rt_rq *rt_rq)
>  	if (rt_rq->rt_throttled)
>  		return rt_rq_throttled(rt_rq);
> 
> -	if (sched_rt_runtime(rt_rq) >= sched_rt_period(rt_rq))
> +	if (runtime >= sched_rt_period(rt_rq))
>  		return 0;
> 
>  	balance_runtime(rt_rq);
> -- 
> 1.7.4.1


  reply	other threads:[~2011-11-29  6:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-29  3:03 [PATCH 0/1] sched/rt: code cleanup, remove a redundant function call Shan Hai
2011-11-29  3:03 ` [PATCH 1/1] " Shan Hai
2011-11-29  6:53   ` Kamalesh Babulal [this message]
2011-11-29 13:17   ` Peter Zijlstra
2011-11-30  2:35     ` Shan Hai
2011-12-06  9:52   ` [tip:sched/core] sched/rt: Code " tip-bot for Shan Hai

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=20111129065315.GA15774@linux.vnet.ibm.com \
    --to=kamalesh@linux.vnet.ibm.com \
    --cc=haishan.bai@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox