lkml.org 
[lkml]   [2006]   [Sep]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Fix longstanding load balancing bug in the scheduler.
On Wed, Sep 06, 2006 at 04:38:33PM -0700, Christoph Lameter wrote:
> +int cpu_of(struct rq *rq)
> +{
> +#ifdef CONFIG_SMP
> + return rq->cpu;
> +#else
> + return 0;
> +#endif
> +}

Is there a reason why this is not made inline?

> static struct sched_group *
> find_busiest_group(struct sched_domain *sd, int this_cpu,
> - unsigned long *imbalance, enum idle_type idle, int
> *sd_idle)
> + unsigned long *imbalance, enum idle_type idle, int
> *sd_idle,
> + cpumask_t *cpus)
> {
> struct sched_group *busiest = NULL, *this = NULL, *group =
> sd->groups;
> unsigned long max_load, avg_load, total_load, this_load,
> total_pwr;
> @@ -2243,7 +2254,12 @@
> sum_weighted_load = sum_nr_running = avg_load = 0;
>
> for_each_cpu_mask(i, group->cpumask) {
> - struct rq *rq = cpu_rq(i);
> + struct rq *rq;
> +
> + if (!cpu_isset(i, *cpus))
> + continue;

In normal conditions can we make this "cpus" argument NULL and only set/use it
when we run into pinned condition? That will atleast avoid unnecessary memory
test bit operations in the normal case.

thanks,
suresh
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-09-08 19:53    [W:0.289 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site