diff options
author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2011-02-10 20:05:15 -0500 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2011-08-27 12:00:27 -0400 |
commit | 17e34f413750b26aa493f1f8307f111bc5d487de (patch) | |
tree | c0acad0b8515024d4865e31d500181af65dbac03 /litmus/sched_psn_edf.c | |
parent | f5bee93f09b907a302e908c3cc3381ffbe826e2b (diff) |
PSN-EDF: add release master support
We can give up a processor under partitioning, too.
Diffstat (limited to 'litmus/sched_psn_edf.c')
-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 71c02409efa2..eb444ecf1288 100644 --- a/litmus/sched_psn_edf.c +++ b/litmus/sched_psn_edf.c | |||
@@ -383,12 +383,6 @@ static unsigned int psnedf_get_srp_prio(struct task_struct* t) | |||
383 | return get_rt_period(t); | 383 | return get_rt_period(t); |
384 | } | 384 | } |
385 | 385 | ||
386 | static long psnedf_activate_plugin(void) | ||
387 | { | ||
388 | get_srp_prio = psnedf_get_srp_prio; | ||
389 | return 0; | ||
390 | } | ||
391 | |||
392 | /* ******************** FMLP support ********************** */ | 386 | /* ******************** FMLP support ********************** */ |
393 | 387 | ||
394 | /* struct for semaphore with priority inheritance */ | 388 | /* struct for semaphore with priority inheritance */ |
@@ -577,9 +571,35 @@ static long psnedf_allocate_lock(struct litmus_lock **lock, int type, | |||
577 | 571 | ||
578 | #endif | 572 | #endif |
579 | 573 | ||
574 | |||
575 | static long psnedf_activate_plugin(void) | ||
576 | { | ||
577 | #ifdef CONFIG_RELEASE_MASTER | ||
578 | int cpu; | ||
579 | |||
580 | for_each_online_cpu(cpu) { | ||
581 | remote_edf(cpu)->release_master = atomic_read(&release_master_cpu); | ||
582 | } | ||
583 | #endif | ||
584 | |||
585 | #ifdef CONFIG_LITMUS_LOCKING | ||
586 | get_srp_prio = psnedf_get_srp_prio; | ||
587 | #endif | ||
588 | |||
589 | return 0; | ||
590 | } | ||
591 | |||
580 | static long psnedf_admit_task(struct task_struct* tsk) | 592 | static long psnedf_admit_task(struct task_struct* tsk) |
581 | { | 593 | { |
582 | return task_cpu(tsk) == tsk->rt_param.task_params.cpu ? 0 : -EINVAL; | 594 | if (task_cpu(tsk) == tsk->rt_param.task_params.cpu |
595 | #ifdef CONFIG_RELEASE_MASTER | ||
596 | /* don't allow tasks on release master CPU */ | ||
597 | && task_cpu(tsk) != remote_edf(task_cpu(tsk))->release_master | ||
598 | #endif | ||
599 | ) | ||
600 | return 0; | ||
601 | else | ||
602 | return -EINVAL; | ||
583 | } | 603 | } |
584 | 604 | ||
585 | /* Plugin object */ | 605 | /* Plugin object */ |
@@ -593,9 +613,9 @@ static struct sched_plugin psn_edf_plugin __cacheline_aligned_in_smp = { | |||
593 | .task_wake_up = psnedf_task_wake_up, | 613 | .task_wake_up = psnedf_task_wake_up, |
594 | .task_block = psnedf_task_block, | 614 | .task_block = psnedf_task_block, |
595 | .admit_task = psnedf_admit_task, | 615 | .admit_task = psnedf_admit_task, |
616 | .activate_plugin = psnedf_activate_plugin, | ||
596 | #ifdef CONFIG_LITMUS_LOCKING | 617 | #ifdef CONFIG_LITMUS_LOCKING |
597 | .allocate_lock = psnedf_allocate_lock, | 618 | .allocate_lock = psnedf_allocate_lock, |
598 | .activate_plugin = psnedf_activate_plugin, | ||
599 | #endif | 619 | #endif |
600 | }; | 620 | }; |
601 | 621 | ||