]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 8 Jun 2012 21:59:29 +0000 (14:59 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 8 Jun 2012 21:59:29 +0000 (14:59 -0700)
Pull scheduler fixes from Ingo Molnar.

* 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  sched: Fix the relax_domain_level boot parameter
  sched: Validate assumptions in sched_init_numa()
  sched: Always initialize cpu-power
  sched: Fix domain iteration
  sched/rt: Fix lockdep annotation within find_lock_lowest_rq()
  sched/numa: Load balance between remote nodes
  sched/x86: Calculate booted cores after construction of sibling_mask

1  2 
include/linux/sched.h
kernel/sched/fair.c

diff --combined include/linux/sched.h
index c688d4cc2e40ba6a4be694101d06c492189e4f99,ac321d7534709968ac4d96fff48efce563b46b5d..4059c0f33f07a7454d545753281898d92e2d657f
@@@ -439,7 -439,6 +439,7 @@@ extern int get_dumpable(struct mm_struc
                                        /* leave room for more dump flags */
  #define MMF_VM_MERGEABLE      16      /* KSM may merge identical pages */
  #define MMF_VM_HUGEPAGE               17      /* set when VM_HUGEPAGE is set on vma */
 +#define MMF_EXE_FILE_CHANGED  18      /* see prctl_set_mm_exe_file() */
  
  #define MMF_INIT_MASK         (MMF_DUMPABLE_MASK | MMF_DUMP_FILTER_MASK)
  
@@@ -877,6 -876,8 +877,8 @@@ struct sched_group_power 
         * Number of busy cpus in this group.
         */
        atomic_t nr_busy_cpus;
+       unsigned long cpumask[0]; /* iteration mask */
  };
  
  struct sched_group {
@@@ -901,6 -902,15 +903,15 @@@ static inline struct cpumask *sched_gro
        return to_cpumask(sg->cpumask);
  }
  
+ /*
+  * cpumask masking which cpus in the group are allowed to iterate up the domain
+  * tree.
+  */
+ static inline struct cpumask *sched_group_mask(struct sched_group *sg)
+ {
+       return to_cpumask(sg->sgp->cpumask);
+ }
  /**
   * group_first_cpu - Returns the first cpu in the cpumask of a sched_group.
   * @group: The group whose first cpu is to be returned.
diff --combined kernel/sched/fair.c
index d5583f9588e7d52b29f34771af833bbe177dc0dd,c9fd6d673d05d1dd5bc9228f818f1462cebbd805..c099cc6eebe3a6f0cf19dde597c2df583ce57081
@@@ -3602,7 -3602,7 +3602,7 @@@ void update_group_power(struct sched_do
                } while (group != child->groups);
        }
  
-       sdg->sgp->power = power;
+       sdg->sgp->power_orig = sdg->sgp->power = power;
  }
  
  /*
@@@ -3632,7 -3632,7 +3632,7 @@@ fix_small_capacity(struct sched_domain 
  
  /**
   * update_sg_lb_stats - Update sched_group's statistics for load balancing.
 - * @sd: The sched_domain whose statistics are to be updated.
 + * @env: The load balancing environment.
   * @group: sched_group whose statistics are to be updated.
   * @load_idx: Load index of sched_domain of this_cpu for load calc.
   * @local_group: Does group contain this_cpu.
@@@ -3652,7 -3652,7 +3652,7 @@@ static inline void update_sg_lb_stats(s
        int i;
  
        if (local_group)
-               balance_cpu = group_first_cpu(group);
+               balance_cpu = group_balance_cpu(group);
  
        /* Tally up the load of all CPUs in the group */
        max_cpu_load = 0;
  
                /* Bias balancing toward cpus of our domain */
                if (local_group) {
-                       if (idle_cpu(i) && !first_idle_cpu) {
+                       if (idle_cpu(i) && !first_idle_cpu &&
+                                       cpumask_test_cpu(i, sched_group_mask(group))) {
                                first_idle_cpu = 1;
                                balance_cpu = i;
                        }
  
  /**
   * update_sd_pick_busiest - return 1 on busiest group
 - * @sd: sched_domain whose statistics are to be checked
 + * @env: The load balancing environment.
   * @sds: sched_domain statistics
   * @sg: sched_group candidate to be checked for being the busiest
   * @sgs: sched_group statistics
 - * @this_cpu: the current cpu
   *
   * Determine if @sg is a busier group than the previously selected
   * busiest group.
@@@ -3782,7 -3784,9 +3783,7 @@@ static bool update_sd_pick_busiest(stru
  
  /**
   * update_sd_lb_stats - Update sched_domain's statistics for load balancing.
 - * @sd: sched_domain whose statistics are to be updated.
 - * @this_cpu: Cpu for which load balance is currently performed.
 - * @idle: Idle status of this_cpu
 + * @env: The load balancing environment.
   * @cpus: Set of cpus considered for load balancing.
   * @balance: Should we balance.
   * @sds: variable to hold the statistics for this sched_domain.
@@@ -3871,8 -3875,10 +3872,8 @@@ static inline void update_sd_lb_stats(s
   * Returns 1 when packing is required and a task should be moved to
   * this CPU.  The amount of the imbalance is returned in *imbalance.
   *
 - * @sd: The sched_domain whose packing is to be checked.
 + * @env: The load balancing environment.
   * @sds: Statistics of the sched_domain which is to be packed
 - * @this_cpu: The cpu at whose sched_domain we're performing load-balance.
 - * @imbalance: returns amount of imbalanced due to packing.
   */
  static int check_asym_packing(struct lb_env *env, struct sd_lb_stats *sds)
  {
   * fix_small_imbalance - Calculate the minor imbalance that exists
   *                    amongst the groups of a sched_domain, during
   *                    load balancing.
 + * @env: The load balancing environment.
   * @sds: Statistics of the sched_domain whose imbalance is to be calculated.
 - * @this_cpu: The cpu at whose sched_domain we're performing load-balance.
 - * @imbalance: Variable to store the imbalance.
   */
  static inline
  void fix_small_imbalance(struct lb_env *env, struct sd_lb_stats *sds)
@@@ -4042,7 -4049,11 +4043,7 @@@ static inline void calculate_imbalance(
   * Also calculates the amount of weighted load which should be moved
   * to restore balance.
   *
 - * @sd: The sched_domain whose busiest group is to be returned.
 - * @this_cpu: The cpu for which load balancing is currently being performed.
 - * @imbalance: Variable which stores amount of weighted load which should
 - *            be moved to restore balance/put a group to idle.
 - * @idle: The idle status of this_cpu.
 + * @env: The load balancing environment.
   * @cpus: The set of CPUs under consideration for load-balancing.
   * @balance: Pointer to a variable indicating if this_cpu
   *    is the appropriate cpu to perform load balancing at this_level.