aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/softirq.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/softirq.c')
-rw-r--r--kernel/softirq.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/kernel/softirq.c b/kernel/softirq.c
index 1c42e08fdfaa..5ce271675662 100644
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -412,12 +412,44 @@ struct tasklet_head
412static DEFINE_PER_CPU(struct tasklet_head, tasklet_vec); 412static DEFINE_PER_CPU(struct tasklet_head, tasklet_vec);
413static DEFINE_PER_CPU(struct tasklet_head, tasklet_hi_vec); 413static DEFINE_PER_CPU(struct tasklet_head, tasklet_hi_vec);
414 414
415#ifdef CONFIG_LITMUS_NVIDIA
416static int __do_nv_now(struct tasklet_struct* tasklet)
417{
418 int success = 1;
419
420 if(tasklet_trylock(tasklet)) {
421 if (!atomic_read(&tasklet->count)) {
422 if (!test_and_clear_bit(TASKLET_STATE_SCHED, &tasklet->state)) {
423 BUG();
424 }
425 tasklet->func(tasklet->data);
426 tasklet_unlock(tasklet);
427 }
428 else {
429 success = 0;
430 }
431
432 tasklet_unlock(tasklet);
433 }
434 else {
435 success = 0;
436 }
437
438 return success;
439}
440#endif
441
415 442
416void __tasklet_schedule(struct tasklet_struct *t) 443void __tasklet_schedule(struct tasklet_struct *t)
417{ 444{
418#ifdef CONFIG_LITMUS_NVIDIA 445#ifdef CONFIG_LITMUS_NVIDIA
419 if(is_nvidia_func(t->func)) 446 if(is_nvidia_func(t->func))
420 { 447 {
448#if 0
449 // do nvidia tasklets right away and return
450 if(__do_nv_now(t))
451 return;
452#else
421 u32 nvidia_device = get_tasklet_nv_device_num(t); 453 u32 nvidia_device = get_tasklet_nv_device_num(t);
422 // TRACE("%s: Handling NVIDIA tasklet for device\t%u\tat\t%llu\n", 454 // TRACE("%s: Handling NVIDIA tasklet for device\t%u\tat\t%llu\n",
423 // __FUNCTION__, nvidia_device,litmus_clock()); 455 // __FUNCTION__, nvidia_device,litmus_clock());
@@ -461,7 +493,9 @@ void __tasklet_schedule(struct tasklet_struct *t)
461 } 493 }
462 } 494 }
463 unlock_nv_registry(nvidia_device, &flags); 495 unlock_nv_registry(nvidia_device, &flags);
496#endif
464 } 497 }
498
465#endif 499#endif
466 500
467 ___tasklet_schedule(t); 501 ___tasklet_schedule(t);