diff options
author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2011-02-10 20:06:18 -0500 |
---|---|---|
committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2011-02-10 20:06:18 -0500 |
commit | abf7c9749f9e278d342bcc65713f0e8cd420109e (patch) | |
tree | 7954e631fcf4650df4e598608dcf03f6c258099b | |
parent | c4447e36a02cb8fdc4fd3966f5e33c0d4c574737 (diff) |
P-FP: add release master support
-rw-r--r-- | litmus/sched_pfp.c | 37 |
1 files changed, 28 insertions, 9 deletions
diff --git a/litmus/sched_pfp.c b/litmus/sched_pfp.c index fb7433dacf40..926c391e7c34 100644 --- a/litmus/sched_pfp.c +++ b/litmus/sched_pfp.c | |||
@@ -389,12 +389,6 @@ static unsigned int pfp_get_srp_prio(struct task_struct* t) | |||
389 | return get_priority(t); | 389 | return get_priority(t); |
390 | } | 390 | } |
391 | 391 | ||
392 | static long pfp_activate_plugin(void) | ||
393 | { | ||
394 | get_srp_prio = pfp_get_srp_prio; | ||
395 | return 0; | ||
396 | } | ||
397 | |||
398 | /* ******************** FMLP support ********************** */ | 392 | /* ******************** FMLP support ********************** */ |
399 | 393 | ||
400 | /* struct for semaphore with priority inheritance */ | 394 | /* struct for semaphore with priority inheritance */ |
@@ -593,10 +587,35 @@ static long pfp_allocate_lock(struct litmus_lock **lock, int type, | |||
593 | 587 | ||
594 | static long pfp_admit_task(struct task_struct* tsk) | 588 | static long pfp_admit_task(struct task_struct* tsk) |
595 | { | 589 | { |
596 | return task_cpu(tsk) == tsk->rt_param.task_params.cpu | 590 | if (task_cpu(tsk) == tsk->rt_param.task_params.cpu && |
597 | && get_priority(tsk) > 0 ? 0 : -EINVAL; | 591 | #ifdef CONFIG_RELEASE_MASTER |
592 | /* don't allow tasks on release master CPU */ | ||
593 | task_cpu(tsk) != remote_dom(task_cpu(tsk))->release_master && | ||
594 | #endif | ||
595 | get_priority(tsk) > 0) | ||
596 | return 0; | ||
597 | else | ||
598 | return -EINVAL; | ||
598 | } | 599 | } |
599 | 600 | ||
601 | static long pfp_activate_plugin(void) | ||
602 | { | ||
603 | #ifdef CONFIG_RELEASE_MASTER | ||
604 | int cpu; | ||
605 | |||
606 | for_each_online_cpu(cpu) { | ||
607 | remote_dom(cpu)->release_master = atomic_read(&release_master_cpu); | ||
608 | } | ||
609 | #endif | ||
610 | |||
611 | #ifdef CONFIG_LITMUS_LOCKING | ||
612 | get_srp_prio = pfp_get_srp_prio; | ||
613 | #endif | ||
614 | |||
615 | return 0; | ||
616 | } | ||
617 | |||
618 | |||
600 | /* Plugin object */ | 619 | /* Plugin object */ |
601 | static struct sched_plugin pfp_plugin __cacheline_aligned_in_smp = { | 620 | static struct sched_plugin pfp_plugin __cacheline_aligned_in_smp = { |
602 | .plugin_name = "P-FP", | 621 | .plugin_name = "P-FP", |
@@ -608,9 +627,9 @@ static struct sched_plugin pfp_plugin __cacheline_aligned_in_smp = { | |||
608 | .task_wake_up = pfp_task_wake_up, | 627 | .task_wake_up = pfp_task_wake_up, |
609 | .task_block = pfp_task_block, | 628 | .task_block = pfp_task_block, |
610 | .admit_task = pfp_admit_task, | 629 | .admit_task = pfp_admit_task, |
630 | .activate_plugin = pfp_activate_plugin, | ||
611 | #ifdef CONFIG_LITMUS_LOCKING | 631 | #ifdef CONFIG_LITMUS_LOCKING |
612 | .allocate_lock = pfp_allocate_lock, | 632 | .allocate_lock = pfp_allocate_lock, |
613 | .activate_plugin = pfp_activate_plugin, | ||
614 | #endif | 633 | #endif |
615 | }; | 634 | }; |
616 | 635 | ||