diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-12-11 22:01:01 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-12-12 14:14:41 -0500 |
commit | c8483ef0959672310bf4ebb72e1a308b00543f74 (patch) | |
tree | 9cb306009b01c5226178f69172738026431d37f2 /litmus/locking.c | |
parent | fbd9574e298157b54c38f82f536e5cea8f766dff (diff) |
make klmirqd work like aux tasks. checkpoint.
this code is untested!
Diffstat (limited to 'litmus/locking.c')
-rw-r--r-- | litmus/locking.c | 56 |
1 files changed, 39 insertions, 17 deletions
diff --git a/litmus/locking.c b/litmus/locking.c index 22f46df4308a..7af1dd69a079 100644 --- a/litmus/locking.c +++ b/litmus/locking.c | |||
@@ -543,32 +543,54 @@ out: | |||
543 | 543 | ||
544 | void suspend_for_lock(void) | 544 | void suspend_for_lock(void) |
545 | { | 545 | { |
546 | #ifdef CONFIG_REALTIME_AUX_TASKS | 546 | #if defined(CONFIG_REALTIME_AUX_TASKS) || defined(CONFIG_LITMUS_NVIDIA) |
547 | #if 0 | ||
548 | unsigned int restore = 0; | ||
549 | struct task_struct *t = current; | 547 | struct task_struct *t = current; |
550 | unsigned int hide; | ||
551 | |||
552 | if (tsk_rt(t)->has_aux_tasks) { | ||
553 | /* hide from aux tasks so they can't inherit our priority when we block | ||
554 | * for a litmus lock. inheritance is already going to a litmus lock | ||
555 | * holder. */ | ||
556 | hide = tsk_rt(t)->hide_from_aux_tasks; | ||
557 | restore = 1; | ||
558 | tsk_rt(t)->hide_from_aux_tasks = 1; | ||
559 | } | ||
560 | #endif | 548 | #endif |
549 | |||
550 | #ifdef CONFIG_REALTIME_AUX_TASKS | ||
551 | unsigned int aux_restore = 0; | ||
552 | unsigned int aux_hide; | ||
553 | #endif | ||
554 | |||
555 | #ifdef CONFIG_LITMUS_NVIDIA | ||
556 | unsigned int gpu_restore = 0; | ||
557 | unsigned int gpu_hide; | ||
558 | #endif | ||
559 | |||
560 | |||
561 | //#ifdef CONFIG_REALTIME_AUX_TASKS | ||
562 | // if (tsk_rt(t)->has_aux_tasks) { | ||
563 | // /* hide from aux tasks so they can't inherit our priority when we block | ||
564 | // * for a litmus lock. inheritance is already going to a litmus lock | ||
565 | // * holder. */ | ||
566 | // aux_hide = tsk_rt(t)->hide_from_aux_tasks; | ||
567 | // aux_restore = 1; | ||
568 | // tsk_rt(t)->hide_from_aux_tasks = 1; | ||
569 | // } | ||
570 | //#endif | ||
571 | |||
572 | #ifdef CONFIG_LITMUS_NVIDIA | ||
573 | if (tsk_rt(t)->held_gpus) { | ||
574 | gpu_hide = tsk_rt(t)->hide_from_gpu; | ||
575 | gpu_restore = 1; | ||
576 | tsk_rt(t)->hide_from_gpu = 1; | ||
577 | } | ||
561 | #endif | 578 | #endif |
562 | 579 | ||
563 | schedule(); | 580 | schedule(); |
564 | 581 | ||
565 | #ifdef CONFIG_REALTIME_AUX_TASKS | 582 | #ifdef CONFIG_LITMUS_NVIDIA |
566 | #if 0 | 583 | if (gpu_restore) { |
567 | if (restore) { | ||
568 | /* restore our state */ | 584 | /* restore our state */ |
569 | tsk_rt(t)->hide_from_aux_tasks = hide; | 585 | tsk_rt(t)->hide_from_gpu = gpu_hide; |
570 | } | 586 | } |
571 | #endif | 587 | #endif |
588 | |||
589 | #ifdef CONFIG_REALTIME_AUX_TASKS | ||
590 | if (aux_restore) { | ||
591 | /* restore our state */ | ||
592 | tsk_rt(t)->hide_from_aux_tasks = aux_hide; | ||
593 | } | ||
572 | #endif | 594 | #endif |
573 | } | 595 | } |
574 | 596 | ||