]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branch 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
authorLinus Torvalds <torvalds@linux-foundation.org>
Sun, 17 Aug 2008 00:15:32 +0000 (17:15 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 17 Aug 2008 00:15:32 +0000 (17:15 -0700)
* 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  sched: scale sysctl_sched_shares_ratelimit with nr_cpus
  sched: fix rt-bandwidth hotplug race
  sched: fix the race between walk_tg_tree and sched_create_group

1  2 
kernel/sched.c

diff --combined kernel/sched.c
index 95e6ad3c231deb8ed43ca27476400b85ecd1eb24,040807196b33c09bbc9fed95fe3522b78117e38d..9a1ddb84e26d56e7d6b283daab1edbad20ae2042
@@@ -808,9 -808,9 +808,9 @@@ const_debug unsigned int sysctl_sched_n
  
  /*
   * ratelimit for updating the group shares.
-  * default: 0.5ms
+  * default: 0.25ms
   */
const_debug unsigned int sysctl_sched_shares_ratelimit = 500000;
unsigned int sysctl_sched_shares_ratelimit = 250000;
  
  /*
   * period over which we measure -rt task cpu usage in us.
@@@ -4669,52 -4669,6 +4669,52 @@@ int __sched wait_for_completion_killabl
  }
  EXPORT_SYMBOL(wait_for_completion_killable);
  
 +/**
 + *    try_wait_for_completion - try to decrement a completion without blocking
 + *    @x:     completion structure
 + *
 + *    Returns: 0 if a decrement cannot be done without blocking
 + *             1 if a decrement succeeded.
 + *
 + *    If a completion is being used as a counting completion,
 + *    attempt to decrement the counter without blocking. This
 + *    enables us to avoid waiting if the resource the completion
 + *    is protecting is not available.
 + */
 +bool try_wait_for_completion(struct completion *x)
 +{
 +      int ret = 1;
 +
 +      spin_lock_irq(&x->wait.lock);
 +      if (!x->done)
 +              ret = 0;
 +      else
 +              x->done--;
 +      spin_unlock_irq(&x->wait.lock);
 +      return ret;
 +}
 +EXPORT_SYMBOL(try_wait_for_completion);
 +
 +/**
 + *    completion_done - Test to see if a completion has any waiters
 + *    @x:     completion structure
 + *
 + *    Returns: 0 if there are waiters (wait_for_completion() in progress)
 + *             1 if there are no waiters.
 + *
 + */
 +bool completion_done(struct completion *x)
 +{
 +      int ret = 1;
 +
 +      spin_lock_irq(&x->wait.lock);
 +      if (!x->done)
 +              ret = 0;
 +      spin_unlock_irq(&x->wait.lock);
 +      return ret;
 +}
 +EXPORT_SYMBOL(completion_done);
 +
  static long __sched
  sleep_on_common(wait_queue_head_t *q, int state, long timeout)
  {
@@@ -5786,6 -5740,8 +5786,8 @@@ static inline void sched_init_granulari
                sysctl_sched_latency = limit;
  
        sysctl_sched_wakeup_granularity *= factor;
+       sysctl_sched_shares_ratelimit *= factor;
  }
  
  #ifdef CONFIG_SMP
@@@ -8508,8 -8464,8 +8510,8 @@@ struct task_group *sched_create_group(s
        WARN_ON(!parent); /* root should already exist */
  
        tg->parent = parent;
-       list_add_rcu(&tg->siblings, &parent->children);
        INIT_LIST_HEAD(&tg->children);
+       list_add_rcu(&tg->siblings, &parent->children);
        spin_unlock_irqrestore(&task_group_lock, flags);
  
        return tg;