Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1638855

[RFC][PATCH] sched/deadline: Remove if statement before clearing throttle and yielded

From Steven Rostedt <rostedt@goodmis.org>
Newsgroups linux.kernel
Subject [RFC][PATCH] sched/deadline: Remove if statement before clearing throttle and yielded
Date 2017-05-10 16:00 +0200
Message-ID <tFAjM-1pF-3@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


[
  This is an RFC as I didn't run any benchmarks. It just seemed a bit 
  weird to me that we would add such a check instead of just clearing
  these variables out regardless.
]

The function replenish_dl_entity() clears dl_throttled and dl_yielded,
but checks first if they are set before doing so. As these variables
are in the same cache locale of other variables being modified, there's
no advantage in checking if they are set before clearing them. But
having the compare takes slots away from the branch prediction.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index a2ce590..9748d33 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -423,10 +423,8 @@ static void replenish_dl_entity(struct sched_dl_entity *dl_se,
 		dl_se->runtime = pi_se->dl_runtime;
 	}
 
-	if (dl_se->dl_yielded)
-		dl_se->dl_yielded = 0;
-	if (dl_se->dl_throttled)
-		dl_se->dl_throttled = 0;
+	dl_se->dl_yielded = 0;
+	dl_se->dl_throttled = 0;
 }
 
 /*

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[RFC][PATCH] sched/deadline: Remove if statement before clearing  throttle and yielded Steven Rostedt <rostedt@goodmis.org> - 2017-05-10 16:00 +0200
  Re: [RFC][PATCH] sched/deadline: Remove if statement before clearing  throttle and yielded Juri Lelli <juri.lelli@arm.com> - 2017-05-11 18:30 +0200
    Re: [RFC][PATCH] sched/deadline: Remove if statement before clearing  throttle and yielded Daniel Bristot de Oliveira <bristot@redhat.com> - 2017-05-11 19:40 +0200
    Re: [RFC][PATCH] sched/deadline: Remove if statement before clearing  throttle and yielded Peter Zijlstra <peterz@infradead.org> - 2017-05-11 22:00 +0200

csiph-web