aboutsummaryrefslogtreecommitdiffstats
path: root/litmus/nvidia_info.c
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-04-18 16:24:56 -0400
committerGlenn Elliott <gelliott@cs.unc.edu>2012-04-18 16:24:56 -0400
commit6ab36ca992441f7353840c70fc91d99a500a940e (patch)
treef7b89f379a04a681a80eee32f86a2405b162616f /litmus/nvidia_info.c
parent440aa2083245b81583980e3f4177f3b4cc805556 (diff)
Fixed and tested aff-aware KFMLP. (finally!)
Diffstat (limited to 'litmus/nvidia_info.c')
-rw-r--r--litmus/nvidia_info.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/litmus/nvidia_info.c b/litmus/nvidia_info.c
index 80900035881c..287e4a0662d9 100644
--- a/litmus/nvidia_info.c
+++ b/litmus/nvidia_info.c
@@ -418,16 +418,15 @@ void pai_check_priority_decrease(struct task_struct *t, int reg_device_id)
418} 418}
419#endif 419#endif
420 420
421static int __reg_nv_device(int reg_device_id) 421static int __reg_nv_device(int reg_device_id, struct task_struct *t)
422{ 422{
423 int ret = 0; 423 int ret = 0;
424 int i; 424 int i;
425 struct task_struct *t = current;
426 struct task_struct *old_max = NULL; 425 struct task_struct *old_max = NULL;
427 unsigned long flags; 426 unsigned long flags;
428 nv_device_registry_t *reg = &NV_DEVICE_REG[reg_device_id]; 427 nv_device_registry_t *reg = &NV_DEVICE_REG[reg_device_id];
429 428
430 if(__test_bit(reg_device_id, &tsk_rt(t)->held_gpus)) { 429 if(test_bit(reg_device_id, &tsk_rt(t)->held_gpus)) {
431 // TODO: check if taks is already registered. 430 // TODO: check if taks is already registered.
432 return ret; // assume already registered. 431 return ret; // assume already registered.
433 } 432 }
@@ -471,11 +470,10 @@ static int __reg_nv_device(int reg_device_id)
471 return(ret); 470 return(ret);
472} 471}
473 472
474static int __clear_reg_nv_device(int de_reg_device_id) 473static int __clear_reg_nv_device(int de_reg_device_id, struct task_struct *t)
475{ 474{
476 int ret = 0; 475 int ret = 0;
477 int i; 476 int i;
478 struct task_struct *t = current;
479 unsigned long flags; 477 unsigned long flags;
480 nv_device_registry_t *reg = &NV_DEVICE_REG[de_reg_device_id]; 478 nv_device_registry_t *reg = &NV_DEVICE_REG[de_reg_device_id];
481 479
@@ -483,7 +481,7 @@ static int __clear_reg_nv_device(int de_reg_device_id)
483 struct task_struct* klitirqd_th = get_klitirqd(de_reg_device_id); 481 struct task_struct* klitirqd_th = get_klitirqd(de_reg_device_id);
484#endif 482#endif
485 483
486 WARN_ON(!__test_bit(de_reg_device_id, &tsk_rt(t)->held_gpus)); 484 WARN_ON(!test_bit(de_reg_device_id, &tsk_rt(t)->held_gpus));
487 485
488 raw_spin_lock_irqsave(&reg->lock, flags); 486 raw_spin_lock_irqsave(&reg->lock, flags);
489 487
@@ -518,16 +516,16 @@ static int __clear_reg_nv_device(int de_reg_device_id)
518} 516}
519 517
520 518
521int reg_nv_device(int reg_device_id, int reg_action) 519int reg_nv_device(int reg_device_id, int reg_action, struct task_struct *t)
522{ 520{
523 int ret; 521 int ret;
524 522
525 if((reg_device_id < NV_DEVICE_NUM) && (reg_device_id >= 0)) 523 if((reg_device_id < NV_DEVICE_NUM) && (reg_device_id >= 0))
526 { 524 {
527 if(reg_action) 525 if(reg_action)
528 ret = __reg_nv_device(reg_device_id); 526 ret = __reg_nv_device(reg_device_id, t);
529 else 527 else
530 ret = __clear_reg_nv_device(reg_device_id); 528 ret = __clear_reg_nv_device(reg_device_id, t);
531 } 529 }
532 else 530 else
533 { 531 {