aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sched.c')
-rw-r--r--kernel/sched.c49
1 files changed, 23 insertions, 26 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 054a6012de99..f8b8996228dd 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -544,6 +544,8 @@ struct rq {
544 struct root_domain *rd; 544 struct root_domain *rd;
545 struct sched_domain *sd; 545 struct sched_domain *sd;
546 546
547 unsigned long cpu_power;
548
547 unsigned char idle_at_tick; 549 unsigned char idle_at_tick;
548 /* For active balancing */ 550 /* For active balancing */
549 int post_schedule; 551 int post_schedule;
@@ -969,14 +971,6 @@ static struct rq *task_rq_lock(struct task_struct *p, unsigned long *flags)
969 } 971 }
970} 972}
971 973
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) 974static void __task_rq_unlock(struct rq *rq)
981 __releases(rq->lock) 975 __releases(rq->lock)
982{ 976{
@@ -1507,24 +1501,9 @@ static unsigned long target_load(int cpu, int type)
1507 return max(rq->cpu_load[type-1], total); 1501 return max(rq->cpu_load[type-1], total);
1508} 1502}
1509 1503
1510static struct sched_group *group_of(int cpu)
1511{
1512 struct sched_domain *sd = rcu_dereference_sched(cpu_rq(cpu)->sd);
1513
1514 if (!sd)
1515 return NULL;
1516
1517 return sd->groups;
1518}
1519
1520static unsigned long power_of(int cpu) 1504static unsigned long power_of(int cpu)
1521{ 1505{
1522 struct sched_group *group = group_of(cpu); 1506 return cpu_rq(cpu)->cpu_power;
1523
1524 if (!group)
1525 return SCHED_LOAD_SCALE;
1526
1527 return group->cpu_power;
1528} 1507}
1529 1508
1530static int task_hot(struct task_struct *p, u64 now, struct sched_domain *sd); 1509static int task_hot(struct task_struct *p, u64 now, struct sched_domain *sd);
@@ -1862,8 +1841,8 @@ static void dec_nr_running(struct rq *rq)
1862static void set_load_weight(struct task_struct *p) 1841static void set_load_weight(struct task_struct *p)
1863{ 1842{
1864 if (task_has_rt_policy(p)) { 1843 if (task_has_rt_policy(p)) {
1865 p->se.load.weight = prio_to_weight[0] * 2; 1844 p->se.load.weight = 0;
1866 p->se.load.inv_weight = prio_to_wmult[0] >> 1; 1845 p->se.load.inv_weight = WMULT_CONST;
1867 return; 1846 return;
1868 } 1847 }
1869 1848
@@ -4062,6 +4041,23 @@ int __sched wait_for_completion_killable(struct completion *x)
4062EXPORT_SYMBOL(wait_for_completion_killable); 4041EXPORT_SYMBOL(wait_for_completion_killable);
4063 4042
4064/** 4043/**
4044 * wait_for_completion_killable_timeout: - waits for completion of a task (w/(to,killable))
4045 * @x: holds the state of this particular completion
4046 * @timeout: timeout value in jiffies
4047 *
4048 * This waits for either a completion of a specific task to be
4049 * signaled or for a specified timeout to expire. It can be
4050 * interrupted by a kill signal. The timeout is in jiffies.
4051 */
4052unsigned long __sched
4053wait_for_completion_killable_timeout(struct completion *x,
4054 unsigned long timeout)
4055{
4056 return wait_for_common(x, timeout, TASK_KILLABLE);
4057}
4058EXPORT_SYMBOL(wait_for_completion_killable_timeout);
4059
4060/**
4065 * try_wait_for_completion - try to decrement a completion without blocking 4061 * try_wait_for_completion - try to decrement a completion without blocking
4066 * @x: completion structure 4062 * @x: completion structure
4067 * 4063 *
@@ -7596,6 +7592,7 @@ void __init sched_init(void)
7596#ifdef CONFIG_SMP 7592#ifdef CONFIG_SMP
7597 rq->sd = NULL; 7593 rq->sd = NULL;
7598 rq->rd = NULL; 7594 rq->rd = NULL;
7595 rq->cpu_power = SCHED_LOAD_SCALE;
7599 rq->post_schedule = 0; 7596 rq->post_schedule = 0;
7600 rq->active_balance = 0; 7597 rq->active_balance = 0;
7601 rq->next_balance = jiffies; 7598 rq->next_balance = jiffies;