public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] sched/rt: code cleanup, remove a redundant function call
@ 2011-11-29  3:03 Shan Hai
  2011-11-29  3:03 ` [PATCH 1/1] " Shan Hai
  0 siblings, 1 reply; 6+ messages in thread
From: Shan Hai @ 2011-11-29  3:03 UTC (permalink / raw)
  To: linux-kernel; +Cc: peterz, mingo, tglx


Calls the sched_rt_runtime twice in the sched_rt_runtime_exceeded, and the
second time call is not necessary, because the value of the rt_runtime was
alreay read and rt_runtimer itself was protected by the rt_runtime_lock.

---
 kernel/sched_rt.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/1] sched/rt: code cleanup, remove a redundant function call
  2011-11-29  3:03 [PATCH 0/1] sched/rt: code cleanup, remove a redundant function call Shan Hai
@ 2011-11-29  3:03 ` Shan Hai
  2011-11-29  6:53   ` Kamalesh Babulal
                     ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Shan Hai @ 2011-11-29  3:03 UTC (permalink / raw)
  To: linux-kernel; +Cc: peterz, mingo, tglx, Shan Hai

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>
---
 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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] sched/rt: code cleanup, remove a redundant function call
  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-12-06  9:52   ` [tip:sched/core] sched/rt: Code " tip-bot for Shan Hai
  2 siblings, 0 replies; 6+ messages in thread
From: Kamalesh Babulal @ 2011-11-29  6:53 UTC (permalink / raw)
  To: Shan Hai; +Cc: linux-kernel, peterz, mingo, tglx

* 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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] sched/rt: code cleanup, remove a redundant function call
  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:sched/core] sched/rt: Code " tip-bot for Shan Hai
  2 siblings, 1 reply; 6+ messages in thread
From: Peter Zijlstra @ 2011-11-29 13:17 UTC (permalink / raw)
  To: Shan Hai; +Cc: linux-kernel, mingo, tglx

On Tue, 2011-11-29 at 11:03 +0800, Shan Hai wrote:
> 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>
> ---
>  kernel/sched_rt.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

Note that that file doesn't exist anymore, scheduler patches should be
posted against tip/master.

Anyway, fixed that up and applied it. Thanks!

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] sched/rt: code cleanup, remove a redundant function call
  2011-11-29 13:17   ` Peter Zijlstra
@ 2011-11-30  2:35     ` Shan Hai
  0 siblings, 0 replies; 6+ messages in thread
From: Shan Hai @ 2011-11-30  2:35 UTC (permalink / raw)
  To: Peter Zijlstra; +Cc: linux-kernel, mingo, tglx

On Tue, Nov 29, 2011 at 02:17:02PM +0100, Peter Zijlstra wrote:
> On Tue, 2011-11-29 at 11:03 +0800, Shan Hai wrote:
> > 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>
> > ---
> >  kernel/sched_rt.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> Note that that file doesn't exist anymore, scheduler patches should be
> posted against tip/master.
>

Got it, thanks.

Cheers
Shan Hai
 
> Anyway, fixed that up and applied it. Thanks!

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [tip:sched/core] sched/rt: Code cleanup, remove a redundant function call
  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-12-06  9:52   ` tip-bot for Shan Hai
  2 siblings, 0 replies; 6+ messages in thread
From: tip-bot for Shan Hai @ 2011-12-06  9:52 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, kamalesh, a.p.zijlstra, tglx,
	haishan.bai, mingo

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);

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-12-06  9:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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:sched/core] sched/rt: Code " tip-bot for Shan Hai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox