aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sched.c')
-rw-r--r--kernel/sched.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 4d46e90f59c3..7ffaabd64f89 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -237,6 +237,7 @@ struct runqueue {
237 237
238 task_t *migration_thread; 238 task_t *migration_thread;
239 struct list_head migration_queue; 239 struct list_head migration_queue;
240 int cpu;
240#endif 241#endif
241 242
242#ifdef CONFIG_SCHEDSTATS 243#ifdef CONFIG_SCHEDSTATS
@@ -707,12 +708,6 @@ static int recalc_task_prio(task_t *p, unsigned long long now)
707 DEF_TIMESLICE); 708 DEF_TIMESLICE);
708 } else { 709 } else {
709 /* 710 /*
710 * The lower the sleep avg a task has the more
711 * rapidly it will rise with sleep time.
712 */
713 sleep_time *= (MAX_BONUS - CURRENT_BONUS(p)) ? : 1;
714
715 /*
716 * Tasks waking from uninterruptible sleep are 711 * Tasks waking from uninterruptible sleep are
717 * limited in their sleep_avg rise as they 712 * limited in their sleep_avg rise as they
718 * are likely to be waiting on I/O 713 * are likely to be waiting on I/O
@@ -1660,6 +1655,9 @@ unsigned long nr_iowait(void)
1660/* 1655/*
1661 * double_rq_lock - safely lock two runqueues 1656 * double_rq_lock - safely lock two runqueues
1662 * 1657 *
1658 * We must take them in cpu order to match code in
1659 * dependent_sleeper and wake_dependent_sleeper.
1660 *
1663 * Note this does not disable interrupts like task_rq_lock, 1661 * Note this does not disable interrupts like task_rq_lock,
1664 * you need to do so manually before calling. 1662 * you need to do so manually before calling.
1665 */ 1663 */
@@ -1671,7 +1669,7 @@ static void double_rq_lock(runqueue_t *rq1, runqueue_t *rq2)
1671 spin_lock(&rq1->lock); 1669 spin_lock(&rq1->lock);
1672 __acquire(rq2->lock); /* Fake it out ;) */ 1670 __acquire(rq2->lock); /* Fake it out ;) */
1673 } else { 1671 } else {
1674 if (rq1 < rq2) { 1672 if (rq1->cpu < rq2->cpu) {
1675 spin_lock(&rq1->lock); 1673 spin_lock(&rq1->lock);
1676 spin_lock(&rq2->lock); 1674 spin_lock(&rq2->lock);
1677 } else { 1675 } else {
@@ -1707,7 +1705,7 @@ static void double_lock_balance(runqueue_t *this_rq, runqueue_t *busiest)
1707 __acquires(this_rq->lock) 1705 __acquires(this_rq->lock)
1708{ 1706{
1709 if (unlikely(!spin_trylock(&busiest->lock))) { 1707 if (unlikely(!spin_trylock(&busiest->lock))) {
1710 if (busiest < this_rq) { 1708 if (busiest->cpu < this_rq->cpu) {
1711 spin_unlock(&this_rq->lock); 1709 spin_unlock(&this_rq->lock);
1712 spin_lock(&busiest->lock); 1710 spin_lock(&busiest->lock);
1713 spin_lock(&this_rq->lock); 1711 spin_lock(&this_rq->lock);
@@ -2875,7 +2873,7 @@ asmlinkage void __sched schedule(void)
2875 */ 2873 */
2876 if (likely(!current->exit_state)) { 2874 if (likely(!current->exit_state)) {
2877 if (unlikely(in_atomic())) { 2875 if (unlikely(in_atomic())) {
2878 printk(KERN_ERR "scheduling while atomic: " 2876 printk(KERN_ERR "BUG: scheduling while atomic: "
2879 "%s/0x%08x/%d\n", 2877 "%s/0x%08x/%d\n",
2880 current->comm, preempt_count(), current->pid); 2878 current->comm, preempt_count(), current->pid);
2881 dump_stack(); 2879 dump_stack();
@@ -6035,6 +6033,7 @@ void __init sched_init(void)
6035 rq->push_cpu = 0; 6033 rq->push_cpu = 0;
6036 rq->migration_thread = NULL; 6034 rq->migration_thread = NULL;
6037 INIT_LIST_HEAD(&rq->migration_queue); 6035 INIT_LIST_HEAD(&rq->migration_queue);
6036 rq->cpu = i;
6038#endif 6037#endif
6039 atomic_set(&rq->nr_iowait, 0); 6038 atomic_set(&rq->nr_iowait, 0);
6040 6039
@@ -6075,7 +6074,7 @@ void __might_sleep(char *file, int line)
6075 if (time_before(jiffies, prev_jiffy + HZ) && prev_jiffy) 6074 if (time_before(jiffies, prev_jiffy + HZ) && prev_jiffy)
6076 return; 6075 return;
6077 prev_jiffy = jiffies; 6076 prev_jiffy = jiffies;
6078 printk(KERN_ERR "Debug: sleeping function called from invalid" 6077 printk(KERN_ERR "BUG: sleeping function called from invalid"
6079 " context at %s:%d\n", file, line); 6078 " context at %s:%d\n", file, line);
6080 printk("in_atomic():%d, irqs_disabled():%d\n", 6079 printk("in_atomic():%d, irqs_disabled():%d\n",
6081 in_atomic(), irqs_disabled()); 6080 in_atomic(), irqs_disabled());