diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2011-06-02 16:06:05 -0400 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2011-06-02 16:06:05 -0400 |
commit | 3d5537c160c1484e8d562b9828baf679cc53f67a (patch) | |
tree | b595364f1b0f94ac2426c8315bc5967debc7bbb0 /kernel/sched.c | |
parent | 7d754596756240fa918b94cd0c3011c77a638987 (diff) |
Full patch for klitirqd with Nvidia GPU support.
Diffstat (limited to 'kernel/sched.c')
-rw-r--r-- | kernel/sched.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index c5d775079027..3162605ffc91 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -82,6 +82,10 @@ | |||
82 | #include <litmus/sched_trace.h> | 82 | #include <litmus/sched_trace.h> |
83 | #include <litmus/trace.h> | 83 | #include <litmus/trace.h> |
84 | 84 | ||
85 | #ifdef CONFIG_LITMUS_SOFTIRQD | ||
86 | #include <litmus/litmus_softirq.h> | ||
87 | #endif | ||
88 | |||
85 | static void litmus_tick(struct rq*, struct task_struct*); | 89 | static void litmus_tick(struct rq*, struct task_struct*); |
86 | 90 | ||
87 | #define CREATE_TRACE_POINTS | 91 | #define CREATE_TRACE_POINTS |
@@ -3789,6 +3793,7 @@ pick_next_task(struct rq *rq) | |||
3789 | } | 3793 | } |
3790 | } | 3794 | } |
3791 | 3795 | ||
3796 | |||
3792 | /* | 3797 | /* |
3793 | * schedule() is the main scheduler function. | 3798 | * schedule() is the main scheduler function. |
3794 | */ | 3799 | */ |
@@ -3807,6 +3812,10 @@ need_resched: | |||
3807 | rcu_note_context_switch(cpu); | 3812 | rcu_note_context_switch(cpu); |
3808 | prev = rq->curr; | 3813 | prev = rq->curr; |
3809 | 3814 | ||
3815 | #ifdef CONFIG_LITMUS_SOFTIRQD | ||
3816 | release_klitirqd_lock(prev); | ||
3817 | #endif | ||
3818 | |||
3810 | release_kernel_lock(prev); | 3819 | release_kernel_lock(prev); |
3811 | need_resched_nonpreemptible: | 3820 | need_resched_nonpreemptible: |
3812 | TS_SCHED_START; | 3821 | TS_SCHED_START; |
@@ -3882,15 +3891,20 @@ need_resched_nonpreemptible: | |||
3882 | 3891 | ||
3883 | if (sched_state_validate_switch() || unlikely(reacquire_kernel_lock(prev))) | 3892 | if (sched_state_validate_switch() || unlikely(reacquire_kernel_lock(prev))) |
3884 | goto need_resched_nonpreemptible; | 3893 | goto need_resched_nonpreemptible; |
3885 | 3894 | ||
3886 | preempt_enable_no_resched(); | 3895 | preempt_enable_no_resched(); |
3896 | |||
3887 | if (need_resched()) | 3897 | if (need_resched()) |
3888 | goto need_resched; | 3898 | goto need_resched; |
3889 | 3899 | ||
3900 | reacquire_klitirqd_lock(prev); | ||
3901 | |||
3890 | srp_ceiling_block(); | 3902 | srp_ceiling_block(); |
3891 | } | 3903 | } |
3892 | EXPORT_SYMBOL(schedule); | 3904 | EXPORT_SYMBOL(schedule); |
3893 | 3905 | ||
3906 | |||
3907 | |||
3894 | #ifdef CONFIG_MUTEX_SPIN_ON_OWNER | 3908 | #ifdef CONFIG_MUTEX_SPIN_ON_OWNER |
3895 | /* | 3909 | /* |
3896 | * Look out! "owner" is an entirely speculative pointer | 3910 | * Look out! "owner" is an entirely speculative pointer |
@@ -4051,6 +4065,7 @@ static void __wake_up_common(wait_queue_head_t *q, unsigned int mode, | |||
4051 | } | 4065 | } |
4052 | } | 4066 | } |
4053 | 4067 | ||
4068 | |||
4054 | /** | 4069 | /** |
4055 | * __wake_up - wake up threads blocked on a waitqueue. | 4070 | * __wake_up - wake up threads blocked on a waitqueue. |
4056 | * @q: the waitqueue | 4071 | * @q: the waitqueue |
@@ -4236,6 +4251,12 @@ void __sched wait_for_completion(struct completion *x) | |||
4236 | } | 4251 | } |
4237 | EXPORT_SYMBOL(wait_for_completion); | 4252 | EXPORT_SYMBOL(wait_for_completion); |
4238 | 4253 | ||
4254 | void __sched __wait_for_completion_locked(struct completion *x) | ||
4255 | { | ||
4256 | do_wait_for_common(x, MAX_SCHEDULE_TIMEOUT, TASK_UNINTERRUPTIBLE); | ||
4257 | } | ||
4258 | EXPORT_SYMBOL(__wait_for_completion_locked); | ||
4259 | |||
4239 | /** | 4260 | /** |
4240 | * wait_for_completion_timeout: - waits for completion of a task (w/timeout) | 4261 | * wait_for_completion_timeout: - waits for completion of a task (w/timeout) |
4241 | * @x: holds the state of this particular completion | 4262 | * @x: holds the state of this particular completion |