aboutsummaryrefslogtreecommitdiffstats
path: root/litmus/sched_cedf.c
diff options
context:
space:
mode:
Diffstat (limited to 'litmus/sched_cedf.c')
-rw-r--r--litmus/sched_cedf.c42
1 files changed, 39 insertions, 3 deletions
diff --git a/litmus/sched_cedf.c b/litmus/sched_cedf.c
index 2246e9b8754e..61d682d9f415 100644
--- a/litmus/sched_cedf.c
+++ b/litmus/sched_cedf.c
@@ -52,6 +52,7 @@
52 52
53#ifdef CONFIG_LITMUS_NESTED_LOCKING 53#ifdef CONFIG_LITMUS_NESTED_LOCKING
54#include <litmus/fifo_lock.h> 54#include <litmus/fifo_lock.h>
55#include <litmus/prioq_lock.h>
55#include <litmus/ikglp_lock.h> 56#include <litmus/ikglp_lock.h>
56#endif 57#endif
57 58
@@ -852,6 +853,7 @@ static struct task_struct* cedf_schedule(struct task_struct * prev)
852 TRACE_TASK(prev, "will be preempted by %s/%d\n", 853 TRACE_TASK(prev, "will be preempted by %s/%d\n",
853 entry->linked->comm, entry->linked->pid); 854 entry->linked->comm, entry->linked->pid);
854 855
856#ifdef CONFIG_REALTIME_AUX_TASKS
855 if (tsk_rt(prev)->is_aux_task && 857 if (tsk_rt(prev)->is_aux_task &&
856 (prev->state == TASK_INTERRUPTIBLE) && 858 (prev->state == TASK_INTERRUPTIBLE) &&
857 !blocks) { 859 !blocks) {
@@ -860,6 +862,7 @@ static struct task_struct* cedf_schedule(struct task_struct * prev)
860 next = prev; /* allow prev to continue. */ 862 next = prev; /* allow prev to continue. */
861 goto out_set_state; 863 goto out_set_state;
862 } 864 }
865#endif
863 866
864 /* Send the signal that the budget has been exhausted */ 867 /* Send the signal that the budget has been exhausted */
865 if (signal_budget) 868 if (signal_budget)
@@ -931,7 +934,9 @@ static struct task_struct* cedf_schedule(struct task_struct * prev)
931 } 934 }
932 } 935 }
933 936
937#ifdef CONFIG_REALTIME_AUX_TASKS
934out_set_state: 938out_set_state:
939#endif
935 940
936 sched_state_task_picked(); 941 sched_state_task_picked();
937 raw_spin_unlock(&cluster->cluster_lock); 942 raw_spin_unlock(&cluster->cluster_lock);
@@ -1546,6 +1551,32 @@ static struct litmus_lock* cedf_new_fifo_mutex(void)
1546 return fifo_mutex_new(&cedf_fifo_mutex_lock_ops); 1551 return fifo_mutex_new(&cedf_fifo_mutex_lock_ops);
1547} 1552}
1548 1553
1554/* ******************** PRIOQ MUTEX ********************** */
1555
1556static struct litmus_lock_ops cedf_prioq_mutex_lock_ops = {
1557 .lock = prioq_mutex_lock,
1558 .unlock = prioq_mutex_unlock,
1559 .close = prioq_mutex_close,
1560 .deallocate = prioq_mutex_free,
1561
1562 .propagate_increase_inheritance = prioq_mutex_propagate_increase_inheritance,
1563 .propagate_decrease_inheritance = prioq_mutex_propagate_decrease_inheritance,
1564
1565#ifdef CONFIG_LITMUS_DGL_SUPPORT
1566 .dgl_lock = prioq_mutex_dgl_lock,
1567 .is_owner = prioq_mutex_is_owner,
1568 .enable_priority = prioq_mutex_enable_priority,
1569
1570 .dgl_can_quick_lock = prioq_mutex_dgl_can_quick_lock,
1571 .dgl_quick_lock = prioq_mutex_dgl_quick_lock,
1572#endif
1573};
1574
1575static struct litmus_lock* cedf_new_prioq_mutex(void)
1576{
1577 return prioq_mutex_new(&cedf_prioq_mutex_lock_ops);
1578}
1579
1549/* ******************** IKGLP ********************** */ 1580/* ******************** IKGLP ********************** */
1550 1581
1551static struct litmus_lock_ops cedf_ikglp_lock_ops = { 1582static struct litmus_lock_ops cedf_ikglp_lock_ops = {
@@ -1603,6 +1634,10 @@ static long cedf_allocate_lock(struct litmus_lock **lock, int type,
1603 *lock = cedf_new_fifo_mutex(); 1634 *lock = cedf_new_fifo_mutex();
1604 break; 1635 break;
1605 1636
1637 case PRIOQ_MUTEX:
1638 *lock = cedf_new_prioq_mutex();
1639 break;
1640
1606 case IKGLP_SEM: 1641 case IKGLP_SEM:
1607 *lock = cedf_new_ikglp(args); 1642 *lock = cedf_new_ikglp(args);
1608 break; 1643 break;
@@ -1629,13 +1664,13 @@ UNSUPPORTED_LOCK:
1629 1664
1630 1665
1631#ifdef CONFIG_LITMUS_AFFINITY_LOCKING 1666#ifdef CONFIG_LITMUS_AFFINITY_LOCKING
1632static struct affinity_observer_ops cedf_kfmlp_affinity_ops = { 1667static struct affinity_observer_ops cedf_kfmlp_affinity_ops __attribute__ ((unused)) = {
1633 .close = kfmlp_aff_obs_close, 1668 .close = kfmlp_aff_obs_close,
1634 .deallocate = kfmlp_aff_obs_free, 1669 .deallocate = kfmlp_aff_obs_free,
1635}; 1670};
1636 1671
1637#ifdef CONFIG_LITMUS_NESTED_LOCKING 1672#ifdef CONFIG_LITMUS_NESTED_LOCKING
1638static struct affinity_observer_ops cedf_ikglp_affinity_ops = { 1673static struct affinity_observer_ops cedf_ikglp_affinity_ops __attribute__ ((unused)) = {
1639 .close = ikglp_aff_obs_close, 1674 .close = ikglp_aff_obs_close,
1640 .deallocate = ikglp_aff_obs_free, 1675 .deallocate = ikglp_aff_obs_free,
1641}; 1676};
@@ -1648,7 +1683,7 @@ static long cedf_allocate_affinity_observer(struct affinity_observer **aff_obs,
1648 int err; 1683 int err;
1649 1684
1650 switch (type) { 1685 switch (type) {
1651 1686#ifdef CONFIG_LITMUS_NVIDIA
1652 case KFMLP_SIMPLE_GPU_AFF_OBS: 1687 case KFMLP_SIMPLE_GPU_AFF_OBS:
1653 *aff_obs = kfmlp_simple_gpu_aff_obs_new(&cedf_kfmlp_affinity_ops, args); 1688 *aff_obs = kfmlp_simple_gpu_aff_obs_new(&cedf_kfmlp_affinity_ops, args);
1654 break; 1689 break;
@@ -1666,6 +1701,7 @@ static long cedf_allocate_affinity_observer(struct affinity_observer **aff_obs,
1666 *aff_obs = ikglp_gpu_aff_obs_new(&cedf_ikglp_affinity_ops, args); 1701 *aff_obs = ikglp_gpu_aff_obs_new(&cedf_ikglp_affinity_ops, args);
1667 break; 1702 break;
1668#endif 1703#endif
1704#endif
1669 default: 1705 default:
1670 err = -ENXIO; 1706 err = -ENXIO;
1671 goto UNSUPPORTED_AFF_OBS; 1707 goto UNSUPPORTED_AFF_OBS;