aboutsummaryrefslogtreecommitdiffstats
path: root/litmus/locking.c
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-04-16 20:09:15 -0400
committerGlenn Elliott <gelliott@cs.unc.edu>2012-04-16 20:09:15 -0400
commit8675824ed85d6e83a24e77dabaf3a5c02c91ef6f (patch)
tree29e19fb32cacb062abca434fc921636d600ce77b /litmus/locking.c
parent0b865246946a97dc03a81ccf55bf84acce923c4b (diff)
Implement GPU-affinity-aware kfmlp (untested)
Diffstat (limited to 'litmus/locking.c')
-rw-r--r--litmus/locking.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/litmus/locking.c b/litmus/locking.c
index 6d28efe97c91..ef13062913ce 100644
--- a/litmus/locking.c
+++ b/litmus/locking.c
@@ -10,6 +10,10 @@
10#include <linux/uaccess.h> 10#include <linux/uaccess.h>
11#endif 11#endif
12 12
13#if defined(CONFIG_LITMUS_AFFINITY_LOCKING) && defined(CONFIG_LITMUS_NVIDIA)
14#include <litmus/gpu_affinity.h>
15#endif
16
13static int create_generic_lock(void** obj_ref, obj_type_t type, void* __user arg); 17static int create_generic_lock(void** obj_ref, obj_type_t type, void* __user arg);
14static int open_generic_lock(struct od_table_entry* entry, void* __user arg); 18static int open_generic_lock(struct od_table_entry* entry, void* __user arg);
15static int close_generic_lock(struct od_table_entry* entry); 19static int close_generic_lock(struct od_table_entry* entry);
@@ -50,6 +54,7 @@ static int create_generic_lock(void** obj_ref, obj_type_t type, void* __user ar
50 INIT_BINHEAP_NODE(&lock->nest.hp_binheap_node); 54 INIT_BINHEAP_NODE(&lock->nest.hp_binheap_node);
51 WARN_ON(!(lock->nest.hp_waiter_ptr)); 55 WARN_ON(!(lock->nest.hp_waiter_ptr));
52#endif 56#endif
57 lock->type = type;
53 lock->ident = atomic_inc_return(&lock_id_gen); 58 lock->ident = atomic_inc_return(&lock_id_gen);
54 *obj_ref = lock; 59 *obj_ref = lock;
55 } 60 }
@@ -292,6 +297,14 @@ static long do_litmus_dgl_lock(dgl_wait_state_t *dgl_wait)
292 297
293 TRACE_CUR("As many as %d locks in DGL are pending. Suspending.\n", 298 TRACE_CUR("As many as %d locks in DGL are pending. Suspending.\n",
294 dgl_wait->nr_remaining); 299 dgl_wait->nr_remaining);
300
301#if defined(CONFIG_LITMUS_AFFINITY_LOCKING) && defined(CONFIG_LITMUS_NVIDIA)
302 // KLUDGE: don't count this suspension as time in the critical gpu
303 // critical section
304 if(tsk_rt(dgl_wait->task)->held_gpus) {
305 tsk_rt(dgl_wait->task)->suspend_gpu_tracker_on_block = 1;
306 }
307#endif
295 308
296 // note reverse order. see comments in select_next_lock for reason. 309 // note reverse order. see comments in select_next_lock for reason.
297 for(i = dgl_wait->size - 1; i >= 0; --i) { 310 for(i = dgl_wait->size - 1; i >= 0; --i) {