diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2011-12-22 21:48:09 -0500 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2011-12-27 22:41:22 -0500 |
commit | 7394b65d031eab807766915e47169b2c81b16f21 (patch) | |
tree | 2b2941a6e44d29e9fc70e90a54f12aa8c25d047a | |
parent | f79d7cdd5ef87f4acb6517e784c6522d7cedd515 (diff) |
Sperated b and c overheads
-rw-r--r-- | include/litmus/rt_domain.h | 3 | ||||
-rw-r--r-- | include/litmus/trace.h | 17 | ||||
-rw-r--r-- | kernel/sched.c | 4 | ||||
-rw-r--r-- | litmus/rt_domain.c | 11 | ||||
-rw-r--r-- | litmus/sched_mc.c | 3 |
5 files changed, 34 insertions, 4 deletions
diff --git a/include/litmus/rt_domain.h b/include/litmus/rt_domain.h index f98d47ccbb0b..3783cdaa00c5 100644 --- a/include/litmus/rt_domain.h +++ b/include/litmus/rt_domain.h | |||
@@ -8,6 +8,7 @@ | |||
8 | #include <litmus/bheap.h> | 8 | #include <litmus/bheap.h> |
9 | #include <litmus/domain.h> | 9 | #include <litmus/domain.h> |
10 | #include <litmus/event_group.h> | 10 | #include <litmus/event_group.h> |
11 | #include <litmus/sched_mc.h> | ||
11 | 12 | ||
12 | #define RELEASE_QUEUE_SLOTS 127 /* prime */ | 13 | #define RELEASE_QUEUE_SLOTS 127 /* prime */ |
13 | 14 | ||
@@ -50,6 +51,8 @@ typedef struct _rt_domain { | |||
50 | 51 | ||
51 | /* how are tasks ordered in the ready queue? */ | 52 | /* how are tasks ordered in the ready queue? */ |
52 | bheap_prio_t order; | 53 | bheap_prio_t order; |
54 | |||
55 | enum crit_level level; | ||
53 | } rt_domain_t; | 56 | } rt_domain_t; |
54 | 57 | ||
55 | struct release_heap { | 58 | struct release_heap { |
diff --git a/include/litmus/trace.h b/include/litmus/trace.h index e0c84716d87a..6e720f865cc0 100644 --- a/include/litmus/trace.h +++ b/include/litmus/trace.h | |||
@@ -13,7 +13,9 @@ enum task_type_marker { | |||
13 | TSK_BE, | 13 | TSK_BE, |
14 | TSK_RT, | 14 | TSK_RT, |
15 | TSK_UNKNOWN, | 15 | TSK_UNKNOWN, |
16 | TSK_LVLA | 16 | TSK_LVLA, |
17 | TSK_LVLB, | ||
18 | TSK_LVLC | ||
17 | }; | 19 | }; |
18 | 20 | ||
19 | struct timestamp { | 21 | struct timestamp { |
@@ -116,6 +118,19 @@ feather_callback void save_timestamp_time(unsigned long event, unsigned long tim | |||
116 | #define TS_LVLA_SCHED_END_ID 115 | 118 | #define TS_LVLA_SCHED_END_ID 115 |
117 | #define TS_LVLA_SCHED_END(t) TTIMESTAMP(TS_LVLA_SCHED_END_ID, t) | 119 | #define TS_LVLA_SCHED_END(t) TTIMESTAMP(TS_LVLA_SCHED_END_ID, t) |
118 | 120 | ||
121 | #define TS_LVLB_RELEASE_START DTIMESTAMP(116, TSK_RT) | ||
122 | #define TS_LVLB_RELEASE_END DTIMESTAMP(117, TSK_RT) | ||
123 | |||
124 | #define TS_LVLB_SCHED_START DTIMESTAMP(118, TSK_UNKNOWN) | ||
125 | #define TS_LVLB_SCHED_END_ID 119 | ||
126 | #define TS_LVLB_SCHED_END(t) TTIMESTAMP(TS_LVLA_SCHED_END_ID, t) | ||
127 | |||
128 | #define TS_LVLC_RELEASE_START DTIMESTAMP(120, TSK_RT) | ||
129 | #define TS_LVLC_RELEASE_END DTIMESTAMP(121, TSK_RT) | ||
130 | |||
131 | #define TS_LVLC_SCHED_START DTIMESTAMP(122, TSK_UNKNOWN) | ||
132 | #define TS_LVLC_SCHED_END_ID 123 | ||
133 | #define TS_LVLC_SCHED_END(t) TTIMESTAMP(TS_LVLA_SCHED_END_ID, t) | ||
119 | 134 | ||
120 | #define TS_PLUGIN_SCHED_START /* TIMESTAMP(120) */ /* currently unused */ | 135 | #define TS_PLUGIN_SCHED_START /* TIMESTAMP(120) */ /* currently unused */ |
121 | #define TS_PLUGIN_SCHED_END /* TIMESTAMP(121) */ | 136 | #define TS_PLUGIN_SCHED_END /* TIMESTAMP(121) */ |
diff --git a/kernel/sched.c b/kernel/sched.c index 71907dcd8112..093df593e45d 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -3811,6 +3811,8 @@ need_resched: | |||
3811 | need_resched_nonpreemptible: | 3811 | need_resched_nonpreemptible: |
3812 | TS_SCHED_START; | 3812 | TS_SCHED_START; |
3813 | TS_LVLA_SCHED_START; | 3813 | TS_LVLA_SCHED_START; |
3814 | TS_LVLB_SCHED_START; | ||
3815 | TS_LVLC_SCHED_START; | ||
3814 | sched_trace_task_switch_away(prev); | 3816 | sched_trace_task_switch_away(prev); |
3815 | 3817 | ||
3816 | schedule_debug(prev); | 3818 | schedule_debug(prev); |
@@ -3861,6 +3863,8 @@ need_resched_nonpreemptible: | |||
3861 | ++*switch_count; | 3863 | ++*switch_count; |
3862 | 3864 | ||
3863 | TS_LVLA_SCHED_END(next); | 3865 | TS_LVLA_SCHED_END(next); |
3866 | TS_LVLB_SCHED_END(next); | ||
3867 | TS_LVLC_SCHED_END(next); | ||
3864 | TS_SCHED_END(next); | 3868 | TS_SCHED_END(next); |
3865 | TS_CXS_START(next); | 3869 | TS_CXS_START(next); |
3866 | context_switch(rq, prev, next); /* unlocks the rq */ | 3870 | context_switch(rq, prev, next); /* unlocks the rq */ |
diff --git a/litmus/rt_domain.c b/litmus/rt_domain.c index e6ccf04cecf0..b615092ce9c9 100644 --- a/litmus/rt_domain.c +++ b/litmus/rt_domain.c | |||
@@ -52,7 +52,11 @@ static unsigned int time2slot(lt_t time) | |||
52 | static void do_release(struct release_heap *rh) | 52 | static void do_release(struct release_heap *rh) |
53 | { | 53 | { |
54 | unsigned long flags; | 54 | unsigned long flags; |
55 | TS_RELEASE_START; | 55 | |
56 | if (CRIT_LEVEL_B == rh->dom->level) | ||
57 | TS_LVLB_RELEASE_START; | ||
58 | else | ||
59 | TS_LVLC_RELEASE_START; | ||
56 | 60 | ||
57 | raw_spin_lock_irqsave(&rh->dom->release_lock, flags); | 61 | raw_spin_lock_irqsave(&rh->dom->release_lock, flags); |
58 | VTRACE("CB has the release_lock 0x%p\n", &rh->dom->release_lock); | 62 | VTRACE("CB has the release_lock 0x%p\n", &rh->dom->release_lock); |
@@ -64,7 +68,10 @@ static void do_release(struct release_heap *rh) | |||
64 | /* call release callback */ | 68 | /* call release callback */ |
65 | rh->dom->release_jobs(rh->dom, &rh->heap); | 69 | rh->dom->release_jobs(rh->dom, &rh->heap); |
66 | 70 | ||
67 | TS_RELEASE_END; | 71 | if (CRIT_LEVEL_B == rh->dom->level) |
72 | TS_LVLB_RELEASE_END; | ||
73 | else | ||
74 | TS_LVLC_RELEASE_END; | ||
68 | } | 75 | } |
69 | 76 | ||
70 | #ifdef CONFIG_MERGE_TIMERS | 77 | #ifdef CONFIG_MERGE_TIMERS |
diff --git a/litmus/sched_mc.c b/litmus/sched_mc.c index b43064ab63b6..5eaaa4734fa3 100644 --- a/litmus/sched_mc.c +++ b/litmus/sched_mc.c | |||
@@ -1246,11 +1246,12 @@ static void init_global_domain(struct domain_data *dom_data, enum crit_level lev | |||
1246 | } | 1246 | } |
1247 | 1247 | ||
1248 | static inline void init_edf_domain(struct domain *dom, rt_domain_t *rt, | 1248 | static inline void init_edf_domain(struct domain *dom, rt_domain_t *rt, |
1249 | int prio, int is_partitioned, int cpu) | 1249 | enum crit_level prio, int is_partitioned, int cpu) |
1250 | { | 1250 | { |
1251 | pd_domain_init(dom, rt, edf_ready_order, NULL, | 1251 | pd_domain_init(dom, rt, edf_ready_order, NULL, |
1252 | mc_release_jobs, mc_preempt_needed, | 1252 | mc_release_jobs, mc_preempt_needed, |
1253 | edf_higher_prio); | 1253 | edf_higher_prio); |
1254 | rt->level = prio; | ||
1254 | #if defined(CONFIG_PLUGIN_MC_RELEASE_MASTER) && defined(CONFIG_MERGE_TIMERS) | 1255 | #if defined(CONFIG_PLUGIN_MC_RELEASE_MASTER) && defined(CONFIG_MERGE_TIMERS) |
1255 | /* All timers are on one CPU and release-master is using the event | 1256 | /* All timers are on one CPU and release-master is using the event |
1256 | * merging interface as well. */ | 1257 | * merging interface as well. */ |