public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sched: Use time_after()
@ 2014-05-22 17:45 Manuel Schölling
  2014-06-05 14:34 ` [tip:sched/core] sched/fair: Use time_after() in record_wakee() tip-bot for Manuel Schölling
  0 siblings, 1 reply; 2+ messages in thread
From: Manuel Schölling @ 2014-05-22 17:45 UTC (permalink / raw)
  To: mingo; +Cc: peterz, linux-kernel, kernel-janitors, Manuel Schölling

To be future-proof and for better readability the time comparisons are modified
to use time_after() instead of plain, error-prone math.

Signed-off-by: Manuel Schölling <manuel.schoelling@gmx.de>
---
 kernel/sched/fair.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 7570dd9..716360a 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4014,7 +4014,7 @@ static void record_wakee(struct task_struct *p)
 	 * about the boundary, really active task won't care
 	 * about the loss.
 	 */
-	if (jiffies > current->wakee_flip_decay_ts + HZ) {
+	if (time_after(jiffies, current->wakee_flip_decay_ts + HZ)) {
 		current->wakee_flips = 0;
 		current->wakee_flip_decay_ts = jiffies;
 	}
-- 
1.7.10.4


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

* [tip:sched/core] sched/fair: Use time_after() in record_wakee()
  2014-05-22 17:45 [PATCH] sched: Use time_after() Manuel Schölling
@ 2014-06-05 14:34 ` tip-bot for Manuel Schölling
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Manuel Schölling @ 2014-06-05 14:34 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, torvalds, peterz, tglx,
	manuel.schoelling

Commit-ID:  2538d960d0c74cdc639f05723e04a67aed1efdf9
Gitweb:     http://git.kernel.org/tip/2538d960d0c74cdc639f05723e04a67aed1efdf9
Author:     Manuel Schölling <manuel.schoelling@gmx.de>
AuthorDate: Thu, 22 May 2014 19:45:23 +0200
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 5 Jun 2014 11:52:02 +0200

sched/fair: Use time_after() in record_wakee()

To be future-proof and for better readability the time comparisons are modified
to use time_after() instead of plain, error-prone math.

Signed-off-by: Manuel Schölling <manuel.schoelling@gmx.de>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/r/1400780723-24626-1-git-send-email-manuel.schoelling@gmx.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 kernel/sched/fair.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 7a0c000..c63dde9 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4066,7 +4066,7 @@ static void record_wakee(struct task_struct *p)
 	 * about the boundary, really active task won't care
 	 * about the loss.
 	 */
-	if (jiffies > current->wakee_flip_decay_ts + HZ) {
+	if (time_after(jiffies, current->wakee_flip_decay_ts + HZ)) {
 		current->wakee_flips >>= 1;
 		current->wakee_flip_decay_ts = jiffies;
 	}

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

end of thread, other threads:[~2014-06-05 14:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-22 17:45 [PATCH] sched: Use time_after() Manuel Schölling
2014-06-05 14:34 ` [tip:sched/core] sched/fair: Use time_after() in record_wakee() tip-bot for Manuel Schölling

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