aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern B. Brandenburg <bbb@cs.unc.edu>2009-12-07 15:08:02 -0500
committerBjoern B. Brandenburg <bbb@cs.unc.edu>2009-12-07 15:08:02 -0500
commite6474fd5f0504534120d7b104b7deb461f1c8bb6 (patch)
treee4752058da20892544dbbbbb1ba1779e1821cf26
parentd0f2d3babee1dbb2f1f6d7dadf7ff287b01de375 (diff)
Remove norq delayed work support.
-rw-r--r--include/litmus/norqlock.h26
-rw-r--r--include/litmus/rt_domain.h3
-rw-r--r--kernel/hrtimer.c5
-rw-r--r--kernel/sched.c5
-rw-r--r--litmus/Makefile2
-rw-r--r--litmus/norqlock.c76
-rw-r--r--litmus/rt_domain.c2
7 files changed, 1 insertions, 118 deletions
diff --git a/include/litmus/norqlock.h b/include/litmus/norqlock.h
deleted file mode 100644
index e4c1d06f51..0000000000
--- a/include/litmus/norqlock.h
+++ /dev/null
@@ -1,26 +0,0 @@
1#ifndef NORQLOCK_H
2#define NORQLOCK_H
3
4typedef void (*work_t)(unsigned long arg);
5
6struct no_rqlock_work {
7 int active;
8 work_t work;
9 unsigned long arg;
10 struct no_rqlock_work* next;
11};
12
13void init_no_rqlock_work(struct no_rqlock_work* w, work_t work,
14 unsigned long arg);
15
16void __do_without_rqlock(struct no_rqlock_work *work);
17
18static inline void do_without_rqlock(struct no_rqlock_work *work)
19{
20 if (!test_and_set_bit(0, (void*)&work->active))
21 __do_without_rqlock(work);
22}
23
24void tick_no_rqlock(void);
25
26#endif
diff --git a/include/litmus/rt_domain.h b/include/litmus/rt_domain.h
index ea9de020cc..c7c55bef3e 100644
--- a/include/litmus/rt_domain.h
+++ b/include/litmus/rt_domain.h
@@ -5,7 +5,6 @@
5#ifndef __UNC_RT_DOMAIN_H__ 5#ifndef __UNC_RT_DOMAIN_H__
6#define __UNC_RT_DOMAIN_H__ 6#define __UNC_RT_DOMAIN_H__
7 7
8#include <litmus/norqlock.h>
9#include <litmus/heap.h> 8#include <litmus/heap.h>
10 9
11#define RELEASE_QUEUE_SLOTS 127 /* prime */ 10#define RELEASE_QUEUE_SLOTS 127 /* prime */
@@ -22,8 +21,6 @@ struct release_queue {
22}; 21};
23 22
24typedef struct _rt_domain { 23typedef struct _rt_domain {
25 struct no_rqlock_work arm_timer;
26
27 /* runnable rt tasks are in here */ 24 /* runnable rt tasks are in here */
28 spinlock_t ready_lock; 25 spinlock_t ready_lock;
29 struct heap ready_queue; 26 struct heap ready_queue;
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index 7b8576b6bd..26c0228ea9 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -1314,9 +1314,6 @@ void hrtimer_run_queues(void)
1314 run_hrtimer_queue(cpu_base, i); 1314 run_hrtimer_queue(cpu_base, i);
1315} 1315}
1316 1316
1317/* FIXME: this won't be needed anymore once we port to Linux > 2.6.24 */
1318void hrtimer_wakeup_hack(int onoff);
1319
1320/* 1317/*
1321 * Sleep related functions: 1318 * Sleep related functions:
1322 */ 1319 */
@@ -1328,9 +1325,7 @@ static enum hrtimer_restart hrtimer_wakeup(struct hrtimer *timer)
1328 1325
1329 t->task = NULL; 1326 t->task = NULL;
1330 if (task) { 1327 if (task) {
1331 hrtimer_wakeup_hack(1);
1332 wake_up_process(task); 1328 wake_up_process(task);
1333 hrtimer_wakeup_hack(0);
1334 } 1329 }
1335 1330
1336 return HRTIMER_NORESTART; 1331 return HRTIMER_NORESTART;
diff --git a/kernel/sched.c b/kernel/sched.c
index a3e4ad1b15..2d4e5172f6 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -70,8 +70,6 @@
70#include <litmus/sched_trace.h> 70#include <litmus/sched_trace.h>
71#include <litmus/trace.h> 71#include <litmus/trace.h>
72 72
73#include <litmus/norqlock.h>
74
75/* 73/*
76 * Scheduler clock - returns current time in nanosec units. 74 * Scheduler clock - returns current time in nanosec units.
77 * This is default implementation. 75 * This is default implementation.
@@ -1663,7 +1661,6 @@ out:
1663 if (is_realtime(p)) 1661 if (is_realtime(p))
1664 TRACE_TASK(p, "try_to_wake_up() done state:%d\n", p->state); 1662 TRACE_TASK(p, "try_to_wake_up() done state:%d\n", p->state);
1665 task_rq_unlock(rq, &flags); 1663 task_rq_unlock(rq, &flags);
1666 tick_no_rqlock();
1667 return success; 1664 return success;
1668} 1665}
1669 1666
@@ -3705,8 +3702,6 @@ need_resched_nonpreemptible:
3705 } 3702 }
3706 TS_SCHED2_START(current); 3703 TS_SCHED2_START(current);
3707 3704
3708 tick_no_rqlock();
3709
3710 sched_trace_task_switch_to(current); 3705 sched_trace_task_switch_to(current);
3711 3706
3712 if (unlikely(reacquire_kernel_lock(current) < 0)) { 3707 if (unlikely(reacquire_kernel_lock(current) < 0)) {
diff --git a/litmus/Makefile b/litmus/Makefile
index b5ac4ca345..f7c7e02fd9 100644
--- a/litmus/Makefile
+++ b/litmus/Makefile
@@ -5,7 +5,7 @@
5obj-y = sched_plugin.o litmus.o \ 5obj-y = sched_plugin.o litmus.o \
6 edf_common.o jobs.o \ 6 edf_common.o jobs.o \
7 rt_domain.o fdso.o sync.o \ 7 rt_domain.o fdso.o sync.o \
8 fmlp.o srp.o norqlock.o \ 8 fmlp.o srp.o \
9 heap.o \ 9 heap.o \
10 sched_gsn_edf.o \ 10 sched_gsn_edf.o \
11 sched_psn_edf.o \ 11 sched_psn_edf.o \
diff --git a/litmus/norqlock.c b/litmus/norqlock.c
deleted file mode 100644
index 1a17d6c3ac..0000000000
--- a/litmus/norqlock.c
+++ /dev/null
@@ -1,76 +0,0 @@
1#include <linux/list.h>
2#include <linux/bitops.h>
3#include <linux/percpu.h>
4#include <linux/module.h>
5#include <linux/smp.h>
6
7#include <litmus/norqlock.h>
8
9struct worklist {
10 struct no_rqlock_work* next;
11 int hrtimer_hack;
12};
13
14static DEFINE_PER_CPU(struct worklist, norq_worklist) = {NULL, 0};
15
16void init_no_rqlock_work(struct no_rqlock_work* w, work_t work,
17 unsigned long arg)
18{
19 w->active = 0;
20 w->work = work;
21 w->arg = arg;
22 w->next = NULL;
23}
24
25void __do_without_rqlock(struct no_rqlock_work *work)
26{
27 long flags;
28 struct worklist* wl;
29
30 local_irq_save(flags);
31 wl = &__get_cpu_var(norq_worklist);
32 work->next = wl->next;
33 wl->next = work;
34 local_irq_restore(flags);
35}
36
37void hrtimer_wakeup_hack(int onoff)
38{
39 preempt_disable();
40 __get_cpu_var(norq_worklist).hrtimer_hack = onoff;
41 preempt_enable();
42}
43
44void tick_no_rqlock(void)
45{
46 long flags;
47 struct no_rqlock_work *todo, *next;
48 struct worklist* wl;
49
50
51 local_irq_save(flags);
52
53 wl = &__get_cpu_var(norq_worklist);
54
55 if (wl->hrtimer_hack) {
56 /* bail out! */
57 local_irq_restore(flags);
58 return;
59 }
60
61 next = wl->next;
62 wl->next = NULL;
63
64 local_irq_restore(flags);
65
66 while (next) {
67 todo = next;
68 next = next->next;
69 todo->next = NULL;
70 smp_mb__before_clear_bit();
71 clear_bit(0, (void*) &todo->active);
72 todo->work(todo->arg);
73 }
74
75
76}
diff --git a/litmus/rt_domain.c b/litmus/rt_domain.c
index 2d0920ccad..ae7970ab09 100644
--- a/litmus/rt_domain.c
+++ b/litmus/rt_domain.c
@@ -262,7 +262,6 @@ void rt_domain_init(rt_domain_t *rt,
262 rt->check_resched = check; 262 rt->check_resched = check;
263 rt->release_jobs = release; 263 rt->release_jobs = release;
264 rt->order = order; 264 rt->order = order;
265 init_no_rqlock_work(&rt->arm_timer, arm_release_timer, (unsigned long) rt);
266} 265}
267 266
268/* add_ready - add a real-time task to the rt ready queue. It must be runnable. 267/* add_ready - add a real-time task to the rt ready queue. It must be runnable.
@@ -297,6 +296,5 @@ void __add_release(rt_domain_t* rt, struct task_struct *task)
297 TRACE_TASK(task, "add_release(), rel=%llu\n", get_release(task)); 296 TRACE_TASK(task, "add_release(), rel=%llu\n", get_release(task));
298 list_add(&tsk_rt(task)->list, &rt->tobe_released); 297 list_add(&tsk_rt(task)->list, &rt->tobe_released);
299 task->rt_param.domain = rt; 298 task->rt_param.domain = rt;
300 do_without_rqlock(&rt->arm_timer);
301} 299}
302 300