aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2013-01-18 15:20:55 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2013-01-18 15:20:55 -0500
commita4bd234fef9230dffa4fa47ff4d42ddbe9f3d7db (patch)
tree5bde356b4f08da39c4b0b2bad7e51b8b8ca3f72b
parent7e960ea104cbd6669b5bece1f32788fb3a1f896f (diff)
minor fixes
-rw-r--r--kernel/softirq.c31
-rw-r--r--litmus/nvidia_info.c3
2 files changed, 25 insertions, 9 deletions
diff --git a/kernel/softirq.c b/kernel/softirq.c
index 4b55daafbbea..3ad0e7d9e782 100644
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -411,23 +411,32 @@ static DEFINE_PER_CPU(struct tasklet_head, tasklet_vec);
411static DEFINE_PER_CPU(struct tasklet_head, tasklet_hi_vec); 411static DEFINE_PER_CPU(struct tasklet_head, tasklet_hi_vec);
412 412
413#ifdef CONFIG_LITMUS_NVIDIA_NONSPLIT_INTERRUPTS 413#ifdef CONFIG_LITMUS_NVIDIA_NONSPLIT_INTERRUPTS
414static int __do_nv_now(struct tasklet_struct* tasklet) 414static int __do_nv_now(struct tasklet_struct* t)
415{ 415{
416 int success = 1; 416 int success = 1;
417 417
418 if(tasklet_trylock(tasklet)) { 418/*
419 if (!atomic_read(&tasklet->count)) { 419#ifdef CONFIG_SCHED_DEBUG_TRACE
420 if (!test_and_clear_bit(TASKLET_STATE_SCHED, &tasklet->state)) { 420 u32 nvidia_device = get_tasklet_nv_device_num(t);
421 TRACE("Handling NVIDIA tasklet for device %u at %llu\n",
422 nvidia_device, litmus_clock());
423#endif
424*/
425 TRACE("Handling NVIDIA tasklet.\n");
426
427 if(tasklet_trylock(t)) {
428 if (!atomic_read(&t->count)) {
429 if (!test_and_clear_bit(TASKLET_STATE_SCHED, &t->state)) {
421 BUG(); 430 BUG();
422 } 431 }
423 tasklet->func(tasklet->data); 432 t->func(t->data);
424 tasklet_unlock(tasklet); 433 tasklet_unlock(t);
425 } 434 }
426 else { 435 else {
427 success = 0; 436 success = 0;
428 } 437 }
429 438
430 tasklet_unlock(tasklet); 439 tasklet_unlock(t);
431 } 440 }
432 else { 441 else {
433 success = 0; 442 success = 0;
@@ -451,8 +460,8 @@ static int __klmirqd_nv_tasklet_schedule(struct tasklet_struct *t,
451 460
452 BUG_ON(!klmirqd_func); 461 BUG_ON(!klmirqd_func);
453 462
454 TRACE("%s: Handling NVIDIA tasklet for device %u (klmirqd: %s/%d) at %llu\n", 463 TRACE("Handling NVIDIA tasklet for device %u (klmirqd: %s/%d) at %llu\n",
455 __FUNCTION__, nvidia_device, 464 nvidia_device,
456 (klmirqd_th) ? klmirqd_th->comm : "nil", 465 (klmirqd_th) ? klmirqd_th->comm : "nil",
457 (klmirqd_th) ? klmirqd_th->pid : 0, 466 (klmirqd_th) ? klmirqd_th->pid : 0,
458 litmus_clock()); 467 litmus_clock());
@@ -476,6 +485,8 @@ void __tasklet_schedule(struct tasklet_struct *t)
476 /* do nvidia tasklets right away and return */ 485 /* do nvidia tasklets right away and return */
477 if(__do_nv_now(t)) 486 if(__do_nv_now(t))
478 return; 487 return;
488 else
489 goto default_linux_handling;
479#elif defined(CONFIG_LITMUS_SOFTIRQD) 490#elif defined(CONFIG_LITMUS_SOFTIRQD)
480 if(__klmirqd_nv_tasklet_schedule(t, _litmus_tasklet_schedule)) 491 if(__klmirqd_nv_tasklet_schedule(t, _litmus_tasklet_schedule))
481 return; 492 return;
@@ -516,6 +527,8 @@ void __tasklet_hi_schedule(struct tasklet_struct *t)
516 /* do nvidia tasklets right away and return */ 527 /* do nvidia tasklets right away and return */
517 if(__do_nv_now(t)) 528 if(__do_nv_now(t))
518 return; 529 return;
530 else
531 goto default_linux_handling;
519#elif defined(CONFIG_LITMUS_SOFTIRQD) 532#elif defined(CONFIG_LITMUS_SOFTIRQD)
520 if(__klmirqd_nv_tasklet_schedule(t, _litmus_tasklet_hi_schedule)) 533 if(__klmirqd_nv_tasklet_schedule(t, _litmus_tasklet_hi_schedule))
521 return; 534 return;
diff --git a/litmus/nvidia_info.c b/litmus/nvidia_info.c
index 73c933a87623..7160bb85ac9d 100644
--- a/litmus/nvidia_info.c
+++ b/litmus/nvidia_info.c
@@ -49,6 +49,9 @@ typedef struct
49 void *priv; /* private data */ 49 void *priv; /* private data */
50 void *os_state; /* os-specific device state */ 50 void *os_state; /* os-specific device state */
51 51
52#ifdef CONFIG_CUDA_4_0
53 int rmInitialized; /* TODO: appears in CUDA 3_2? */
54#endif
52 int flags; 55 int flags;
53 56
54 /* PCI config info */ 57 /* PCI config info */