diff options
-rw-r--r-- | arch/arm/kernel/kgdb.c | 4 | ||||
-rw-r--r-- | arch/arm/kernel/traps.c | 3 | ||||
-rw-r--r-- | drivers/ata/ahci-tegra.c | 1 | ||||
-rw-r--r-- | include/litmus/clock.h | 1 | ||||
-rw-r--r-- | include/litmus/color_queue.h | 3 | ||||
-rw-r--r-- | include/litmus/debug_trace.h | 18 | ||||
-rw-r--r-- | include/litmus/lockdown.h | 2 | ||||
-rw-r--r-- | include/litmus/sched_trace.h | 79 | ||||
-rw-r--r-- | kernel/debug/debug_core.c | 31 | ||||
-rw-r--r-- | kernel/debug/gdbstub.c | 2 | ||||
-rw-r--r-- | litmus/Kconfig | 2 | ||||
-rw-r--r-- | litmus/color.c | 13 | ||||
-rw-r--r-- | litmus/color_queue.c | 34 | ||||
-rw-r--r-- | litmus/dgl.c | 88 | ||||
-rw-r--r-- | litmus/lockdown.c | 34 | ||||
-rw-r--r-- | litmus/sched_mc.c | 7 | ||||
-rw-r--r-- | litmus/sched_trace.c | 13 | ||||
-rw-r--r-- | litmus/way_tracker.c | 3 |
18 files changed, 250 insertions, 88 deletions
diff --git a/arch/arm/kernel/kgdb.c b/arch/arm/kernel/kgdb.c index 778c2f7024f..33a807aef59 100644 --- a/arch/arm/kernel/kgdb.c +++ b/arch/arm/kernel/kgdb.c | |||
@@ -118,6 +118,8 @@ int kgdb_arch_handle_exception(int exception_vector, int signo, | |||
118 | unsigned long addr; | 118 | unsigned long addr; |
119 | char *ptr; | 119 | char *ptr; |
120 | 120 | ||
121 | printk(KERN_WARNING "Handling exception dog\n"); | ||
122 | |||
121 | switch (remcom_in_buffer[0]) { | 123 | switch (remcom_in_buffer[0]) { |
122 | case 'D': | 124 | case 'D': |
123 | case 'k': | 125 | case 'k': |
@@ -144,6 +146,7 @@ int kgdb_arch_handle_exception(int exception_vector, int signo, | |||
144 | 146 | ||
145 | static int kgdb_brk_fn(struct pt_regs *regs, unsigned int instr) | 147 | static int kgdb_brk_fn(struct pt_regs *regs, unsigned int instr) |
146 | { | 148 | { |
149 | printk(KERN_WARNING "SW break\n"); | ||
147 | kgdb_handle_exception(1, SIGTRAP, 0, regs); | 150 | kgdb_handle_exception(1, SIGTRAP, 0, regs); |
148 | 151 | ||
149 | return 0; | 152 | return 0; |
@@ -151,6 +154,7 @@ static int kgdb_brk_fn(struct pt_regs *regs, unsigned int instr) | |||
151 | 154 | ||
152 | static int kgdb_compiled_brk_fn(struct pt_regs *regs, unsigned int instr) | 155 | static int kgdb_compiled_brk_fn(struct pt_regs *regs, unsigned int instr) |
153 | { | 156 | { |
157 | printk(KERN_WARNING "Compiled break\n"); | ||
154 | compiled_break = 1; | 158 | compiled_break = 1; |
155 | kgdb_handle_exception(1, SIGTRAP, 0, regs); | 159 | kgdb_handle_exception(1, SIGTRAP, 0, regs); |
156 | 160 | ||
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c index 4ef9f0d04e5..c1b04735229 100644 --- a/arch/arm/kernel/traps.c +++ b/arch/arm/kernel/traps.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/delay.h> | 24 | #include <linux/delay.h> |
25 | #include <linux/init.h> | 25 | #include <linux/init.h> |
26 | #include <linux/sched.h> | 26 | #include <linux/sched.h> |
27 | #include <linux/kgdb.h> | ||
27 | 28 | ||
28 | #include <linux/atomic.h> | 29 | #include <linux/atomic.h> |
29 | #include <asm/cacheflush.h> | 30 | #include <asm/cacheflush.h> |
@@ -710,7 +711,7 @@ baddataabort(int code, unsigned long instr, struct pt_regs *regs) | |||
710 | 711 | ||
711 | void __attribute__((noreturn)) __bug(const char *file, int line) | 712 | void __attribute__((noreturn)) __bug(const char *file, int line) |
712 | { | 713 | { |
713 | printk(KERN_CRIT"kernel BUG at %s:%d!\n", file, line); | 714 | printk(KERN_CRIT"kernel BUG you got this arch at %s:%d!\n", file, line); |
714 | *(int *)0 = 0; | 715 | *(int *)0 = 0; |
715 | 716 | ||
716 | /* Avoid "noreturn function does return" */ | 717 | /* Avoid "noreturn function does return" */ |
diff --git a/drivers/ata/ahci-tegra.c b/drivers/ata/ahci-tegra.c index 52b5820ac05..49a5bd14614 100644 --- a/drivers/ata/ahci-tegra.c +++ b/drivers/ata/ahci-tegra.c | |||
@@ -797,6 +797,7 @@ static void tegra_ahci_controller_remove(struct platform_device *pdev) | |||
797 | { | 797 | { |
798 | struct ata_host *host = dev_get_drvdata(&pdev->dev); | 798 | struct ata_host *host = dev_get_drvdata(&pdev->dev); |
799 | struct tegra_ahci_host_priv *tegra_hpriv; | 799 | struct tegra_ahci_host_priv *tegra_hpriv; |
800 | u32 status; | ||
800 | 801 | ||
801 | #ifdef CONFIG_PM | 802 | #ifdef CONFIG_PM |
802 | /* call tegra_ahci_controller_suspend() to power-down the SATA */ | 803 | /* call tegra_ahci_controller_suspend() to power-down the SATA */ |
diff --git a/include/litmus/clock.h b/include/litmus/clock.h index 9b285db7f60..bb493e73d50 100644 --- a/include/litmus/clock.h +++ b/include/litmus/clock.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define _LITMUS_CLOCK_H_ | 2 | #define _LITMUS_CLOCK_H_ |
3 | 3 | ||
4 | #if defined(CONFIG_EXYNOS_MCT) | 4 | #if defined(CONFIG_EXYNOS_MCT) |
5 | |||
5 | /* | 6 | /* |
6 | * Only used if we are using the EXYNOS MCT clock. | 7 | * Only used if we are using the EXYNOS MCT clock. |
7 | */ | 8 | */ |
diff --git a/include/litmus/color_queue.h b/include/litmus/color_queue.h index 95dd395c0b9..7a49afedf92 100644 --- a/include/litmus/color_queue.h +++ b/include/litmus/color_queue.h | |||
@@ -60,4 +60,7 @@ int color_queue_enqueue_flush(struct task_struct *ts); | |||
60 | 60 | ||
61 | void cleanup_color_page_infos(struct list_head *head); | 61 | void cleanup_color_page_infos(struct list_head *head); |
62 | 62 | ||
63 | int color_cache_task(struct task_struct *t); | ||
64 | int color_uncache_task(struct task_struct *t); | ||
65 | |||
63 | #endif | 66 | #endif |
diff --git a/include/litmus/debug_trace.h b/include/litmus/debug_trace.h index ee4a7b4844c..2808bf66f55 100644 --- a/include/litmus/debug_trace.h +++ b/include/litmus/debug_trace.h | |||
@@ -17,10 +17,22 @@ extern atomic_t __log_seq_no; | |||
17 | #define TRACE_ARGS atomic_add_return(1, &__log_seq_no), \ | 17 | #define TRACE_ARGS atomic_add_return(1, &__log_seq_no), \ |
18 | raw_smp_processor_id(), \ | 18 | raw_smp_processor_id(), \ |
19 | __FUNCTION__, __FILE__, __LINE__ | 19 | __FUNCTION__, __FILE__, __LINE__ |
20 | #define STRACE(fmt, args...) \ | ||
21 | sched_trace_log_message("%d P%d [%s@%s:%d]: " fmt, \ | ||
22 | TRACE_ARGS, ## args) | ||
23 | #define STRACE2(fmt, args...) \ | ||
24 | sched_trace_log_message("%d P%d [%s@%s:%d]: " fmt, \ | ||
25 | TRACE_ARGS, ## args) | ||
20 | #else | 26 | #else |
21 | #define TRACE_PREFIX "%d P%d: " | 27 | #define TRACE_PREFIX "%d P%d: " |
22 | #define TRACE_ARGS atomic_add_return(1, &__log_seq_no), \ | 28 | #define TRACE_ARGS atomic_add_return(1, &__log_seq_no), \ |
23 | raw_smp_processor_id() | 29 | raw_smp_processor_id() |
30 | #define STRACE(fmt, args...) \ | ||
31 | sched_trace_log_message("%d P%d : " fmt, \ | ||
32 | TRACE_ARGS, ## args) | ||
33 | #define STRACE2(fmt, args...) \ | ||
34 | sched_trace_log_message("%d P%d : " fmt, \ | ||
35 | TRACE_ARGS, ## args) | ||
24 | #endif | 36 | #endif |
25 | 37 | ||
26 | #define TRACE(fmt, args...) \ | 38 | #define TRACE(fmt, args...) \ |
@@ -33,12 +45,6 @@ extern atomic_t __log_seq_no; | |||
33 | 45 | ||
34 | #define TRACE_CUR(fmt, args...) \ | 46 | #define TRACE_CUR(fmt, args...) \ |
35 | TRACE_TASK(current, fmt, ## args) | 47 | TRACE_TASK(current, fmt, ## args) |
36 | #define STRACE(fmt, args...) \ | ||
37 | sched_trace_log_message("%d P%d [%s@%s:%d]: " fmt, \ | ||
38 | TRACE_ARGS, ## args) | ||
39 | #define STRACE2(fmt, args...) \ | ||
40 | sched_trace_log_message("%d P%d [%s@%s:%d]: " fmt, \ | ||
41 | TRACE_ARGS, ## args) | ||
42 | 48 | ||
43 | 49 | ||
44 | 50 | ||
diff --git a/include/litmus/lockdown.h b/include/litmus/lockdown.h index 78cd9c85657..ddd50accd2c 100644 --- a/include/litmus/lockdown.h +++ b/include/litmus/lockdown.h | |||
@@ -4,8 +4,10 @@ | |||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | 5 | ||
6 | #define UNLOCK_ALL 0x00000000 /* allocation in any way */ | 6 | #define UNLOCK_ALL 0x00000000 /* allocation in any way */ |
7 | #define LOCK_ALL (~UNLOCK_ALL) | ||
7 | 8 | ||
8 | u32 color_read_in_mem(u32 lock_val, u32 unlock_val, void *start, void *end); | 9 | u32 color_read_in_mem(u32 lock_val, u32 unlock_val, void *start, void *end); |
10 | u32 color_read_in_mem_lock(u32 lock_val, u32 unlock_val, void *start, void *end); | ||
9 | 11 | ||
10 | void set_lockdown(u32 lockdown_state); | 12 | void set_lockdown(u32 lockdown_state); |
11 | 13 | ||
diff --git a/include/litmus/sched_trace.h b/include/litmus/sched_trace.h index cb8758f8aeb..0580340d017 100644 --- a/include/litmus/sched_trace.h +++ b/include/litmus/sched_trace.h | |||
@@ -51,6 +51,7 @@ struct st_switch_away_data { /* A process was switched away from on a given CPU. | |||
51 | u64 exec_time; | 51 | u64 exec_time; |
52 | }; | 52 | }; |
53 | 53 | ||
54 | /* changed: like everything */ | ||
54 | struct st_completion_data { /* A job completed. */ | 55 | struct st_completion_data { /* A job completed. */ |
55 | u32 exec; | 56 | u32 exec; |
56 | u16 flush_work; | 57 | u16 flush_work; |
@@ -76,8 +77,8 @@ struct st_resume_data { /* A task resumes. */ | |||
76 | 77 | ||
77 | struct st_action_data { | 78 | struct st_action_data { |
78 | u64 when; | 79 | u64 when; |
79 | u32 action; | 80 | u8 action; |
80 | u8 __unused[4]; | 81 | u8 __unused[7]; |
81 | }; | 82 | }; |
82 | 83 | ||
83 | struct st_sys_release_data { | 84 | struct st_sys_release_data { |
@@ -85,11 +86,13 @@ struct st_sys_release_data { | |||
85 | u64 release; | 86 | u64 release; |
86 | }; | 87 | }; |
87 | 88 | ||
89 | /* changed: easy enough to remove */ | ||
88 | struct st_task_exit_data { | 90 | struct st_task_exit_data { |
89 | u64 avg_exec_time; | 91 | u64 avg_exec_time; |
90 | u64 max_exec_time; | 92 | u64 max_exec_time; |
91 | }; | 93 | }; |
92 | 94 | ||
95 | /* changed: calculate yoself */ | ||
93 | struct st_task_tardy_data { | 96 | struct st_task_tardy_data { |
94 | u64 total_tardy; | 97 | u64 total_tardy; |
95 | u32 max_tardy; | 98 | u32 max_tardy; |
@@ -232,26 +235,26 @@ feather_callback void do_sched_trace_task_tardy(unsigned long id, | |||
232 | trace_litmus_task_param(t); \ | 235 | trace_litmus_task_param(t); \ |
233 | } while (0) | 236 | } while (0) |
234 | 237 | ||
235 | #define sched_trace_task_release(t)/* \ */ | 238 | #define sched_trace_task_release(t) \ |
236 | /* do { \ */ | 239 | do { \ |
237 | /* SCHED_TRACE(SCHED_TRACE_BASE_ID + 3, \ */ | 240 | SCHED_TRACE(SCHED_TRACE_BASE_ID + 3, \ |
238 | /* do_sched_trace_task_release, t); \ */ | 241 | do_sched_trace_task_release, t); \ |
239 | /* trace_litmus_task_release(t); \ */ | 242 | trace_litmus_task_release(t); \ |
240 | /* } while (0) */ | 243 | } while (0) |
241 | 244 | ||
242 | #define sched_trace_task_switch_to(t)/* \ */ | 245 | #define sched_trace_task_switch_to(t) \ |
243 | /* do { \ */ | 246 | do { \ |
244 | /* SCHED_TRACE(SCHED_TRACE_BASE_ID + 4, \ */ | 247 | SCHED_TRACE(SCHED_TRACE_BASE_ID + 4, \ |
245 | /* do_sched_trace_task_switch_to, t); \ */ | 248 | do_sched_trace_task_switch_to, t); \ |
246 | /* trace_litmus_switch_to(t); \ */ | 249 | trace_litmus_switch_to(t); \ |
247 | /* } while (0) */ | 250 | } while (0) |
248 | 251 | ||
249 | #define sched_trace_task_switch_away(t)/* \ */ | 252 | #define sched_trace_task_switch_away(t) \ |
250 | /* do { \ */ | 253 | do { \ |
251 | /* SCHED_TRACE(SCHED_TRACE_BASE_ID + 5, \ */ | 254 | SCHED_TRACE(SCHED_TRACE_BASE_ID + 5, \ |
252 | /* do_sched_trace_task_switch_away, t); \ */ | 255 | do_sched_trace_task_switch_away, t); \ |
253 | /* trace_litmus_switch_away(t); \ */ | 256 | trace_litmus_switch_away(t); \ |
254 | /* } while (0) */ | 257 | } while (0) |
255 | 258 | ||
256 | #define sched_trace_task_completion(t, forced) \ | 259 | #define sched_trace_task_completion(t, forced) \ |
257 | do { \ | 260 | do { \ |
@@ -261,30 +264,30 @@ feather_callback void do_sched_trace_task_tardy(unsigned long id, | |||
261 | trace_litmus_task_completion(t, forced); \ | 264 | trace_litmus_task_completion(t, forced); \ |
262 | } while (0) | 265 | } while (0) |
263 | 266 | ||
264 | #define sched_trace_task_block_on(t, i)/* \ */ | 267 | #define sched_trace_task_block_on(t, i) \ |
265 | /* do { \ */ | 268 | do { \ |
266 | /* SCHED_TRACE(SCHED_TRACE_BASE_ID + 7, \ */ | 269 | SCHED_TRACE(SCHED_TRACE_BASE_ID + 7, \ |
267 | /* do_sched_trace_task_block, t); \ */ | 270 | do_sched_trace_task_block, t); \ |
268 | /* trace_litmus_task_block(t, i); \ */ | 271 | trace_litmus_task_block(t, i); \ |
269 | /* } while (0) */ | 272 | } while (0) |
270 | 273 | ||
271 | #define sched_trace_task_block(t) \ | 274 | #define sched_trace_task_block(t) \ |
272 | sched_trace_task_block_on(t, 0) | 275 | sched_trace_task_block_on(t, 0) |
273 | 276 | ||
274 | #define sched_trace_task_resume_on(t, i)/* \ */ | 277 | #define sched_trace_task_resume_on(t, i) \ |
275 | /* do { \ */ | 278 | do { \ |
276 | /* SCHED_TRACE(SCHED_TRACE_BASE_ID + 8, \ */ | 279 | SCHED_TRACE(SCHED_TRACE_BASE_ID + 8, \ |
277 | /* do_sched_trace_task_resume, t); \ */ | 280 | do_sched_trace_task_resume, t); \ |
278 | /* trace_litmus_task_resume(t, i); \ */ | 281 | trace_litmus_task_resume(t, i); \ |
279 | /* } while (0) */ | 282 | } while (0) |
280 | 283 | ||
281 | #define sched_trace_task_resume(t) \ | 284 | #define sched_trace_task_resume(t) \ |
282 | sched_trace_task_resume_on(t, 0) | 285 | sched_trace_task_resume_on(t, 0) |
283 | 286 | ||
284 | #define sched_trace_resource_acquire(t, i)/* \ */ | 287 | #define sched_trace_resource_acquire(t, i) \ |
285 | /* do { \ */ | 288 | do { \ |
286 | /* trace_litmus_resource_acquire(t, i); \ */ | 289 | trace_litmus_resource_acquire(t, i); \ |
287 | /* } while (0) */ | 290 | } while (0) |
288 | 291 | ||
289 | #define sched_trace_resource_released(t, i) \ | 292 | #define sched_trace_resource_released(t, i) \ |
290 | do { \ | 293 | do { \ |
diff --git a/kernel/debug/debug_core.c b/kernel/debug/debug_core.c index 0d7c08784ef..25c2c64f668 100644 --- a/kernel/debug/debug_core.c +++ b/kernel/debug/debug_core.c | |||
@@ -465,9 +465,13 @@ static int kgdb_cpu_enter(struct kgdb_state *ks, struct pt_regs *regs, | |||
465 | int trace_on = 0; | 465 | int trace_on = 0; |
466 | int online_cpus = num_online_cpus(); | 466 | int online_cpus = num_online_cpus(); |
467 | 467 | ||
468 | //printk(KERN_WARNING "Cpu enter\n"); | ||
469 | |||
468 | kgdb_info[ks->cpu].enter_kgdb++; | 470 | kgdb_info[ks->cpu].enter_kgdb++; |
469 | kgdb_info[ks->cpu].exception_state |= exception_state; | 471 | kgdb_info[ks->cpu].exception_state |= exception_state; |
470 | 472 | ||
473 | |||
474 | |||
471 | if (exception_state == DCPU_WANT_MASTER) | 475 | if (exception_state == DCPU_WANT_MASTER) |
472 | atomic_inc(&masters_in_kgdb); | 476 | atomic_inc(&masters_in_kgdb); |
473 | else | 477 | else |
@@ -477,6 +481,7 @@ static int kgdb_cpu_enter(struct kgdb_state *ks, struct pt_regs *regs, | |||
477 | arch_kgdb_ops.disable_hw_break(regs); | 481 | arch_kgdb_ops.disable_hw_break(regs); |
478 | 482 | ||
479 | acquirelock: | 483 | acquirelock: |
484 | //printk(KERN_WARNING "acquirelock\n"); | ||
480 | /* | 485 | /* |
481 | * Interrupts will be restored by the 'trap return' code, except when | 486 | * Interrupts will be restored by the 'trap return' code, except when |
482 | * single stepping. | 487 | * single stepping. |
@@ -495,6 +500,7 @@ acquirelock: | |||
495 | if (exception_level == 1) { | 500 | if (exception_level == 1) { |
496 | if (raw_spin_trylock(&dbg_master_lock)) | 501 | if (raw_spin_trylock(&dbg_master_lock)) |
497 | atomic_xchg(&kgdb_active, cpu); | 502 | atomic_xchg(&kgdb_active, cpu); |
503 | |||
498 | goto cpu_master_loop; | 504 | goto cpu_master_loop; |
499 | } | 505 | } |
500 | 506 | ||
@@ -504,6 +510,7 @@ acquirelock: | |||
504 | */ | 510 | */ |
505 | while (1) { | 511 | while (1) { |
506 | cpu_loop: | 512 | cpu_loop: |
513 | //printk(KERN_WARNING "cpu loop\n"); | ||
507 | if (kgdb_info[cpu].exception_state & DCPU_NEXT_MASTER) { | 514 | if (kgdb_info[cpu].exception_state & DCPU_NEXT_MASTER) { |
508 | kgdb_info[cpu].exception_state &= ~DCPU_NEXT_MASTER; | 515 | kgdb_info[cpu].exception_state &= ~DCPU_NEXT_MASTER; |
509 | goto cpu_master_loop; | 516 | goto cpu_master_loop; |
@@ -517,6 +524,7 @@ cpu_loop: | |||
517 | goto return_normal; | 524 | goto return_normal; |
518 | } else { | 525 | } else { |
519 | return_normal: | 526 | return_normal: |
527 | //printk(KERN_WARNING "return normal\n"); | ||
520 | /* Return to normal operation by executing any | 528 | /* Return to normal operation by executing any |
521 | * hw breakpoint fixup. | 529 | * hw breakpoint fixup. |
522 | */ | 530 | */ |
@@ -536,6 +544,8 @@ return_normal: | |||
536 | cpu_relax(); | 544 | cpu_relax(); |
537 | } | 545 | } |
538 | 546 | ||
547 | //printk(KERN_WARNING "out of 1\n"); | ||
548 | |||
539 | /* | 549 | /* |
540 | * For single stepping, try to only enter on the processor | 550 | * For single stepping, try to only enter on the processor |
541 | * that was single stepping. To guard against a deadlock, the | 551 | * that was single stepping. To guard against a deadlock, the |
@@ -555,14 +565,17 @@ return_normal: | |||
555 | 565 | ||
556 | if (!kgdb_io_ready(1)) { | 566 | if (!kgdb_io_ready(1)) { |
557 | kgdb_info[cpu].ret_state = 1; | 567 | kgdb_info[cpu].ret_state = 1; |
568 | //printk(KERN_WARNING "io not ready\n"); | ||
558 | goto kgdb_restore; /* No I/O connection, resume the system */ | 569 | goto kgdb_restore; /* No I/O connection, resume the system */ |
559 | } | 570 | } |
560 | 571 | ||
561 | /* | 572 | /* |
562 | * Don't enter if we have hit a removed breakpoint. | 573 | * Don't enter if we have hit a removed breakpoint. |
563 | */ | 574 | */ |
564 | if (kgdb_skipexception(ks->ex_vector, ks->linux_regs)) | 575 | if (kgdb_skipexception(ks->ex_vector, ks->linux_regs)) { |
576 | //printk(KERN_WARNING "skipping\n"); | ||
565 | goto kgdb_restore; | 577 | goto kgdb_restore; |
578 | } | ||
566 | 579 | ||
567 | /* Call the I/O driver's pre_exception routine */ | 580 | /* Call the I/O driver's pre_exception routine */ |
568 | if (dbg_io_ops->pre_exception) | 581 | if (dbg_io_ops->pre_exception) |
@@ -577,8 +590,11 @@ return_normal: | |||
577 | 590 | ||
578 | #ifdef CONFIG_SMP | 591 | #ifdef CONFIG_SMP |
579 | /* Signal the other CPUs to enter kgdb_wait() */ | 592 | /* Signal the other CPUs to enter kgdb_wait() */ |
580 | if ((!kgdb_single_step) && kgdb_do_roundup) | 593 | if ((!kgdb_single_step) && kgdb_do_roundup) { |
594 | printk(KERN_WARNING "Rounding up cpus...\n"); | ||
581 | kgdb_roundup_cpus(flags); | 595 | kgdb_roundup_cpus(flags); |
596 | printk(KERN_WARNING "Rounded up\n"); | ||
597 | } | ||
582 | #endif | 598 | #endif |
583 | 599 | ||
584 | /* | 600 | /* |
@@ -587,6 +603,7 @@ return_normal: | |||
587 | while (kgdb_do_roundup && (atomic_read(&masters_in_kgdb) + | 603 | while (kgdb_do_roundup && (atomic_read(&masters_in_kgdb) + |
588 | atomic_read(&slaves_in_kgdb)) != online_cpus) | 604 | atomic_read(&slaves_in_kgdb)) != online_cpus) |
589 | cpu_relax(); | 605 | cpu_relax(); |
606 | //printk(KERN_WARNING "Waited\n"); | ||
590 | 607 | ||
591 | /* | 608 | /* |
592 | * At this point the primary processor is completely | 609 | * At this point the primary processor is completely |
@@ -602,7 +619,9 @@ return_normal: | |||
602 | 619 | ||
603 | while (1) { | 620 | while (1) { |
604 | cpu_master_loop: | 621 | cpu_master_loop: |
622 | //printk(KERN_WARNING "master loop\n"); | ||
605 | if (dbg_kdb_mode) { | 623 | if (dbg_kdb_mode) { |
624 | //printk(KERN_WARNING "kdb mode\n"); | ||
606 | kgdb_connected = 1; | 625 | kgdb_connected = 1; |
607 | error = kdb_stub(ks); | 626 | error = kdb_stub(ks); |
608 | if (error == -1) | 627 | if (error == -1) |
@@ -636,6 +655,7 @@ cpu_master_loop: | |||
636 | } | 655 | } |
637 | 656 | ||
638 | kgdb_restore: | 657 | kgdb_restore: |
658 | //printk(KERN_WARNING "restore\n"); | ||
639 | if (atomic_read(&kgdb_cpu_doing_single_step) != -1) { | 659 | if (atomic_read(&kgdb_cpu_doing_single_step) != -1) { |
640 | int sstep_cpu = atomic_read(&kgdb_cpu_doing_single_step); | 660 | int sstep_cpu = atomic_read(&kgdb_cpu_doing_single_step); |
641 | if (kgdb_info[sstep_cpu].task) | 661 | if (kgdb_info[sstep_cpu].task) |
@@ -675,6 +695,8 @@ kgdb_handle_exception(int evector, int signo, int ecode, struct pt_regs *regs) | |||
675 | struct kgdb_state kgdb_var; | 695 | struct kgdb_state kgdb_var; |
676 | struct kgdb_state *ks = &kgdb_var; | 696 | struct kgdb_state *ks = &kgdb_var; |
677 | 697 | ||
698 | printk(KERN_WARNING "enter exception thing\n"); | ||
699 | |||
678 | ks->cpu = raw_smp_processor_id(); | 700 | ks->cpu = raw_smp_processor_id(); |
679 | ks->ex_vector = evector; | 701 | ks->ex_vector = evector; |
680 | ks->signo = signo; | 702 | ks->signo = signo; |
@@ -954,11 +976,16 @@ int dbg_io_get_char(void) | |||
954 | */ | 976 | */ |
955 | void kgdb_breakpoint(void) | 977 | void kgdb_breakpoint(void) |
956 | { | 978 | { |
979 | printk(KERN_WARNING "Doin this\n"); | ||
957 | atomic_inc(&kgdb_setting_breakpoint); | 980 | atomic_inc(&kgdb_setting_breakpoint); |
981 | printk(KERN_WARNING "Doin this1\n"); | ||
958 | wmb(); /* Sync point before breakpoint */ | 982 | wmb(); /* Sync point before breakpoint */ |
983 | printk(KERN_WARNING "Doin this2\n"); | ||
959 | arch_kgdb_breakpoint(); | 984 | arch_kgdb_breakpoint(); |
960 | wmb(); /* Sync point after breakpoint */ | 985 | wmb(); /* Sync point after breakpoint */ |
986 | printk(KERN_WARNING "Doin this\n"); | ||
961 | atomic_dec(&kgdb_setting_breakpoint); | 987 | atomic_dec(&kgdb_setting_breakpoint); |
988 | printk(KERN_WARNING "Doin this\n"); | ||
962 | } | 989 | } |
963 | EXPORT_SYMBOL_GPL(kgdb_breakpoint); | 990 | EXPORT_SYMBOL_GPL(kgdb_breakpoint); |
964 | 991 | ||
diff --git a/kernel/debug/gdbstub.c b/kernel/debug/gdbstub.c index 34872482315..e0134e3cc5e 100644 --- a/kernel/debug/gdbstub.c +++ b/kernel/debug/gdbstub.c | |||
@@ -941,6 +941,8 @@ int gdb_serial_stub(struct kgdb_state *ks) | |||
941 | int error = 0; | 941 | int error = 0; |
942 | int tmp; | 942 | int tmp; |
943 | 943 | ||
944 | printk(KERN_WARNING "Serial stub\n"); | ||
945 | |||
944 | /* Initialize comm buffer and globals. */ | 946 | /* Initialize comm buffer and globals. */ |
945 | memset(remcom_out_buffer, 0, sizeof(remcom_out_buffer)); | 947 | memset(remcom_out_buffer, 0, sizeof(remcom_out_buffer)); |
946 | kgdb_usethread = kgdb_info[ks->cpu].task; | 948 | kgdb_usethread = kgdb_info[ks->cpu].task; |
diff --git a/litmus/Kconfig b/litmus/Kconfig index e71f7a332f2..1ba3a1368f6 100644 --- a/litmus/Kconfig +++ b/litmus/Kconfig | |||
@@ -39,7 +39,7 @@ config PLUGIN_PFAIR | |||
39 | config MERGE_TIMERS | 39 | config MERGE_TIMERS |
40 | bool "Timer-merging Support" | 40 | bool "Timer-merging Support" |
41 | depends on HIGH_RES_TIMERS | 41 | depends on HIGH_RES_TIMERS |
42 | default y | 42 | default n |
43 | help | 43 | help |
44 | Include support for merging timers. | 44 | Include support for merging timers. |
45 | 45 | ||
diff --git a/litmus/color.c b/litmus/color.c index 26f800e785a..c9826dd48ec 100644 --- a/litmus/color.c +++ b/litmus/color.c | |||
@@ -16,7 +16,9 @@ | |||
16 | #include <litmus/color.h> | 16 | #include <litmus/color.h> |
17 | #include <litmus/litmus.h> /* for in_list(...) */ | 17 | #include <litmus/litmus.h> /* for in_list(...) */ |
18 | #include <litmus/clock.h> | 18 | #include <litmus/clock.h> |
19 | #ifndef CONFIG_CACHE_PL310 | ||
19 | #include <litmus/color_queue.h> | 20 | #include <litmus/color_queue.h> |
21 | #endif | ||
20 | #include <litmus/way_tracker.h> | 22 | #include <litmus/way_tracker.h> |
21 | #include <litmus/trace.h> | 23 | #include <litmus/trace.h> |
22 | 24 | ||
@@ -222,7 +224,13 @@ void reclaim_pages(struct vm_area_struct *vma) | |||
222 | int color_sched_in_task(struct task_struct *t) | 224 | int color_sched_in_task(struct task_struct *t) |
223 | { | 225 | { |
224 | color_page_info_take_ways(t); | 226 | color_page_info_take_ways(t); |
227 | |||
228 | #ifdef CONFIG_CACHE_PL310 | ||
229 | return color_cache_task(t); | ||
230 | #else | ||
225 | return color_queue_enqueue_read(t); | 231 | return color_queue_enqueue_read(t); |
232 | #endif | ||
233 | |||
226 | } | 234 | } |
227 | 235 | ||
228 | /* | 236 | /* |
@@ -231,7 +239,12 @@ int color_sched_in_task(struct task_struct *t) | |||
231 | int color_sched_out_task(struct task_struct *t) | 239 | int color_sched_out_task(struct task_struct *t) |
232 | { | 240 | { |
233 | color_page_info_release_ways(t); | 241 | color_page_info_release_ways(t); |
242 | |||
243 | #ifdef CONFIG_CACHE_PL310 | ||
244 | return color_uncache_task(t); | ||
245 | #else | ||
234 | return color_queue_enqueue_flush(t); | 246 | return color_queue_enqueue_flush(t); |
247 | #endif | ||
235 | } | 248 | } |
236 | 249 | ||
237 | asmlinkage long sys_set_color_page_info(struct color_ctrl_page __user *user_color_ctrl) | 250 | asmlinkage long sys_set_color_page_info(struct color_ctrl_page __user *user_color_ctrl) |
diff --git a/litmus/color_queue.c b/litmus/color_queue.c index 0b87217a931..913b2f317c1 100644 --- a/litmus/color_queue.c +++ b/litmus/color_queue.c | |||
@@ -456,6 +456,40 @@ out_free: | |||
456 | return ret; | 456 | return ret; |
457 | } | 457 | } |
458 | 458 | ||
459 | int color_cache_task(struct task_struct *t) | ||
460 | { | ||
461 | struct color_page_info *info; | ||
462 | int npages = 0; | ||
463 | |||
464 | list_for_each_entry(info, &tsk_rt(t)->color_page_info_list, list) { | ||
465 | u32 lvalue = unlocked_way[info->way]; | ||
466 | color_read_in_mem_lock(lvalue, LOCK_ALL, | ||
467 | info->vaddr, info->vaddr + PAGE_SIZE); | ||
468 | ++npages; | ||
469 | } | ||
470 | |||
471 | return npages; | ||
472 | } | ||
473 | |||
474 | int color_uncache_task(struct task_struct *t) | ||
475 | { | ||
476 | struct color_page_info *info; | ||
477 | int npages = 0; | ||
478 | |||
479 | |||
480 | list_for_each_entry(info, &tsk_rt(t)->color_page_info_list, list) { | ||
481 | u32 lvalue = unlocked_way[info->way]; | ||
482 | void *vaddr = flusher_pages[info->way][info->color]; | ||
483 | |||
484 | color_read_in_mem_lock(lvalue, LOCK_ALL, | ||
485 | vaddr, vaddr + PAGE_SIZE); | ||
486 | |||
487 | ++npages; | ||
488 | } | ||
489 | |||
490 | return npages; | ||
491 | } | ||
492 | |||
459 | static int __init init_color_queue(void) | 493 | static int __init init_color_queue(void) |
460 | { | 494 | { |
461 | struct cpu_entry *cpu_entry; | 495 | struct cpu_entry *cpu_entry; |
diff --git a/litmus/dgl.c b/litmus/dgl.c index f9cede7ef54..3d6d3201928 100644 --- a/litmus/dgl.c +++ b/litmus/dgl.c | |||
@@ -9,12 +9,10 @@ | |||
9 | 9 | ||
10 | #ifdef DEBUG_DGL | 10 | #ifdef DEBUG_DGL |
11 | #define TRACE(fmt, args...) STRACE(fmt, ## args) | 11 | #define TRACE(fmt, args...) STRACE(fmt, ## args) |
12 | #define STRACE2(fmt, args...) STRACE(fmt, ## args) | ||
13 | #define TRACE_GREQ(greq, fmt, args...) \ | 12 | #define TRACE_GREQ(greq, fmt, args...) \ |
14 | TRACE("(greq-%s/%llu) " fmt, (greq->task ? greq->task->comm : "greq"), \ | 13 | TRACE("(greq-%s/%llu) " fmt, (greq->task ? greq->task->comm : "greq"), \ |
15 | (greq->task ? greq->task->pid : (unsigned long long)greq), ## args) | 14 | (greq->task ? greq->task->pid : (unsigned long long)greq), ## args) |
16 | #else | 15 | #else |
17 | #define STRACE2(fmt, args...) printk(KERN_ERR fmt, ## args) | ||
18 | #define TRACE(fmt, args...) | 16 | #define TRACE(fmt, args...) |
19 | #define TRACE_GREQ(greq, fmt, args...) | 17 | #define TRACE_GREQ(greq, fmt, args...) |
20 | #endif | 18 | #endif |
@@ -72,53 +70,62 @@ static int arr_to_bool(struct dgl *dgl, unsigned long *arr) | |||
72 | return (ret != 0); | 70 | return (ret != 0); |
73 | } | 71 | } |
74 | 72 | ||
75 | static void print_queue(struct dgl *dgl, struct list_head *list) | 73 | #ifdef DEBUG_DGL |
74 | #define DEBUG_BUF_LEN 10000 | ||
75 | DEFINE_PER_CPU(char *, debug_buf); | ||
76 | |||
77 | static char* print_queue(char *buf, struct dgl *dgl, struct list_head *list) | ||
76 | { | 78 | { |
77 | struct dgl_req *pos; | 79 | struct dgl_req *pos; |
78 | struct dgl_group_req *greq; | 80 | struct dgl_group_req *greq; |
79 | 81 | ||
80 | list_for_each_entry(pos, list, list) { | 82 | list_for_each_entry(pos, list, list) { |
81 | greq = pos->greq; | 83 | greq = pos->greq; |
82 | sched_trace_log_message("(%s-%d:r%d-p%x-b%x)->", greq->task->comm, | 84 | buf += sprintf(buf, "(%s/%d:r%d-p%x-b%x)->", greq->task->comm, |
83 | greq->task->pid, pos->replicas, | 85 | greq->task->pid, pos->replicas, |
84 | greq->need_prio[0], | 86 | greq->need_prio[0], greq->blocked[0]); |
85 | greq->blocked[0]); | ||
86 | } | 87 | } |
87 | sched_trace_log_message("\n"); | 88 | buf += sprintf(buf, "\n"); |
89 | |||
90 | return buf; | ||
88 | } | 91 | } |
89 | 92 | ||
90 | static void print_resource(struct dgl *dgl, struct dgl_resource *resource) | 93 | static char* print_resource(char *buf, struct dgl *dgl, |
94 | struct dgl_resource *resource) | ||
91 | { | 95 | { |
92 | STRACE2("\tResource %d, real_free: %d, goal_free: %d\n", | 96 | buf += sprintf(buf, "\tResource %d, real_free: %d, goal_free: %d\n", |
93 | resource_id(dgl, resource), | 97 | resource_id(dgl, resource), |
94 | resource->real_free, | 98 | resource->real_free, |
95 | resource->goal_free); | 99 | resource->goal_free); |
96 | STRACE2("\t acquired: "); | 100 | buf += sprintf(buf, "\t acquired:"); |
97 | print_queue(dgl, &resource->acquired); | 101 | buf = print_queue(buf, dgl, &resource->acquired); |
98 | STRACE2("\t will_acquire:"); | 102 | buf += sprintf(buf, "\t will_acquire:"); |
99 | print_queue(dgl, &resource->will_acquire); | 103 | buf = print_queue(buf, dgl, &resource->will_acquire); |
100 | STRACE2("\t waiting:"); | 104 | buf += sprintf(buf, "\t waiting:"); |
101 | print_queue(dgl, &resource->waiting); | 105 | buf = print_queue(buf, dgl, &resource->waiting); |
102 | STRACE2("\t will_wait:"); | 106 | buf += sprintf(buf, "\t will_wait:"); |
103 | print_queue(dgl, &resource->will_wait); | 107 | buf = print_queue(buf, dgl, &resource->will_wait); |
108 | return buf; | ||
104 | } | 109 | } |
105 | 110 | ||
111 | |||
106 | /* | 112 | /* |
107 | * Print stats and queues of every resource to the trace log. | 113 | * Print stats and queues of every resource to the trace log. |
108 | */ | 114 | */ |
109 | static void print_state(struct dgl *dgl) | 115 | static void print_state(struct dgl *dgl) |
110 | { | 116 | { |
111 | int i; | 117 | int i; |
118 | char *buf, *start; | ||
112 | struct dgl_resource *resource; | 119 | struct dgl_resource *resource; |
113 | 120 | ||
114 | sched_trace_log_message("\n"); | 121 | start = __get_cpu_var(debug_buf); |
115 | STRACE2("\t\tDGL: requests: %d\n", dgl->requests); | 122 | buf = start + sprintf(start, "\n\t\tDGL: requests: %d\n", dgl->requests); |
116 | 123 | ||
117 | for (i = 0; i < dgl->num_resources; ++i) { | 124 | for (i = 0; i < dgl->num_resources; ++i) { |
118 | resource = &dgl->resources[i]; | 125 | resource = &dgl->resources[i]; |
119 | 126 | ||
120 | if (!resource) { | 127 | if (!resource) { |
121 | STRACE2("\tResource %d is null!\n", i); | 128 | buf += sprintf(buf, "\tResource %d is null!\n", i); |
122 | } | 129 | } |
123 | 130 | ||
124 | if (!list_empty(&resource->waiting) || | 131 | if (!list_empty(&resource->waiting) || |
@@ -126,14 +133,16 @@ static void print_state(struct dgl *dgl) | |||
126 | !list_empty(&resource->acquired) || | 133 | !list_empty(&resource->acquired) || |
127 | !list_empty(&resource->will_acquire)) { | 134 | !list_empty(&resource->will_acquire)) { |
128 | 135 | ||
129 | print_resource(dgl, resource); | 136 | buf = print_resource(buf, dgl, resource); |
130 | } | 137 | } |
131 | } | 138 | } |
132 | STRACE2("Dump complete\n"); | 139 | |
133 | sched_trace_log_message("\n"); | 140 | buf += sprintf(buf, "Dump complete\n\n"); |
141 | |||
142 | BUG_ON(buf - start > DEBUG_BUF_LEN); | ||
143 | sched_trace_log_message(start); | ||
134 | } | 144 | } |
135 | 145 | ||
136 | #ifdef DEBUG_DGL | ||
137 | #define BUG_DUMP(dgl, cond) \ | 146 | #define BUG_DUMP(dgl, cond) \ |
138 | do { \ | 147 | do { \ |
139 | if (cond) { \ | 148 | if (cond) { \ |
@@ -142,10 +151,9 @@ static void print_state(struct dgl *dgl) | |||
142 | BUG(); \ | 151 | BUG(); \ |
143 | }} while(0) | 152 | }} while(0) |
144 | #else | 153 | #else |
145 | #define BUG_DUMP(dgl, cond) | 154 | #define BUG_DUMP(dgl, cond) BUG_ON(cond) |
146 | #endif | 155 | #endif |
147 | 156 | ||
148 | |||
149 | static int higher_prio(struct dgl_group_req *a, struct dgl_group_req *b) | 157 | static int higher_prio(struct dgl_group_req *a, struct dgl_group_req *b) |
150 | { | 158 | { |
151 | return (a->priority < b->priority || | 159 | return (a->priority < b->priority || |
@@ -223,14 +231,14 @@ static int get_lp_replicas(struct dgl *dgl, struct dgl_group_req *greq, | |||
223 | * Add @req to @list in priority order. | 231 | * Add @req to @list in priority order. |
224 | * @reverse Reverse priority | 232 | * @reverse Reverse priority |
225 | */ | 233 | */ |
226 | static void add_request(struct list_head *list, struct dgl_req *req, | 234 | static void add_request(struct dgl *dgl, struct list_head *list, |
227 | int reverse) | 235 | struct dgl_req *req, int reverse) |
228 | { | 236 | { |
229 | struct list_head *last; | 237 | struct list_head *last; |
230 | struct dgl_req *acquired; | 238 | struct dgl_req *acquired; |
231 | struct dgl_group_req *greqa, *greqb; | 239 | struct dgl_group_req *greqa, *greqb; |
232 | 240 | ||
233 | BUG_ON(in_list(&req->list)); | 241 | BUG_DUMP(dgl, in_list(&req->list)); |
234 | 242 | ||
235 | last = list; | 243 | last = list; |
236 | list_for_each_entry(acquired, list, list) { | 244 | list_for_each_entry(acquired, list, list) { |
@@ -255,7 +263,7 @@ static void add_request(struct list_head *list, struct dgl_req *req, | |||
255 | static void add_waiting(struct dgl *dgl, struct list_head *list, struct dgl_req *req) | 263 | static void add_waiting(struct dgl *dgl, struct list_head *list, struct dgl_req *req) |
256 | { | 264 | { |
257 | BUG_DUMP(dgl, !arr_to_bool(dgl, req->greq->need_prio)); | 265 | BUG_DUMP(dgl, !arr_to_bool(dgl, req->greq->need_prio)); |
258 | add_request(list, req, 0); | 266 | add_request(dgl, list, req, 0); |
259 | } | 267 | } |
260 | 268 | ||
261 | /* | 269 | /* |
@@ -264,7 +272,7 @@ static void add_waiting(struct dgl *dgl, struct list_head *list, struct dgl_req | |||
264 | static void add_acquired(struct dgl *dgl, struct list_head *list, struct dgl_req *req) | 272 | static void add_acquired(struct dgl *dgl, struct list_head *list, struct dgl_req *req) |
265 | { | 273 | { |
266 | BUG_DUMP(dgl, arr_to_bool(dgl, req->greq->need_prio)); | 274 | BUG_DUMP(dgl, arr_to_bool(dgl, req->greq->need_prio)); |
267 | add_request(list, req, 1); | 275 | add_request(dgl, list, req, 1); |
268 | } | 276 | } |
269 | 277 | ||
270 | /* | 278 | /* |
@@ -888,3 +896,21 @@ void dgl_group_req_free(struct dgl_group_req *greq) | |||
888 | kfree(greq->need_prio); | 896 | kfree(greq->need_prio); |
889 | kfree(greq->requests); | 897 | kfree(greq->requests); |
890 | } | 898 | } |
899 | |||
900 | #ifdef DEBUG_DGL | ||
901 | static int __init init_dgl_debug(void) | ||
902 | { | ||
903 | int cpu; | ||
904 | char **buf; | ||
905 | |||
906 | for_each_online_cpu(cpu) { | ||
907 | buf = &per_cpu(debug_buf, cpu); | ||
908 | *buf = kmalloc(DEBUG_BUF_LEN * sizeof(char), GFP_ATOMIC); | ||
909 | } | ||
910 | |||
911 | return 0; | ||
912 | } | ||
913 | |||
914 | module_init(init_dgl_debug); | ||
915 | |||
916 | #endif | ||
diff --git a/litmus/lockdown.c b/litmus/lockdown.c index 8e10bc66b86..a718ffc9c9b 100644 --- a/litmus/lockdown.c +++ b/litmus/lockdown.c | |||
@@ -79,6 +79,7 @@ void litmus_setup_lockdown(void __iomem *base, u32 id) | |||
79 | extern void v7_flush_kern_dcache_area(void *, size_t); | 79 | extern void v7_flush_kern_dcache_area(void *, size_t); |
80 | 80 | ||
81 | static void __iomem *cache_base; | 81 | static void __iomem *cache_base; |
82 | |||
82 | static void __iomem *lockreg_d; | 83 | static void __iomem *lockreg_d; |
83 | static void __iomem *lockreg_i; | 84 | static void __iomem *lockreg_i; |
84 | static raw_spinlock_t prefetch_lock; | 85 | static raw_spinlock_t prefetch_lock; |
@@ -115,7 +116,11 @@ u32 color_read_in_mem(u32 lock_val, u32 unlock_val, void *start, void *end) | |||
115 | : [addr] "+r" (start), | 116 | : [addr] "+r" (start), |
116 | [val] "+r" (v) | 117 | [val] "+r" (v) |
117 | : [end] "r" (end), | 118 | : [end] "r" (end), |
119 | #ifdef CONFIG_CACHE_PL310 | ||
120 | [cachereg] "r" (ld_d_reg(raw_smp_processor_id())), | ||
121 | #else | ||
118 | [cachereg] "r" (lockreg_d), | 122 | [cachereg] "r" (lockreg_d), |
123 | #endif | ||
119 | [lockval] "r" (lock_val) | 124 | [lockval] "r" (lock_val) |
120 | : "cc"); | 125 | : "cc"); |
121 | 126 | ||
@@ -139,7 +144,10 @@ u32 color_read_in_mem_lock(u32 lock_val, u32 unlock_val, void *start, void *end) | |||
139 | unsigned long flags; | 144 | unsigned long flags; |
140 | u32 v = 0; | 145 | u32 v = 0; |
141 | 146 | ||
147 | #ifndef CONFIG_CACHE_PL310 | ||
142 | raw_spin_lock_irqsave(&prefetch_lock, flags); | 148 | raw_spin_lock_irqsave(&prefetch_lock, flags); |
149 | #endif | ||
150 | |||
143 | __asm__ __volatile__ ( | 151 | __asm__ __volatile__ ( |
144 | " .align 5\n" | 152 | " .align 5\n" |
145 | " str %[lockval], [%[cachereg]]\n" | 153 | " str %[lockval], [%[cachereg]]\n" |
@@ -150,11 +158,18 @@ u32 color_read_in_mem_lock(u32 lock_val, u32 unlock_val, void *start, void *end) | |||
150 | : [addr] "+r" (start), | 158 | : [addr] "+r" (start), |
151 | [val] "+r" (v) | 159 | [val] "+r" (v) |
152 | : [end] "r" (end), | 160 | : [end] "r" (end), |
161 | #ifdef CONFIG_CACHE_PL310 | ||
162 | [cachereg] "r" (ld_d_reg(raw_smp_processor_id())), | ||
163 | #else | ||
153 | [cachereg] "r" (lockreg_d), | 164 | [cachereg] "r" (lockreg_d), |
165 | #endif | ||
154 | [lockval] "r" (lock_val), | 166 | [lockval] "r" (lock_val), |
155 | [unlockval] "r" (unlock_val) | 167 | [unlockval] "r" (unlock_val) |
156 | : "cc"); | 168 | : "cc"); |
169 | |||
170 | #ifndef CONFIG_CACHE_PL310 | ||
157 | raw_spin_unlock_irqrestore(&prefetch_lock, flags); | 171 | raw_spin_unlock_irqrestore(&prefetch_lock, flags); |
172 | #endif | ||
158 | 173 | ||
159 | return v; | 174 | return v; |
160 | } | 175 | } |
@@ -334,9 +349,16 @@ int litmus_lockdown_proc_handler(struct ctl_table *table, int write, | |||
334 | 349 | ||
335 | #define TRIALS 1000 | 350 | #define TRIALS 1000 |
336 | 351 | ||
352 | static void sleep_ns(int ns) | ||
353 | { | ||
354 | int i; | ||
355 | lt_t start = litmus_clock(); | ||
356 | for (i = 0; litmus_clock() - start < ns;i++); | ||
357 | } | ||
358 | |||
337 | static int test_get_cycles_overhead(void) | 359 | static int test_get_cycles_overhead(void) |
338 | { | 360 | { |
339 | u64 sum = 0, min = (u64)-1, max = 0; | 361 | u64 avg = 0, min = (u64)-1, max = 0; |
340 | unsigned long flags; | 362 | unsigned long flags; |
341 | cycles_t a, b; | 363 | cycles_t a, b; |
342 | int i; | 364 | int i; |
@@ -346,6 +368,7 @@ static int test_get_cycles_overhead(void) | |||
346 | local_irq_save(flags); | 368 | local_irq_save(flags); |
347 | preempt_disable(); | 369 | preempt_disable(); |
348 | a = litmus_get_cycles(); | 370 | a = litmus_get_cycles(); |
371 | sleep_ns(15000); | ||
349 | b = litmus_get_cycles(); | 372 | b = litmus_get_cycles(); |
350 | preempt_enable(); | 373 | preempt_enable(); |
351 | local_irq_restore(flags); | 374 | local_irq_restore(flags); |
@@ -354,10 +377,11 @@ static int test_get_cycles_overhead(void) | |||
354 | max = diff; | 377 | max = diff; |
355 | if (diff < min) | 378 | if (diff < min) |
356 | min = diff; | 379 | min = diff; |
357 | sum += diff; | 380 | avg += div64_u64(diff, TRIALS); |
358 | } | 381 | } |
359 | printk("cycle test: avg: %llu min: %llu max: %llu\n", | 382 | printk("cycle test 15us: avg: %llu min: %llu max: %llu\n", |
360 | div64_u64(sum, TRIALS), min, max); | 383 | avg, min, max); |
384 | |||
361 | return 0; | 385 | return 0; |
362 | } | 386 | } |
363 | 387 | ||
@@ -665,7 +689,7 @@ int litmus_test_prefetch_proc_handler(struct ctl_table *table, int write, | |||
665 | 689 | ||
666 | free_page((unsigned long)vaddr); | 690 | free_page((unsigned long)vaddr); |
667 | 691 | ||
668 | //test_get_cycles_overhead(); | 692 | test_get_cycles_overhead(); |
669 | test_read_in(); | 693 | test_read_in(); |
670 | 694 | ||
671 | return 0; | 695 | return 0; |
diff --git a/litmus/sched_mc.c b/litmus/sched_mc.c index 64de4ef9c46..6edf86935a2 100644 --- a/litmus/sched_mc.c +++ b/litmus/sched_mc.c | |||
@@ -30,7 +30,7 @@ | |||
30 | #include <litmus/dgl.h> | 30 | #include <litmus/dgl.h> |
31 | #include <litmus/color.h> | 31 | #include <litmus/color.h> |
32 | #include <litmus/way_tracker.h> | 32 | #include <litmus/way_tracker.h> |
33 | 33 | #warning "MUST ADD CHECK FOR MAX WAYS" | |
34 | struct mc_signal { | 34 | struct mc_signal { |
35 | int update:1; | 35 | int update:1; |
36 | int preempt:1; | 36 | int preempt:1; |
@@ -58,6 +58,10 @@ struct cpu_entry { | |||
58 | #endif | 58 | #endif |
59 | }; | 59 | }; |
60 | 60 | ||
61 | #ifndef CONFIG_NP_SECTION | ||
62 | #error "Need NP section for coloring!" | ||
63 | #endif | ||
64 | |||
61 | static struct dgl group_lock; | 65 | static struct dgl group_lock; |
62 | static raw_spinlock_t dgl_lock; | 66 | static raw_spinlock_t dgl_lock; |
63 | 67 | ||
@@ -97,7 +101,6 @@ static int acquire_resources(struct task_struct *t) | |||
97 | 101 | ||
98 | BUG_ON(tsk_rt(t)->linked_on == NO_CPU); | 102 | BUG_ON(tsk_rt(t)->linked_on == NO_CPU); |
99 | 103 | ||
100 | |||
101 | raw_spin_lock(&dgl_lock); | 104 | raw_spin_lock(&dgl_lock); |
102 | 105 | ||
103 | cpu = tsk_rt(t)->linked_on; | 106 | cpu = tsk_rt(t)->linked_on; |
diff --git a/litmus/sched_trace.c b/litmus/sched_trace.c index f4171fddbbb..5acb4a48fb6 100644 --- a/litmus/sched_trace.c +++ b/litmus/sched_trace.c | |||
@@ -26,7 +26,7 @@ | |||
26 | 26 | ||
27 | /* Max length for one write --- by TRACE() --- to the buffer. This is used to | 27 | /* Max length for one write --- by TRACE() --- to the buffer. This is used to |
28 | * allocate a per-cpu buffer for printf() formatting. */ | 28 | * allocate a per-cpu buffer for printf() formatting. */ |
29 | #define MSG_SIZE 255 | 29 | #define MSG_SIZE 10000 |
30 | 30 | ||
31 | 31 | ||
32 | static DEFINE_MUTEX(reader_mutex); | 32 | static DEFINE_MUTEX(reader_mutex); |
@@ -35,7 +35,7 @@ static DEFINE_KFIFO(debug_buffer, char, LITMUS_TRACE_BUF_SIZE); | |||
35 | 35 | ||
36 | 36 | ||
37 | static DEFINE_RAW_SPINLOCK(log_buffer_lock); | 37 | static DEFINE_RAW_SPINLOCK(log_buffer_lock); |
38 | static DEFINE_PER_CPU(char[MSG_SIZE], fmt_buffer); | 38 | static DEFINE_PER_CPU(char*, fmt_buffer); |
39 | 39 | ||
40 | /* | 40 | /* |
41 | * sched_trace_log_message - Write to the trace buffer (log_buffer) | 41 | * sched_trace_log_message - Write to the trace buffer (log_buffer) |
@@ -230,8 +230,17 @@ static struct sysrq_key_op sysrq_dump_trace_buffer_op = { | |||
230 | 230 | ||
231 | static int __init init_sched_trace(void) | 231 | static int __init init_sched_trace(void) |
232 | { | 232 | { |
233 | int cpu; | ||
234 | char **buf; | ||
235 | |||
236 | |||
233 | printk("Initializing TRACE() device\n"); | 237 | printk("Initializing TRACE() device\n"); |
234 | 238 | ||
239 | for_each_online_cpu(cpu) { | ||
240 | buf = &per_cpu(fmt_buffer, cpu); | ||
241 | *buf = kmalloc(MSG_SIZE * sizeof(char), GFP_ATOMIC); | ||
242 | } | ||
243 | |||
235 | #ifdef CONFIG_MAGIC_SYSRQ | 244 | #ifdef CONFIG_MAGIC_SYSRQ |
236 | /* offer some debugging help */ | 245 | /* offer some debugging help */ |
237 | if (!register_sysrq_key('y', &sysrq_dump_trace_buffer_op)) | 246 | if (!register_sysrq_key('y', &sysrq_dump_trace_buffer_op)) |
diff --git a/litmus/way_tracker.c b/litmus/way_tracker.c index a9e8ef62f37..ff392ab09c4 100644 --- a/litmus/way_tracker.c +++ b/litmus/way_tracker.c | |||
@@ -6,6 +6,7 @@ | |||
6 | #include <linux/bitops.h> | 6 | #include <linux/bitops.h> |
7 | #include <linux/slab.h> | 7 | #include <linux/slab.h> |
8 | #include <linux/list.h> | 8 | #include <linux/list.h> |
9 | #include <linux/kgdb.h> | ||
9 | 10 | ||
10 | #include <litmus/litmus.h> | 11 | #include <litmus/litmus.h> |
11 | #include <litmus/color.h> | 12 | #include <litmus/color.h> |
@@ -38,7 +39,9 @@ static int take_next_way(unsigned int color) | |||
38 | clear_bit(idx, &ways[color]); | 39 | clear_bit(idx, &ways[color]); |
39 | TRACE("Took, now %lu free of color %d\n", hweight_long(ways[color]), color); | 40 | TRACE("Took, now %lu free of color %d\n", hweight_long(ways[color]), color); |
40 | } else { | 41 | } else { |
42 | printk(KERN_WARNING "Vury bad\n"); | ||
41 | /* Seriously bad. */ | 43 | /* Seriously bad. */ |
44 | kgdb_breakpoint(); | ||
42 | BUG(); | 45 | BUG(); |
43 | } | 46 | } |
44 | raw_spin_unlock(&lock); | 47 | raw_spin_unlock(&lock); |