[LITMUS^RT] [PATCH 5/5] litmus: get rid of unused RT_F_EXIT_SEM flag

Manohar Vanga mvanga at mpi-sws.org
Thu Oct 4 12:31:08 CEST 2012


This patch removes the RT_F_EXIT_SEM flag. All code paths
depending on it being true are assumed to be unreachable
and removed.

The 'flags' field in struct rt_params is left as-is for
use by specific schedulers. For example, sched_pfair
defines a custom flag RT_F_REQUEUE within the 'flags'
field.

Signed-off-by: Manohar Vanga <mvanga at mpi-sws.org>
---
 include/litmus/litmus.h   |    2 --
 include/litmus/rt_param.h |    3 ---
 litmus/sched_cedf.c       |   30 +++++++++++-------------------
 litmus/sched_gsn_edf.c    |   30 +++++++++++-------------------
 4 files changed, 22 insertions(+), 43 deletions(-)

diff --git a/include/litmus/litmus.h b/include/litmus/litmus.h
index ead6ab4..c66d3eb 100644
--- a/include/litmus/litmus.h
+++ b/include/litmus/litmus.h
@@ -45,8 +45,6 @@ void litmus_exit_task(struct task_struct *tsk);
 #define tsk_rt(t)		(&(t)->rt_param)
 
 /*	Realtime utility macros */
-#define get_rt_flags(t)		(tsk_rt(t)->flags)
-#define set_rt_flags(t,f) 	(tsk_rt(t)->flags=(f))
 #define is_priority_boosted(t)  (tsk_rt(t)->priority_boosted)
 #define get_boost_start(t)  (tsk_rt(t)->boost_start_time)
 
diff --git a/include/litmus/rt_param.h b/include/litmus/rt_param.h
index ce7b4b0..403652f 100644
--- a/include/litmus/rt_param.h
+++ b/include/litmus/rt_param.h
@@ -230,9 +230,6 @@ struct rt_param {
 	struct control_page * ctrl_page;
 };
 
-/*	Possible RT flags	*/
-#define RT_F_EXIT_SEM		0x00000008
-
 #endif
 
 #endif
diff --git a/litmus/sched_cedf.c b/litmus/sched_cedf.c
index 62d28d2..b45b46f 100644
--- a/litmus/sched_cedf.c
+++ b/litmus/sched_cedf.c
@@ -595,25 +595,17 @@ static void cedf_task_wake_up(struct task_struct *task)
 	cluster = task_cpu_cluster(task);
 
 	raw_spin_lock_irqsave(&cluster->cluster_lock, flags);
-	/* We need to take suspensions because of semaphores into
-	 * account! If a job resumes after being suspended due to acquiring
-	 * a semaphore, it should never be treated as a new job release.
-	 */
-	if (get_rt_flags(task) == RT_F_EXIT_SEM) {
-		tsk_rt(task)->completed = 0;
-	} else {
-		now = litmus_clock();
-		if (is_tardy(task, now)) {
-			/* new sporadic release */
-			release_at(task, now);
-			sched_trace_task_release(task);
-		}
-		else {
-			if (task->rt.time_slice) {
-				/* came back in time before deadline
-				*/
-				tsk_rt(task)->completed = 0;
-			}
+	now = litmus_clock();
+	if (is_tardy(task, now)) {
+		/* new sporadic release */
+		release_at(task, now);
+		sched_trace_task_release(task);
+	}
+	else {
+		if (task->rt.time_slice) {
+			/* came back in time before deadline
+			*/
+			tsk_rt(task)->completed = 0;
 		}
 	}
 	cedf_job_arrival(task);
diff --git a/litmus/sched_gsn_edf.c b/litmus/sched_gsn_edf.c
index 990e4e1..b8548b8 100644
--- a/litmus/sched_gsn_edf.c
+++ b/litmus/sched_gsn_edf.c
@@ -577,25 +577,17 @@ static void gsnedf_task_wake_up(struct task_struct *task)
 	TRACE_TASK(task, "wake_up at %llu\n", litmus_clock());
 
 	raw_spin_lock_irqsave(&gsnedf_lock, flags);
-	/* We need to take suspensions because of semaphores into
-	 * account! If a job resumes after being suspended due to acquiring
-	 * a semaphore, it should never be treated as a new job release.
-	 */
-	if (get_rt_flags(task) == RT_F_EXIT_SEM) {
-		tsk_rt(task)->completed = 0;
-	} else {
-		now = litmus_clock();
-		if (is_tardy(task, now)) {
-			/* new sporadic release */
-			release_at(task, now);
-			sched_trace_task_release(task);
-		}
-		else {
-			if (task->rt.time_slice) {
-				/* came back in time before deadline
-				*/
-				tsk_rt(task)->completed = 0;
-			}
+	now = litmus_clock();
+	if (is_tardy(task, now)) {
+		/* new sporadic release */
+		release_at(task, now);
+		sched_trace_task_release(task);
+	}
+	else {
+		if (task->rt.time_slice) {
+			/* came back in time before deadline
+			*/
+			tsk_rt(task)->completed = 0;
 		}
 	}
 	gsnedf_job_arrival(task);
-- 
1.7.2.5





More information about the litmus-dev mailing list