diff options
Diffstat (limited to 'litmus/sched_cedf.c')
-rw-r--r-- | litmus/sched_cedf.c | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/litmus/sched_cedf.c b/litmus/sched_cedf.c index 4924da21865e..02106f455c0f 100644 --- a/litmus/sched_cedf.c +++ b/litmus/sched_cedf.c | |||
@@ -124,7 +124,6 @@ typedef struct clusterdomain { | |||
124 | 124 | ||
125 | 125 | ||
126 | #ifdef CONFIG_LITMUS_PAI_SOFTIRQD | 126 | #ifdef CONFIG_LITMUS_PAI_SOFTIRQD |
127 | raw_spinlock_t tasklet_lock; | ||
128 | struct tasklet_head pending_tasklets; | 127 | struct tasklet_head pending_tasklets; |
129 | #endif | 128 | #endif |
130 | 129 | ||
@@ -430,7 +429,7 @@ static void cedf_tick(struct task_struct* t) | |||
430 | #ifdef CONFIG_LITMUS_PAI_SOFTIRQD | 429 | #ifdef CONFIG_LITMUS_PAI_SOFTIRQD |
431 | 430 | ||
432 | 431 | ||
433 | void __do_lit_tasklet(struct tasklet_struct* tasklet, unsigned long flushed) | 432 | static void __do_lit_tasklet(struct tasklet_struct* tasklet, unsigned long flushed) |
434 | { | 433 | { |
435 | if (!atomic_read(&tasklet->count)) { | 434 | if (!atomic_read(&tasklet->count)) { |
436 | sched_trace_tasklet_begin(tasklet->owner); | 435 | sched_trace_tasklet_begin(tasklet->owner); |
@@ -451,7 +450,7 @@ void __do_lit_tasklet(struct tasklet_struct* tasklet, unsigned long flushed) | |||
451 | } | 450 | } |
452 | 451 | ||
453 | 452 | ||
454 | void __extract_tasklets(cedf_domain_t* cluster, struct task_struct* task, struct tasklet_head* task_tasklets) | 453 | static void __extract_tasklets(cedf_domain_t* cluster, struct task_struct* task, struct tasklet_head* task_tasklets) |
455 | { | 454 | { |
456 | struct tasklet_struct* step; | 455 | struct tasklet_struct* step; |
457 | struct tasklet_struct* tasklet; | 456 | struct tasklet_struct* tasklet; |
@@ -497,7 +496,7 @@ void __extract_tasklets(cedf_domain_t* cluster, struct task_struct* task, struct | |||
497 | } | 496 | } |
498 | } | 497 | } |
499 | 498 | ||
500 | void flush_tasklets(cedf_domain_t* cluster, struct task_struct* task) | 499 | static void flush_tasklets(cedf_domain_t* cluster, struct task_struct* task) |
501 | { | 500 | { |
502 | unsigned long flags; | 501 | unsigned long flags; |
503 | struct tasklet_head task_tasklets; | 502 | struct tasklet_head task_tasklets; |
@@ -524,18 +523,18 @@ void flush_tasklets(cedf_domain_t* cluster, struct task_struct* task) | |||
524 | } | 523 | } |
525 | 524 | ||
526 | 525 | ||
527 | void do_lit_tasklets(cedf_domain_t* cluster, struct task_struct* sched_task) | 526 | static void do_lit_tasklets(cedf_domain_t* cluster, struct task_struct* sched_task) |
528 | { | 527 | { |
529 | int work_to_do = 1; | 528 | int work_to_do = 1; |
530 | struct tasklet_struct *tasklet = NULL; | 529 | struct tasklet_struct *tasklet = NULL; |
531 | struct tasklet_struct *step; | 530 | //struct tasklet_struct *step; |
532 | unsigned long flags; | 531 | unsigned long flags; |
533 | 532 | ||
534 | while(work_to_do) { | 533 | while(work_to_do) { |
535 | // remove tasklet at head of list if it has higher priority. | 534 | // remove tasklet at head of list if it has higher priority. |
536 | raw_spin_lock_irqsave(&cluster->cedf_lock, flags); | 535 | raw_spin_lock_irqsave(&cluster->cedf_lock, flags); |
537 | 536 | ||
538 | 537 | /* | |
539 | step = cluster->pending_tasklets.head; | 538 | step = cluster->pending_tasklets.head; |
540 | TRACE("%s: (BEFORE) dumping tasklet queue...\n", __FUNCTION__); | 539 | TRACE("%s: (BEFORE) dumping tasklet queue...\n", __FUNCTION__); |
541 | while(step != NULL){ | 540 | while(step != NULL){ |
@@ -544,6 +543,7 @@ void do_lit_tasklets(cedf_domain_t* cluster, struct task_struct* sched_task) | |||
544 | } | 543 | } |
545 | TRACE("%s: tail = %p (%d)\n", __FUNCTION__, *(cluster->pending_tasklets.tail), (*(cluster->pending_tasklets.tail) != NULL) ? (*(cluster->pending_tasklets.tail))->owner->pid : -1); | 544 | TRACE("%s: tail = %p (%d)\n", __FUNCTION__, *(cluster->pending_tasklets.tail), (*(cluster->pending_tasklets.tail) != NULL) ? (*(cluster->pending_tasklets.tail))->owner->pid : -1); |
546 | TRACE("%s: done.\n", __FUNCTION__); | 545 | TRACE("%s: done.\n", __FUNCTION__); |
546 | */ | ||
547 | 547 | ||
548 | 548 | ||
549 | if(cluster->pending_tasklets.head != NULL) { | 549 | if(cluster->pending_tasklets.head != NULL) { |
@@ -573,6 +573,7 @@ void do_lit_tasklets(cedf_domain_t* cluster, struct task_struct* sched_task) | |||
573 | } | 573 | } |
574 | 574 | ||
575 | 575 | ||
576 | /* | ||
576 | step = cluster->pending_tasklets.head; | 577 | step = cluster->pending_tasklets.head; |
577 | TRACE("%s: (AFTER) dumping tasklet queue...\n", __FUNCTION__); | 578 | TRACE("%s: (AFTER) dumping tasklet queue...\n", __FUNCTION__); |
578 | while(step != NULL){ | 579 | while(step != NULL){ |
@@ -581,6 +582,7 @@ void do_lit_tasklets(cedf_domain_t* cluster, struct task_struct* sched_task) | |||
581 | } | 582 | } |
582 | TRACE("%s: tail = %p (%d)\n", __FUNCTION__, *(cluster->pending_tasklets.tail), (*(cluster->pending_tasklets.tail) != NULL) ? (*(cluster->pending_tasklets.tail))->owner->pid : -1); | 583 | TRACE("%s: tail = %p (%d)\n", __FUNCTION__, *(cluster->pending_tasklets.tail), (*(cluster->pending_tasklets.tail) != NULL) ? (*(cluster->pending_tasklets.tail))->owner->pid : -1); |
583 | TRACE("%s: done.\n", __FUNCTION__); | 584 | TRACE("%s: done.\n", __FUNCTION__); |
585 | */ | ||
584 | 586 | ||
585 | 587 | ||
586 | raw_spin_unlock_irqrestore(&cluster->cedf_lock, flags); | 588 | raw_spin_unlock_irqrestore(&cluster->cedf_lock, flags); |
@@ -598,7 +600,7 @@ void do_lit_tasklets(cedf_domain_t* cluster, struct task_struct* sched_task) | |||
598 | } | 600 | } |
599 | 601 | ||
600 | 602 | ||
601 | void run_tasklets(struct task_struct* sched_task) | 603 | static void run_tasklets(struct task_struct* sched_task) |
602 | { | 604 | { |
603 | cedf_domain_t* cluster; | 605 | cedf_domain_t* cluster; |
604 | 606 | ||
@@ -641,10 +643,11 @@ void run_tasklets(struct task_struct* sched_task) | |||
641 | } | 643 | } |
642 | 644 | ||
643 | 645 | ||
644 | void __add_pai_tasklet(struct tasklet_struct* tasklet, cedf_domain_t* cluster) | 646 | static void __add_pai_tasklet(struct tasklet_struct* tasklet, cedf_domain_t* cluster) |
645 | { | 647 | { |
646 | struct tasklet_struct* step; | 648 | struct tasklet_struct* step; |
647 | 649 | ||
650 | /* | ||
648 | step = cluster->pending_tasklets.head; | 651 | step = cluster->pending_tasklets.head; |
649 | TRACE("%s: (BEFORE) dumping tasklet queue...\n", __FUNCTION__); | 652 | TRACE("%s: (BEFORE) dumping tasklet queue...\n", __FUNCTION__); |
650 | while(step != NULL){ | 653 | while(step != NULL){ |
@@ -653,6 +656,7 @@ void __add_pai_tasklet(struct tasklet_struct* tasklet, cedf_domain_t* cluster) | |||
653 | } | 656 | } |
654 | TRACE("%s: tail = %p (%d)\n", __FUNCTION__, *(cluster->pending_tasklets.tail), (*(cluster->pending_tasklets.tail) != NULL) ? (*(cluster->pending_tasklets.tail))->owner->pid : -1); | 657 | TRACE("%s: tail = %p (%d)\n", __FUNCTION__, *(cluster->pending_tasklets.tail), (*(cluster->pending_tasklets.tail) != NULL) ? (*(cluster->pending_tasklets.tail))->owner->pid : -1); |
655 | TRACE("%s: done.\n", __FUNCTION__); | 658 | TRACE("%s: done.\n", __FUNCTION__); |
659 | */ | ||
656 | 660 | ||
657 | 661 | ||
658 | tasklet->next = NULL; // make sure there are no old values floating around | 662 | tasklet->next = NULL; // make sure there are no old values floating around |
@@ -674,7 +678,7 @@ void __add_pai_tasklet(struct tasklet_struct* tasklet, cedf_domain_t* cluster) | |||
674 | } | 678 | } |
675 | else { | 679 | else { |
676 | 680 | ||
677 | WARN_ON(1 == 1); | 681 | //WARN_ON(1 == 1); |
678 | 682 | ||
679 | // insert the tasklet somewhere in the middle. | 683 | // insert the tasklet somewhere in the middle. |
680 | 684 | ||
@@ -699,7 +703,7 @@ void __add_pai_tasklet(struct tasklet_struct* tasklet, cedf_domain_t* cluster) | |||
699 | } | 703 | } |
700 | } | 704 | } |
701 | 705 | ||
702 | 706 | /* | |
703 | step = cluster->pending_tasklets.head; | 707 | step = cluster->pending_tasklets.head; |
704 | TRACE("%s: (AFTER) dumping tasklet queue...\n", __FUNCTION__); | 708 | TRACE("%s: (AFTER) dumping tasklet queue...\n", __FUNCTION__); |
705 | while(step != NULL){ | 709 | while(step != NULL){ |
@@ -707,7 +711,8 @@ void __add_pai_tasklet(struct tasklet_struct* tasklet, cedf_domain_t* cluster) | |||
707 | step = step->next; | 711 | step = step->next; |
708 | } | 712 | } |
709 | TRACE("%s: tail = %p (%d)\n", __FUNCTION__, *(cluster->pending_tasklets.tail), (*(cluster->pending_tasklets.tail) != NULL) ? (*(cluster->pending_tasklets.tail))->owner->pid : -1); | 713 | TRACE("%s: tail = %p (%d)\n", __FUNCTION__, *(cluster->pending_tasklets.tail), (*(cluster->pending_tasklets.tail) != NULL) ? (*(cluster->pending_tasklets.tail))->owner->pid : -1); |
710 | TRACE("%s: done.\n", __FUNCTION__); | 714 | TRACE("%s: done.\n", __FUNCTION__); |
715 | */ | ||
711 | 716 | ||
712 | // TODO: Maintain this list in priority order. | 717 | // TODO: Maintain this list in priority order. |
713 | // tasklet->next = NULL; | 718 | // tasklet->next = NULL; |
@@ -715,7 +720,7 @@ void __add_pai_tasklet(struct tasklet_struct* tasklet, cedf_domain_t* cluster) | |||
715 | // cluster->pending_tasklets.tail = &tasklet->next; | 720 | // cluster->pending_tasklets.tail = &tasklet->next; |
716 | } | 721 | } |
717 | 722 | ||
718 | int enqueue_pai_tasklet(struct tasklet_struct* tasklet) | 723 | static int enqueue_pai_tasklet(struct tasklet_struct* tasklet) |
719 | { | 724 | { |
720 | cedf_domain_t *cluster = NULL; | 725 | cedf_domain_t *cluster = NULL; |
721 | cpu_entry_t *targetCPU = NULL; | 726 | cpu_entry_t *targetCPU = NULL; |
@@ -1909,7 +1914,6 @@ static long cedf_activate_plugin(void) | |||
1909 | 1914 | ||
1910 | 1915 | ||
1911 | #ifdef CONFIG_LITMUS_PAI_SOFTIRQD | 1916 | #ifdef CONFIG_LITMUS_PAI_SOFTIRQD |
1912 | raw_spin_lock_init(&(cedf[i].tasklet_lock)); | ||
1913 | cedf[i].pending_tasklets.head = NULL; | 1917 | cedf[i].pending_tasklets.head = NULL; |
1914 | cedf[i].pending_tasklets.tail = &(cedf[i].pending_tasklets.head); | 1918 | cedf[i].pending_tasklets.tail = &(cedf[i].pending_tasklets.head); |
1915 | #endif | 1919 | #endif |