public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Shan Hai <haishan.bai@gmail.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
	kamalesh@linux.vnet.ibm.com, a.p.zijlstra@chello.nl,
	tglx@linutronix.de, haishan.bai@gmail.com, mingo@elte.hu
Subject: [tip:sched/core] sched/rt: Code cleanup, remove a redundant function call
Date: Tue, 6 Dec 2011 01:52:42 -0800	[thread overview]
Message-ID: <tip-5b680fd61388abb9059fbc8e7a2f60f602bfce15@git.kernel.org> (raw)
In-Reply-To: <1322535836-13590-2-git-send-email-haishan.bai@gmail.com>

Commit-ID:  5b680fd61388abb9059fbc8e7a2f60f602bfce15
Gitweb:     http://git.kernel.org/tip/5b680fd61388abb9059fbc8e7a2f60f602bfce15
Author:     Shan Hai <haishan.bai@gmail.com>
AuthorDate: Tue, 29 Nov 2011 11:03:56 +0800
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Tue, 6 Dec 2011 09:06:28 +0100

sched/rt: Code cleanup, remove a redundant function call

The second call to sched_rt_period() is redundant, because the value of the
rt_runtime was already read and it was protected by the ->rt_runtime_lock.

Signed-off-by: Shan Hai <haishan.bai@gmail.com>
Reviewed-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1322535836-13590-2-git-send-email-haishan.bai@gmail.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 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 58a4844..3640ebb 100644
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
@@ -846,7 +846,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);

      parent reply	other threads:[~2011-12-06  9:53 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
2011-11-29 13:17   ` Peter Zijlstra
2011-11-30  2:35     ` Shan Hai
2011-12-06  9:52   ` tip-bot for Shan Hai [this message]

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=tip-5b680fd61388abb9059fbc8e7a2f60f602bfce15@git.kernel.org \
    --to=haishan.bai@gmail.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=hpa@zytor.com \
    --cc=kamalesh@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@redhat.com \
    --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