diff options
author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2011-02-10 20:05:15 -0500 |
---|---|---|
committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2011-02-10 20:05:15 -0500 |
commit | c4447e36a02cb8fdc4fd3966f5e33c0d4c574737 (patch) | |
tree | 991939f60a593a0f8324c6a2be70d7a97911e088 /litmus | |
parent | a0206b3f4de6da9945d4e9d2249cc2ca6bd1aba2 (diff) |
PSN-EDF: add release master support
We can give up a processor under partitioning, too.
Diffstat (limited to 'litmus')
-rw-r--r-- | litmus/sched_psn_edf.c | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/litmus/sched_psn_edf.c b/litmus/sched_psn_edf.c index 250c55a1e13d..9e62b0504b20 100644 --- a/litmus/sched_psn_edf.c +++ b/litmus/sched_psn_edf.c | |||
@@ -384,12 +384,6 @@ static unsigned int psnedf_get_srp_prio(struct task_struct* t) | |||
384 | return get_rt_period(t); | 384 | return get_rt_period(t); |
385 | } | 385 | } |
386 | 386 | ||
387 | static long psnedf_activate_plugin(void) | ||
388 | { | ||
389 | get_srp_prio = psnedf_get_srp_prio; | ||
390 | return 0; | ||
391 | } | ||
392 | |||
393 | /* ******************** FMLP support ********************** */ | 387 | /* ******************** FMLP support ********************** */ |
394 | 388 | ||
395 | /* struct for semaphore with priority inheritance */ | 389 | /* struct for semaphore with priority inheritance */ |
@@ -586,9 +580,35 @@ static long psnedf_allocate_lock(struct litmus_lock **lock, int type, | |||
586 | 580 | ||
587 | #endif | 581 | #endif |
588 | 582 | ||
583 | |||
584 | static long psnedf_activate_plugin(void) | ||
585 | { | ||
586 | #ifdef CONFIG_RELEASE_MASTER | ||
587 | int cpu; | ||
588 | |||
589 | for_each_online_cpu(cpu) { | ||
590 | remote_edf(cpu)->release_master = atomic_read(&release_master_cpu); | ||
591 | } | ||
592 | #endif | ||
593 | |||
594 | #ifdef CONFIG_LITMUS_LOCKING | ||
595 | get_srp_prio = psnedf_get_srp_prio; | ||
596 | #endif | ||
597 | |||
598 | return 0; | ||
599 | } | ||
600 | |||
589 | static long psnedf_admit_task(struct task_struct* tsk) | 601 | static long psnedf_admit_task(struct task_struct* tsk) |
590 | { | 602 | { |
591 | return task_cpu(tsk) == tsk->rt_param.task_params.cpu ? 0 : -EINVAL; | 603 | if (task_cpu(tsk) == tsk->rt_param.task_params.cpu |
604 | #ifdef CONFIG_RELEASE_MASTER | ||
605 | /* don't allow tasks on release master CPU */ | ||
606 | && task_cpu(tsk) != remote_edf(task_cpu(tsk))->release_master | ||
607 | #endif | ||
608 | ) | ||
609 | return 0; | ||
610 | else | ||
611 | return -EINVAL; | ||
592 | } | 612 | } |
593 | 613 | ||
594 | /* Plugin object */ | 614 | /* Plugin object */ |
@@ -602,9 +622,9 @@ static struct sched_plugin psn_edf_plugin __cacheline_aligned_in_smp = { | |||
602 | .task_wake_up = psnedf_task_wake_up, | 622 | .task_wake_up = psnedf_task_wake_up, |
603 | .task_block = psnedf_task_block, | 623 | .task_block = psnedf_task_block, |
604 | .admit_task = psnedf_admit_task, | 624 | .admit_task = psnedf_admit_task, |
625 | .activate_plugin = psnedf_activate_plugin, | ||
605 | #ifdef CONFIG_LITMUS_LOCKING | 626 | #ifdef CONFIG_LITMUS_LOCKING |
606 | .allocate_lock = psnedf_allocate_lock, | 627 | .allocate_lock = psnedf_allocate_lock, |
607 | .activate_plugin = psnedf_activate_plugin, | ||
608 | #endif | 628 | #endif |
609 | }; | 629 | }; |
610 | 630 | ||