aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern B. Brandenburg <bbb@cs.unc.edu>2007-10-27 15:47:22 -0400
committerBjoern B. Brandenburg <bbb@cs.unc.edu>2007-10-27 15:47:22 -0400
commita4d08351aacc56e79b03c85fc9bbcb03567309fa (patch)
tree8f15cd5c23a86c72c7376c3da8248e4850629b7f
parent2e4b97e2e722699fe2ce2699714887eac0ff84cc (diff)
cleanup: tidy up code before release2007.2
This gets rid of quite a few FIXMEs and TODOs, as well as some cruft.
-rw-r--r--include/linux/litmus.h23
-rw-r--r--include/linux/pfair_math.h3
-rw-r--r--include/linux/sched_plugin.h8
-rw-r--r--kernel/litmus.c15
-rw-r--r--kernel/sched.c11
-rw-r--r--kernel/sched_adaptive.c4
-rw-r--r--kernel/sched_edf_hsb.c81
-rw-r--r--kernel/sched_global_edf.c12
-rw-r--r--kernel/sched_part_edf.c11
-rw-r--r--kernel/sched_pfair.c2
-rw-r--r--kernel/sched_plugin.c53
-rw-r--r--kernel/sched_psn_edf.c29
12 files changed, 22 insertions, 230 deletions
diff --git a/include/linux/litmus.h b/include/linux/litmus.h
index dc39ecbf7e..259594e922 100644
--- a/include/linux/litmus.h
+++ b/include/linux/litmus.h
@@ -35,7 +35,6 @@ typedef enum {
35typedef enum { 35typedef enum {
36 LITMUS_RESERVED_RANGE = 1024, 36 LITMUS_RESERVED_RANGE = 1024,
37 37
38 ENABLE_WEIGHT_CHANGE_SIGNAL
39} sched_setup_cmd_t; 38} sched_setup_cmd_t;
40 39
41/* Runtime modes */ 40/* Runtime modes */
@@ -49,30 +48,14 @@ enum rt_mode_t {
49#define PLUGIN_PFAIR "pfair" 48#define PLUGIN_PFAIR "pfair"
50#define PLUGIN_PART_EDF "part_edf" 49#define PLUGIN_PART_EDF "part_edf"
51#define PLUGIN_GLOBAL_EDF "global_edf" 50#define PLUGIN_GLOBAL_EDF "global_edf"
52#define PLUGIN_PFAIR_STAGGER "stagger"
53#define PLUGIN_PFAIR_DESYNC "desync"
54#define PLUGIN_GLOBAL_EDF_NP "global_edf_np" 51#define PLUGIN_GLOBAL_EDF_NP "global_edf_np"
55#define PLUGIN_EDF_HSB "edf_hsb" 52#define PLUGIN_EDF_HSB "edf_hsb"
56#define PLUGIN_GSN_EDF "gsn_edf" 53#define PLUGIN_GSN_EDF "gsn_edf"
57#define PLUGIN_PSN_EDF "psn_edf" 54#define PLUGIN_PSN_EDF "psn_edf"
58#define PLUGIN_ADAPTIVE "adaptive" 55#define PLUGIN_ADAPTIVE "adaptive"
59 56
60/* Additional clone flags
61 Indicates that the thread is to be used in
62 realtime mode, therefore it should not be
63 woken up in a linux manner,
64 we just set its state to TASK_STOPPED
65 It must be prepared and added to the ready queue explicitly
66*/
67
68/* Type definition for our quantums */
69typedef unsigned long long quantum_t;
70
71extern spolicy sched_policy; 57extern spolicy sched_policy;
72 58
73extern unsigned long slot_size;
74extern unsigned long stagger_offset;
75
76/* RT mode start time */ 59/* RT mode start time */
77extern volatile unsigned long rt_start_time; 60extern volatile unsigned long rt_start_time;
78 61
@@ -82,10 +65,6 @@ extern atomic_t rt_mode;
82#define get_rt_mode() (atomic_read(&rt_mode)) 65#define get_rt_mode() (atomic_read(&rt_mode))
83#define set_rt_mode(a) atomic_set(&rt_mode,(a)) 66#define set_rt_mode(a) atomic_set(&rt_mode,(a))
84 67
85/* CLEANUP: Should be queue_lock, does it really belong here? */
86extern spinlock_t litmus_task_set_lock;
87
88
89#define TRACE(fmt, args...) \ 68#define TRACE(fmt, args...) \
90 sched_trace_log_message("%d: " fmt, raw_smp_processor_id(), ## args) 69 sched_trace_log_message("%d: " fmt, raw_smp_processor_id(), ## args)
91 70
@@ -99,7 +78,7 @@ extern spinlock_t litmus_task_set_lock;
99 do { if (cond) TRACE("BUG_ON(%s) at %s:%d " \ 78 do { if (cond) TRACE("BUG_ON(%s) at %s:%d " \
100 "called from %p current=%s/%d state=%d " \ 79 "called from %p current=%s/%d state=%d " \
101 "flags=%x mode=%d partition=%d cpu=%d rtflags=%d"\ 80 "flags=%x mode=%d partition=%d cpu=%d rtflags=%d"\
102 " job=%u knp=%d timeslice=%u\n", \ 81 " job=%u knp=%d timeslice=%u\n", \
103 #cond, __FILE__, __LINE__, __builtin_return_address(0), current->comm, \ 82 #cond, __FILE__, __LINE__, __builtin_return_address(0), current->comm, \
104 current->pid, current->state, current->flags, get_rt_mode(), \ 83 current->pid, current->state, current->flags, get_rt_mode(), \
105 get_partition(current), smp_processor_id(), get_rt_flags(current), \ 84 get_partition(current), smp_processor_id(), get_rt_flags(current), \
diff --git a/include/linux/pfair_math.h b/include/linux/pfair_math.h
index dab1778f0b..b2a14e4c54 100644
--- a/include/linux/pfair_math.h
+++ b/include/linux/pfair_math.h
@@ -7,6 +7,9 @@
7#include <linux/litmus.h> 7#include <linux/litmus.h>
8#include <linux/sched.h> 8#include <linux/sched.h>
9 9
10/* Type definition for our quantums */
11typedef unsigned long long quantum_t;
12
10/* 13/*
11* This file defines mathematical functions "ceiling", "floor", 14* This file defines mathematical functions "ceiling", "floor",
12* and PFAIR specific functions for computing the release and 15* and PFAIR specific functions for computing the release and
diff --git a/include/linux/sched_plugin.h b/include/linux/sched_plugin.h
index fa0716f0eb..1ea8178b25 100644
--- a/include/linux/sched_plugin.h
+++ b/include/linux/sched_plugin.h
@@ -33,13 +33,6 @@ struct pi_semaphore {
33 */ 33 */
34typedef void runqueue_t; 34typedef void runqueue_t;
35 35
36/********************* real-time callbacks ********************/
37
38/* Special plugin shutdown hook that clear plugin data structures
39 Currently is not supported
40*/
41typedef void (*plugin_shutdown_hook_t) (void);
42
43 36
44/********************* scheduler invocation ******************/ 37/********************* scheduler invocation ******************/
45 38
@@ -105,7 +98,6 @@ struct sched_plugin {
105 int ready_to_use; 98 int ready_to_use;
106 99
107 /* management interface */ 100 /* management interface */
108 plugin_shutdown_hook_t shutdown_hook; /*currently unsupported */
109 mode_change_t mode_change; 101 mode_change_t mode_change;
110 102
111 /* scheduler invocation */ 103 /* scheduler invocation */
diff --git a/kernel/litmus.c b/kernel/litmus.c
index ee1e09a627..8f238ba979 100644
--- a/kernel/litmus.c
+++ b/kernel/litmus.c
@@ -19,25 +19,22 @@
19spolicy sched_policy = SCHED_DEFAULT; 19spolicy sched_policy = SCHED_DEFAULT;
20int sched_options = 0; 20int sched_options = 0;
21 21
22/* avoid races with multiple task wake-ups */
23DEFINE_SPINLOCK(litmus_task_set_lock);
24 22
25/* This is a flag for switching the system into RT mode when it is booted up 23/* This is a flag for switching the system into RT mode when it is booted up
26 * In RT-mode non-realtime tasks are shut down and scheduled as spare 24 * In RT-mode non-realtime tasks are scheduled as background tasks.
27 * time available
28 */ 25 */
29 26
30/* The system is booting in non-realtime mode */ 27/* The system is booting in non-realtime mode */
31atomic_t rt_mode = ATOMIC_INIT(MODE_NON_RT); 28atomic_t rt_mode = ATOMIC_INIT(MODE_NON_RT);
32/* Here we specify a mode change to be made */ 29/* Here we specify a mode change to be made */
33atomic_t new_mode = ATOMIC_INIT(MODE_NON_RT); 30atomic_t new_mode = ATOMIC_INIT(MODE_NON_RT);
34/* Number of RT tasks that exist in the system */ 31/* Number of RT tasks that exist in the system */
35atomic_t n_rt_tasks = ATOMIC_INIT(0); 32atomic_t n_rt_tasks = ATOMIC_INIT(0);
36 33
37/* Only one process can perform mode change */ 34/* Only one CPU may perform a mode change. */
38static queuelock_t mode_change_lock; 35static queuelock_t mode_change_lock;
39 36
40/* A time instant when we switched to RT mode */ 37/* The time instant when we switched to RT mode */
41volatile jiffie_t rt_start_time = 0; 38volatile jiffie_t rt_start_time = 0;
42 39
43/* To send signals from the scheduler 40/* To send signals from the scheduler
diff --git a/kernel/sched.c b/kernel/sched.c
index d7fd42a431..5ad4276e4b 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -61,9 +61,11 @@
61#include <linux/sched_plugin.h> 61#include <linux/sched_plugin.h>
62#include <linux/sched_trace.h> 62#include <linux/sched_trace.h>
63#include <linux/rt_param.h> 63#include <linux/rt_param.h>
64
65#include <linux/trace.h> 64#include <linux/trace.h>
66 65
66/* LITMUS: avoid races with multiple task wake-ups */
67DEFINE_SPINLOCK(litmus_task_set_lock);
68
67/* 69/*
68 * Convert user-nice values [ -20 ... 0 ... 19 ] 70 * Convert user-nice values [ -20 ... 0 ... 19 ]
69 * to static priority [ MAX_RT_PRIO..MAX_PRIO-1 ], 71 * to static priority [ MAX_RT_PRIO..MAX_PRIO-1 ],
@@ -1693,7 +1695,6 @@ void fastcall wake_up_new_task(struct task_struct *p, unsigned long clone_flags)
1693 1695
1694 if (clone_flags & CLONE_REALTIME) { 1696 if (clone_flags & CLONE_REALTIME) {
1695 /* just mark the task as stopped */ 1697 /* just mark the task as stopped */
1696 /* CLEANUP: Do we have to remove the task from the rq? */
1697 p->state = TASK_STOPPED; 1698 p->state = TASK_STOPPED;
1698 return; 1699 return;
1699 } 1700 }
@@ -5541,7 +5542,7 @@ static struct notifier_block __cpuinitdata migration_notifier = {
5541 .priority = 10 5542 .priority = 10
5542}; 5543};
5543 5544
5544int __init linux_migration_init(void) 5545int __init migration_init(void)
5545{ 5546{
5546 void *cpu = (void *)(long)smp_processor_id(); 5547 void *cpu = (void *)(long)smp_processor_id();
5547 int err; 5548 int err;
@@ -7003,7 +7004,7 @@ static int update_sched_domains(struct notifier_block *nfb,
7003 return NOTIFY_OK; 7004 return NOTIFY_OK;
7004} 7005}
7005 7006
7006void __init linux_sched_init_smp(void) 7007void __init sched_init_smp(void)