]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - kernel/sched.c
hugetlbfs: architecture header cleanup
[linux-2.6-omap-h63xx.git] / kernel / sched.c
index b59a44e1ea442f966daa0dfa099a1e3f7c9631e7..740fb409e5bb32854dc9cc9b753cb25d83cdb7d4 100644 (file)
@@ -792,7 +792,7 @@ sched_feat_read(struct file *filp, char __user *ubuf,
                if (sysctl_sched_features & (1UL << i))
                        r += sprintf(buf + r, "%s ", sched_feat_names[i]);
                else
-                       r += sprintf(buf + r, "no_%s ", sched_feat_names[i]);
+                       r += sprintf(buf + r, "NO_%s ", sched_feat_names[i]);
        }
 
        r += sprintf(buf + r, "\n");
@@ -822,7 +822,7 @@ sched_feat_write(struct file *filp, const char __user *ubuf,
 
        buf[cnt] = 0;
 
-       if (strncmp(buf, "no_", 3) == 0) {
+       if (strncmp(buf, "NO_", 3) == 0) {
                neg = 1;
                cmp += 3;
        }
@@ -855,17 +855,6 @@ static struct file_operations sched_feat_fops = {
 
 static __init int sched_init_debug(void)
 {
-       int i, j, len;
-
-       for (i = 0; sched_feat_names[i]; i++) {
-               len = strlen(sched_feat_names[i]);
-
-               for (j = 0; j < len; j++) {
-                       sched_feat_names[i][j] =
-                               tolower(sched_feat_names[i][j]);
-               }
-       }
-
        debugfs_create_file("sched_features", 0644, NULL, NULL,
                        &sched_feat_fops);
 
@@ -1667,42 +1656,6 @@ void aggregate_group_weight(struct task_group *tg, struct sched_domain *sd)
        aggregate(tg, sd)->task_weight = task_weight;
 }
 
-/*
- * Redistribute tg->shares amongst all tg->cfs_rq[]s.
- */
-static void __aggregate_redistribute_shares(struct task_group *tg)
-{
-       int i, max_cpu = smp_processor_id();
-       unsigned long rq_weight = 0;
-       unsigned long shares, max_shares = 0, shares_rem = tg->shares;
-
-       for_each_possible_cpu(i)
-               rq_weight += tg->cfs_rq[i]->load.weight;
-
-       for_each_possible_cpu(i) {
-               /*
-                * divide shares proportional to the rq_weights.
-                */
-               shares = tg->shares * tg->cfs_rq[i]->load.weight;
-               shares /= rq_weight + 1;
-
-               tg->cfs_rq[i]->shares = shares;
-
-               if (shares > max_shares) {
-                       max_shares = shares;
-                       max_cpu = i;
-               }
-               shares_rem -= shares;
-       }
-
-       /*
-        * Ensure it all adds up to tg->shares; we can loose a few
-        * due to rounding down when computing the per-cpu shares.
-        */
-       if (shares_rem)
-               tg->cfs_rq[max_cpu]->shares += shares_rem;
-}
-
 /*
  * Compute the weight of this group on the given cpus.
  */
@@ -1712,18 +1665,11 @@ void aggregate_group_shares(struct task_group *tg, struct sched_domain *sd)
        unsigned long shares = 0;
        int i;
 
-again:
        for_each_cpu_mask(i, sd->span)
                shares += tg->cfs_rq[i]->shares;
 
-       /*
-        * When the span doesn't have any shares assigned, but does have
-        * tasks to run do a machine wide rebalance (should be rare).
-        */
-       if (unlikely(!shares && aggregate(tg, sd)->rq_weight)) {
-               __aggregate_redistribute_shares(tg);
-               goto again;
-       }
+       if ((!shares && aggregate(tg, sd)->rq_weight) || shares > tg->shares)
+               shares = tg->shares;
 
        aggregate(tg, sd)->shares = shares;
 }
@@ -7046,6 +6992,7 @@ static int find_next_best_node(int node, nodemask_t *used_nodes)
 /**
  * sched_domain_node_span - get a cpumask for a node's sched_domain
  * @node: node whose cpumask we're constructing
+ * @span: resulting cpumask
  *
  * Given a node, construct a good cpumask for its sched_domain to span. It
  * should be one that prevents unnecessary balancing, but also spreads tasks
@@ -8001,11 +7948,6 @@ void __init sched_init_smp(void)
 #else
 void __init sched_init_smp(void)
 {
-#if defined(CONFIG_NUMA)
-       sched_group_nodes_bycpu = kzalloc(nr_cpu_ids * sizeof(void **),
-                                                               GFP_KERNEL);
-       BUG_ON(sched_group_nodes_bycpu == NULL);
-#endif
        sched_init_granularity();
 }
 #endif /* CONFIG_SMP */
@@ -8138,7 +8080,7 @@ void __init sched_init(void)
         * we use alloc_bootmem().
         */
        if (alloc_size) {
-               ptr = (unsigned long)alloc_bootmem_low(alloc_size);
+               ptr = (unsigned long)alloc_bootmem(alloc_size);
 
 #ifdef CONFIG_FAIR_GROUP_SCHED
                init_task_group.se = (struct sched_entity **)ptr;