aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2010-12-01 16:07:47 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2010-12-01 16:07:47 -0500
commit7c4bf1537a81a84954dc34caeaf3b874800f7c18 (patch)
treee8d1bf719eccb3a3c82feeb919207b164ebaa2a9
parent1b9caf2f95c97e27c91372bd41f79d3e96a99e62 (diff)
parentf07bb0a4549916107a7619d0bc4cb5dc09d5744a (diff)
Merge branch 'wip-merge-2.6.36' of ssh://cvs.cs.unc.edu/cvs/proj/litmus/repo/litmus2010 into wip-merge-2.6.36
-rw-r--r--include/litmus/debug_trace.h22
-rw-r--r--include/litmus/litmus.h2
-rw-r--r--litmus/Kconfig15
-rw-r--r--litmus/litmus.c7
-rw-r--r--litmus/sched_cedf.c3
5 files changed, 41 insertions, 8 deletions
diff --git a/include/litmus/debug_trace.h b/include/litmus/debug_trace.h
index b743aa96de79..48d086d5a44c 100644
--- a/include/litmus/debug_trace.h
+++ b/include/litmus/debug_trace.h
@@ -12,12 +12,24 @@ void dump_trace_buffer(int max);
12 12
13extern atomic_t __log_seq_no; 13extern atomic_t __log_seq_no;
14 14
15#define TRACE(fmt, args...) \ 15#ifdef CONFIG_SCHED_DEBUG_TRACE_CALLER
16 sched_trace_log_message("%d P%d: " fmt, atomic_add_return(1, &__log_seq_no), \ 16#define TRACE_PREFIX "%d P%d [%s@%s:%d]: "
17 raw_smp_processor_id(), ## args) 17#define TRACE_ARGS atomic_add_return(1, &__log_seq_no), \
18 raw_smp_processor_id(), \
19 __FUNCTION__, __FILE__, __LINE__
20#else
21#define TRACE_PREFIX "%d P%d: "
22#define TRACE_ARGS atomic_add_return(1, &__log_seq_no), \
23 raw_smp_processor_id()
24#endif
25
26#define TRACE(fmt, args...) \
27 sched_trace_log_message(TRACE_PREFIX fmt, \
28 TRACE_ARGS, ## args)
18 29
19#define TRACE_TASK(t, fmt, args...) \ 30#define TRACE_TASK(t, fmt, args...) \
20 TRACE("(%s/%d) " fmt, (t)->comm, (t)->pid, ##args) 31 TRACE("(%s/%d:%d) " fmt, (t)->comm, (t)->pid, \
32 (t)->rt_param.job_params.job_no, ##args)
21 33
22#define TRACE_CUR(fmt, args...) \ 34#define TRACE_CUR(fmt, args...) \
23 TRACE_TASK(current, fmt, ## args) 35 TRACE_TASK(current, fmt, ## args)
diff --git a/include/litmus/litmus.h b/include/litmus/litmus.h
index 30f41869b455..246483783fc0 100644
--- a/include/litmus/litmus.h
+++ b/include/litmus/litmus.h
@@ -62,7 +62,7 @@ inline static int budget_exhausted(struct task_struct* t)
62inline static lt_t budget_remaining(struct task_struct* t) 62inline static lt_t budget_remaining(struct task_struct* t)
63{ 63{
64 if (!budget_exhausted(t)) 64 if (!budget_exhausted(t))
65 return get_exec_time(t) - get_exec_cost(t); 65 return get_exec_cost(t) - get_exec_time(t);
66 else 66 else
67 /* avoid overflow */ 67 /* avoid overflow */
68 return 0; 68 return 0;
diff --git a/litmus/Kconfig b/litmus/Kconfig
index d62c417f261e..a2f267870f29 100644
--- a/litmus/Kconfig
+++ b/litmus/Kconfig
@@ -174,6 +174,21 @@ config SCHED_DEBUG_TRACE_SHIFT
174 character device node should be created at /dev/litmus/log. The buffer 174 character device node should be created at /dev/litmus/log. The buffer
175 can be flushed using cat, e.g., 'cat /dev/litmus/log > my_log_file.txt'. 175 can be flushed using cat, e.g., 'cat /dev/litmus/log > my_log_file.txt'.
176 176
177config SCHED_DEBUG_TRACE_CALLER
178 bool "Include [function@file:line] tag in TRACE() log"
179 depends on SCHED_DEBUG_TRACE
180 default n
181 help
182 With this option enabled, TRACE() prepends
183
184 "[<function name>@<filename>:<line number>]"
185
186 to each message in the debug log. Enable this to aid in figuring out
187 what was called in which order. The downside is that it adds a lot of
188 clutter.
189
190 If unsure, say No.
191
177endmenu 192endmenu
178 193
179endmenu 194endmenu
diff --git a/litmus/litmus.c b/litmus/litmus.c
index 0756d0156f8f..8efd3f9ef7ee 100644
--- a/litmus/litmus.c
+++ b/litmus/litmus.c
@@ -382,7 +382,8 @@ void litmus_exit_task(struct task_struct* tsk)
382/* IPI callback to synchronize plugin switching */ 382/* IPI callback to synchronize plugin switching */
383static void synch_on_plugin_switch(void* info) 383static void synch_on_plugin_switch(void* info)
384{ 384{
385 while (atomic_read(&cannot_use_plugin)) 385 atomic_inc(&cannot_use_plugin);
386 while (atomic_read(&cannot_use_plugin) > 0)
386 cpu_relax(); 387 cpu_relax();
387} 388}
388 389
@@ -403,6 +404,10 @@ int switch_sched_plugin(struct sched_plugin* plugin)
403 /* send IPI to force other CPUs to synch with us */ 404 /* send IPI to force other CPUs to synch with us */
404 smp_call_function(synch_on_plugin_switch, NULL, 0); 405 smp_call_function(synch_on_plugin_switch, NULL, 0);
405 406
407 /* wait until all other CPUs have started synch */
408 while (atomic_read(&cannot_use_plugin) < num_online_cpus())
409 cpu_relax();
410
406 /* stop task transitions */ 411 /* stop task transitions */
407 raw_spin_lock_irqsave(&task_transition_lock, flags); 412 raw_spin_lock_irqsave(&task_transition_lock, flags);
408 413
diff --git a/litmus/sched_cedf.c b/litmus/sched_cedf.c
index 111e4fb1c62b..8c9513d33f59 100644
--- a/litmus/sched_cedf.c
+++ b/litmus/sched_cedf.c
@@ -708,7 +708,8 @@ static long cedf_activate_plugin(void)
708 if (cpumask_test_cpu(cpu, cedf[j].cpu_map)) 708 if (cpumask_test_cpu(cpu, cedf[j].cpu_map))
709 break; 709 break;
710 /* if it is in a cluster go to next cpu */ 710 /* if it is in a cluster go to next cpu */
711 if (cpumask_test_cpu(cpu, cedf[j].cpu_map)) 711 if (j < num_clusters &&
712 cpumask_test_cpu(cpu, cedf[j].cpu_map))
712 continue; 713 continue;
713 714
714 /* this cpu isn't in any cluster */ 715 /* this cpu isn't in any cluster */