aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sched.c')
-rw-r--r--kernel/sched.c32
1 files changed, 22 insertions, 10 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index d9c0368eeb21..d48408142503 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -969,14 +969,6 @@ static struct rq *task_rq_lock(struct task_struct *p, unsigned long *flags)
969 } 969 }
970} 970}
971 971
972void task_rq_unlock_wait(struct task_struct *p)
973{
974 struct rq *rq = task_rq(p);
975
976 smp_mb(); /* spin-unlock-wait is not a full memory barrier */
977 raw_spin_unlock_wait(&rq->lock);
978}
979
980static void __task_rq_unlock(struct rq *rq) 972static void __task_rq_unlock(struct rq *rq)
981 __releases(rq->lock) 973 __releases(rq->lock)
982{ 974{
@@ -4062,6 +4054,23 @@ int __sched wait_for_completion_killable(struct completion *x)
4062EXPORT_SYMBOL(wait_for_completion_killable); 4054EXPORT_SYMBOL(wait_for_completion_killable);
4063 4055
4064/** 4056/**
4057 * wait_for_completion_killable_timeout: - waits for completion of a task (w/(to,killable))
4058 * @x: holds the state of this particular completion
4059 * @timeout: timeout value in jiffies
4060 *
4061 * This waits for either a completion of a specific task to be
4062 * signaled or for a specified timeout to expire. It can be
4063 * interrupted by a kill signal. The timeout is in jiffies.
4064 */
4065unsigned long __sched
4066wait_for_completion_killable_timeout(struct completion *x,
4067 unsigned long timeout)
4068{
4069 return wait_for_common(x, timeout, TASK_KILLABLE);
4070}
4071EXPORT_SYMBOL(wait_for_completion_killable_timeout);
4072
4073/**
4065 * try_wait_for_completion - try to decrement a completion without blocking 4074 * try_wait_for_completion - try to decrement a completion without blocking
4066 * @x: completion structure 4075 * @x: completion structure
4067 * 4076 *
@@ -7759,9 +7768,9 @@ void normalize_rt_tasks(void)
7759 7768
7760#endif /* CONFIG_MAGIC_SYSRQ */ 7769#endif /* CONFIG_MAGIC_SYSRQ */
7761 7770
7762#ifdef CONFIG_IA64 7771#if defined(CONFIG_IA64) || defined(CONFIG_KGDB_KDB)
7763/* 7772/*
7764 * These functions are only useful for the IA64 MCA handling. 7773 * These functions are only useful for the IA64 MCA handling, or kdb.
7765 * 7774 *
7766 * They can only be called when the whole system has been 7775 * They can only be called when the whole system has been
7767 * stopped - every CPU needs to be quiescent, and no scheduling 7776 * stopped - every CPU needs to be quiescent, and no scheduling
@@ -7781,6 +7790,9 @@ struct task_struct *curr_task(int cpu)
7781 return cpu_curr(cpu); 7790 return cpu_curr(cpu);
7782} 7791}
7783 7792
7793#endif /* defined(CONFIG_IA64) || defined(CONFIG_KGDB_KDB) */
7794
7795#ifdef CONFIG_IA64
7784/** 7796/**
7785 * set_curr_task - set the current task for a given cpu. 7797 * set_curr_task - set the current task for a given cpu.
7786 * @cpu: the processor in question. 7798 * @cpu: the processor in question.