diff options
Diffstat (limited to 'include/litmus')
-rw-r--r-- | include/litmus/fdso.h | 9 | ||||
-rw-r--r-- | include/litmus/ikglp_lock.h | 61 | ||||
-rw-r--r-- | include/litmus/kfmlp_lock.h | 10 | ||||
-rw-r--r-- | include/litmus/nvidia_info.h | 1 | ||||
-rw-r--r-- | include/litmus/rt_param.h | 3 |
5 files changed, 76 insertions, 8 deletions
diff --git a/include/litmus/fdso.h b/include/litmus/fdso.h index b92c1a3f004f..552a1e731672 100644 --- a/include/litmus/fdso.h +++ b/include/litmus/fdso.h | |||
@@ -24,11 +24,12 @@ typedef enum { | |||
24 | IKGLP_SEM = 3, | 24 | IKGLP_SEM = 3, |
25 | KFMLP_SEM = 4, | 25 | KFMLP_SEM = 4, |
26 | 26 | ||
27 | IKGLP_GPU_AFF_OBS = 5, | 27 | IKGLP_SIMPLE_GPU_AFF_OBS = 5, |
28 | KFMLP_SIMPLE_GPU_AFF_OBS = 6, | 28 | IKGLP_GPU_AFF_OBS = 6, |
29 | KFMLP_GPU_AFF_OBS = 7, | 29 | KFMLP_SIMPLE_GPU_AFF_OBS = 7, |
30 | KFMLP_GPU_AFF_OBS = 8, | ||
30 | 31 | ||
31 | MAX_OBJ_TYPE = 7 | 32 | MAX_OBJ_TYPE = 8 |
32 | } obj_type_t; | 33 | } obj_type_t; |
33 | 34 | ||
34 | struct inode_obj_id { | 35 | struct inode_obj_id { |
diff --git a/include/litmus/ikglp_lock.h b/include/litmus/ikglp_lock.h index c0cc04db1bc6..2a75a1719815 100644 --- a/include/litmus/ikglp_lock.h +++ b/include/litmus/ikglp_lock.h | |||
@@ -5,6 +5,12 @@ | |||
5 | #include <litmus/binheap.h> | 5 | #include <litmus/binheap.h> |
6 | #include <litmus/locking.h> | 6 | #include <litmus/locking.h> |
7 | 7 | ||
8 | #ifdef CONFIG_LITMUS_AFFINITY_LOCKING | ||
9 | #include <litmus/kexclu_affinity.h> | ||
10 | |||
11 | struct ikglp_affinity; | ||
12 | #endif | ||
13 | |||
8 | typedef struct ikglp_heap_node | 14 | typedef struct ikglp_heap_node |
9 | { | 15 | { |
10 | struct task_struct *task; | 16 | struct task_struct *task; |
@@ -81,6 +87,10 @@ struct ikglp_semaphore | |||
81 | struct fifo_queue *fifo_queues; // array nr_replicas in length | 87 | struct fifo_queue *fifo_queues; // array nr_replicas in length |
82 | struct binheap_handle priority_queue; // max-heap, base prio | 88 | struct binheap_handle priority_queue; // max-heap, base prio |
83 | struct binheap_handle donors; // max-heap, base prio | 89 | struct binheap_handle donors; // max-heap, base prio |
90 | |||
91 | #ifdef CONFIG_LITMUS_AFFINITY_LOCKING | ||
92 | struct ikglp_affinity *aff_obs; | ||
93 | #endif | ||
84 | }; | 94 | }; |
85 | 95 | ||
86 | static inline struct ikglp_semaphore* ikglp_from_lock(struct litmus_lock* lock) | 96 | static inline struct ikglp_semaphore* ikglp_from_lock(struct litmus_lock* lock) |
@@ -94,4 +104,55 @@ int ikglp_close(struct litmus_lock* l); | |||
94 | void ikglp_free(struct litmus_lock* l); | 104 | void ikglp_free(struct litmus_lock* l); |
95 | struct litmus_lock* ikglp_new(int m, struct litmus_lock_ops*, void* __user arg); | 105 | struct litmus_lock* ikglp_new(int m, struct litmus_lock_ops*, void* __user arg); |
96 | 106 | ||
107 | |||
108 | |||
109 | #if defined(CONFIG_LITMUS_AFFINITY_LOCKING) && defined(CONFIG_LITMUS_NVIDIA) | ||
110 | |||
111 | struct ikglp_queue_info | ||
112 | { | ||
113 | struct fifo_queue* q; | ||
114 | lt_t estimated_len; | ||
115 | int *nr_cur_users; | ||
116 | }; | ||
117 | |||
118 | struct ikglp_affinity_ops | ||
119 | { | ||
120 | struct fifo_queue* (*advise_enqueue)(struct ikglp_affinity* aff, struct task_struct* t); // select FIFO | ||
121 | struct task_struct* (*advise_steal)(struct ikglp_affinity* aff, wait_queue_t** to_steal, struct fifo_queue** to_steal_from); // select steal from FIFO | ||
122 | struct task_struct* (*advise_donee_selection)(struct ikglp_affinity* aff, wait_queue_t** donee, struct fifo_queue** donee_queue); // select a donee | ||
123 | struct task_struct* (*advise_doner_to_fq)(struct ikglp_affinity* aff, ikglp_wait_state_t** donor); // select a donor to move to PQ | ||
124 | |||
125 | void (*notify_enqueue)(struct ikglp_affinity* aff, struct fifo_queue* fq, struct task_struct* t); // fifo enqueue | ||
126 | void (*notify_dequeue)(struct ikglp_affinity* aff, struct fifo_queue* fq, struct task_struct* t); // fifo dequeue | ||
127 | void (*notify_acquired)(struct ikglp_affinity* aff, struct fifo_queue* fq, struct task_struct* t); // replica acquired | ||
128 | void (*notify_freed)(struct ikglp_affinity* aff, struct fifo_queue* fq, struct task_struct* t); // replica freed | ||
129 | int (*replica_to_resource)(struct ikglp_affinity* aff, struct fifo_queue* fq); // convert a replica # to a GPU (includes offsets and simult user folding) | ||
130 | }; | ||
131 | |||
132 | struct ikglp_affinity | ||
133 | { | ||
134 | struct affinity_observer obs; | ||
135 | struct ikglp_affinity_ops *ops; | ||
136 | struct fifo_queue *q_info; | ||
137 | int *nr_cur_users_on_rsrc; | ||
138 | int offset; | ||
139 | int nr_simult; | ||
140 | int nr_rsrc; | ||
141 | }; | ||
142 | |||
143 | static inline struct ikglp_affinity* ikglp_aff_obs_from_aff_obs(struct affinity_observer* aff_obs) | ||
144 | { | ||
145 | return container_of(aff_obs, struct ikglp_affinity, obs); | ||
146 | } | ||
147 | |||
148 | int ikglp_aff_obs_close(struct affinity_observer*); | ||
149 | void ikglp_aff_obs_free(struct affinity_observer*); | ||
150 | struct affinity_observer* ikglp_gpu_aff_obs_new(struct affinity_observer_ops*, | ||
151 | void* __user arg); | ||
152 | struct affinity_observer* ikglp_simple_gpu_aff_obs_new(struct affinity_observer_ops*, | ||
153 | void* __user arg); | ||
154 | #endif | ||
155 | |||
156 | |||
157 | |||
97 | #endif | 158 | #endif |
diff --git a/include/litmus/kfmlp_lock.h b/include/litmus/kfmlp_lock.h index 614cccad5307..6d7e24b2a3ad 100644 --- a/include/litmus/kfmlp_lock.h +++ b/include/litmus/kfmlp_lock.h | |||
@@ -6,6 +6,8 @@ | |||
6 | 6 | ||
7 | #ifdef CONFIG_LITMUS_AFFINITY_LOCKING | 7 | #ifdef CONFIG_LITMUS_AFFINITY_LOCKING |
8 | #include <litmus/kexclu_affinity.h> | 8 | #include <litmus/kexclu_affinity.h> |
9 | |||
10 | struct kfmlp_affinity; | ||
9 | #endif | 11 | #endif |
10 | 12 | ||
11 | /* struct for semaphore with priority inheritance */ | 13 | /* struct for semaphore with priority inheritance */ |
@@ -50,10 +52,9 @@ struct kfmlp_queue_info | |||
50 | { | 52 | { |
51 | struct kfmlp_queue* q; | 53 | struct kfmlp_queue* q; |
52 | lt_t estimated_len; | 54 | lt_t estimated_len; |
55 | int *nr_cur_users; | ||
53 | }; | 56 | }; |
54 | 57 | ||
55 | struct kfmlp_affinity; | ||
56 | |||
57 | struct kfmlp_affinity_ops | 58 | struct kfmlp_affinity_ops |
58 | { | 59 | { |
59 | struct kfmlp_queue* (*advise_enqueue)(struct kfmlp_affinity* aff, struct task_struct* t); | 60 | struct kfmlp_queue* (*advise_enqueue)(struct kfmlp_affinity* aff, struct task_struct* t); |
@@ -62,6 +63,7 @@ struct kfmlp_affinity_ops | |||
62 | void (*notify_dequeue)(struct kfmlp_affinity* aff, struct kfmlp_queue* fq, struct task_struct* t); | 63 | void (*notify_dequeue)(struct kfmlp_affinity* aff, struct kfmlp_queue* fq, struct task_struct* t); |
63 | void (*notify_acquired)(struct kfmlp_affinity* aff, struct kfmlp_queue* fq, struct task_struct* t); | 64 | void (*notify_acquired)(struct kfmlp_affinity* aff, struct kfmlp_queue* fq, struct task_struct* t); |
64 | void (*notify_freed)(struct kfmlp_affinity* aff, struct kfmlp_queue* fq, struct task_struct* t); | 65 | void (*notify_freed)(struct kfmlp_affinity* aff, struct kfmlp_queue* fq, struct task_struct* t); |
66 | int (*replica_to_resource)(struct kfmlp_affinity* aff, struct kfmlp_queue* fq); | ||
65 | }; | 67 | }; |
66 | 68 | ||
67 | struct kfmlp_affinity | 69 | struct kfmlp_affinity |
@@ -69,8 +71,10 @@ struct kfmlp_affinity | |||
69 | struct affinity_observer obs; | 71 | struct affinity_observer obs; |
70 | struct kfmlp_affinity_ops *ops; | 72 | struct kfmlp_affinity_ops *ops; |
71 | struct kfmlp_queue_info *q_info; | 73 | struct kfmlp_queue_info *q_info; |
72 | struct kfmlp_queue_info *shortest_queue; | 74 | int *nr_cur_users_on_rsrc; |
73 | int offset; | 75 | int offset; |
76 | int nr_simult; | ||
77 | int nr_rsrc; | ||
74 | }; | 78 | }; |
75 | 79 | ||
76 | static inline struct kfmlp_affinity* kfmlp_aff_obs_from_aff_obs(struct affinity_observer* aff_obs) | 80 | static inline struct kfmlp_affinity* kfmlp_aff_obs_from_aff_obs(struct affinity_observer* aff_obs) |
diff --git a/include/litmus/nvidia_info.h b/include/litmus/nvidia_info.h index 856c575374d3..580728051d4e 100644 --- a/include/litmus/nvidia_info.h +++ b/include/litmus/nvidia_info.h | |||
@@ -9,6 +9,7 @@ | |||
9 | 9 | ||
10 | //#define NV_DEVICE_NUM NR_LITMUS_SOFTIRQD | 10 | //#define NV_DEVICE_NUM NR_LITMUS_SOFTIRQD |
11 | #define NV_DEVICE_NUM CONFIG_NV_DEVICE_NUM | 11 | #define NV_DEVICE_NUM CONFIG_NV_DEVICE_NUM |
12 | #define NV_MAX_SIMULT_USERS CONFIG_NV_MAX_SIMULT_USERS | ||
12 | 13 | ||
13 | int init_nvidia_info(void); | 14 | int init_nvidia_info(void); |
14 | 15 | ||
diff --git a/include/litmus/rt_param.h b/include/litmus/rt_param.h index 11f081527545..e832ffcba17c 100644 --- a/include/litmus/rt_param.h +++ b/include/litmus/rt_param.h | |||
@@ -59,10 +59,11 @@ struct affinity_observer_args | |||
59 | int lock_od; | 59 | int lock_od; |
60 | }; | 60 | }; |
61 | 61 | ||
62 | struct kfmlp_gpu_affinity_observer_args | 62 | struct gpu_affinity_observer_args |
63 | { | 63 | { |
64 | struct affinity_observer_args obs; | 64 | struct affinity_observer_args obs; |
65 | int replica_to_gpu_offset; | 65 | int replica_to_gpu_offset; |
66 | int nr_simult_users; | ||
66 | }; | 67 | }; |
67 | 68 | ||
68 | /* The definition of the data that is shared between the kernel and real-time | 69 | /* The definition of the data that is shared between the kernel and real-time |