diff options
Diffstat (limited to 'kernel/sched.c')
-rw-r--r-- | kernel/sched.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index baaca61bc3a3..f3d9a69a3777 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -83,6 +83,10 @@ | |||
83 | #include <litmus/sched_trace.h> | 83 | #include <litmus/sched_trace.h> |
84 | #include <litmus/trace.h> | 84 | #include <litmus/trace.h> |
85 | 85 | ||
86 | #ifdef CONFIG_LITMUS_SOFTIRQD | ||
87 | #include <litmus/litmus_softirq.h> | ||
88 | #endif | ||
89 | |||
86 | static void litmus_tick(struct rq*, struct task_struct*); | 90 | static void litmus_tick(struct rq*, struct task_struct*); |
87 | 91 | ||
88 | #define CREATE_TRACE_POINTS | 92 | #define CREATE_TRACE_POINTS |
@@ -4305,6 +4309,7 @@ pick_next_task(struct rq *rq) | |||
4305 | BUG(); /* the idle class will always have a runnable task */ | 4309 | BUG(); /* the idle class will always have a runnable task */ |
4306 | } | 4310 | } |
4307 | 4311 | ||
4312 | |||
4308 | /* | 4313 | /* |
4309 | * schedule() is the main scheduler function. | 4314 | * schedule() is the main scheduler function. |
4310 | */ | 4315 | */ |
@@ -4323,6 +4328,10 @@ need_resched: | |||
4323 | rcu_note_context_switch(cpu); | 4328 | rcu_note_context_switch(cpu); |
4324 | prev = rq->curr; | 4329 | prev = rq->curr; |
4325 | 4330 | ||
4331 | #ifdef CONFIG_LITMUS_SOFTIRQD | ||
4332 | release_klitirqd_lock(prev); | ||
4333 | #endif | ||
4334 | |||
4326 | /* LITMUS^RT: quickly re-evaluate the scheduling decision | 4335 | /* LITMUS^RT: quickly re-evaluate the scheduling decision |
4327 | * if the previous one is no longer valid after CTX. | 4336 | * if the previous one is no longer valid after CTX. |
4328 | */ | 4337 | */ |
@@ -4411,13 +4420,24 @@ litmus_need_resched_nonpreemptible: | |||
4411 | goto litmus_need_resched_nonpreemptible; | 4420 | goto litmus_need_resched_nonpreemptible; |
4412 | 4421 | ||
4413 | preempt_enable_no_resched(); | 4422 | preempt_enable_no_resched(); |
4423 | |||
4414 | if (need_resched()) | 4424 | if (need_resched()) |
4415 | goto need_resched; | 4425 | goto need_resched; |
4416 | 4426 | ||
4427 | #ifdef LITMUS_SOFTIRQD | ||
4428 | reacquire_klitirqd_lock(prev); | ||
4429 | #endif | ||
4430 | |||
4431 | #ifdef CONFIG_LITMUS_PAI_SOFTIRQD | ||
4432 | litmus->run_tasklets(prev); | ||
4433 | #endif | ||
4434 | |||
4417 | srp_ceiling_block(); | 4435 | srp_ceiling_block(); |
4418 | } | 4436 | } |
4419 | EXPORT_SYMBOL(schedule); | 4437 | EXPORT_SYMBOL(schedule); |
4420 | 4438 | ||
4439 | |||
4440 | |||
4421 | #ifdef CONFIG_MUTEX_SPIN_ON_OWNER | 4441 | #ifdef CONFIG_MUTEX_SPIN_ON_OWNER |
4422 | 4442 | ||
4423 | static inline bool owner_running(struct mutex *lock, struct task_struct *owner) | 4443 | static inline bool owner_running(struct mutex *lock, struct task_struct *owner) |
@@ -4561,6 +4581,7 @@ static void __wake_up_common(wait_queue_head_t *q, unsigned int mode, | |||
4561 | } | 4581 | } |
4562 | } | 4582 | } |
4563 | 4583 | ||
4584 | |||
4564 | /** | 4585 | /** |
4565 | * __wake_up - wake up threads blocked on a waitqueue. | 4586 | * __wake_up - wake up threads blocked on a waitqueue. |
4566 | * @q: the waitqueue | 4587 | * @q: the waitqueue |
@@ -4747,6 +4768,12 @@ void __sched wait_for_completion(struct completion *x) | |||
4747 | } | 4768 | } |
4748 | EXPORT_SYMBOL(wait_for_completion); | 4769 | EXPORT_SYMBOL(wait_for_completion); |
4749 | 4770 | ||
4771 | void __sched __wait_for_completion_locked(struct completion *x) | ||
4772 | { | ||
4773 | do_wait_for_common(x, MAX_SCHEDULE_TIMEOUT, TASK_UNINTERRUPTIBLE); | ||
4774 | } | ||
4775 | EXPORT_SYMBOL(__wait_for_completion_locked); | ||
4776 | |||
4750 | /** | 4777 | /** |
4751 | * wait_for_completion_timeout: - waits for completion of a task (w/timeout) | 4778 | * wait_for_completion_timeout: - waits for completion of a task (w/timeout) |
4752 | * @x: holds the state of this particular completion | 4779 | * @x: holds the state of this particular completion |