lkml.org 
[lkml]   [2013]   [Jun]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] sched: Optimize build_sched_domains() for saving first SD node for a cpu
Hi, Viresh

On 06/04/2013 07:20 PM, Viresh Kumar wrote:
[snip]
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index 58453b8..638f6cb 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -6533,16 +6533,13 @@ static int build_sched_domains(const struct cpumask *cpu_map,
> sd = NULL;
> for (tl = sched_domain_topology; tl->init; tl++) {
> sd = build_sched_domain(tl, &d, cpu_map, attr, sd, i);
> + if (!*per_cpu_ptr(d.sd, i))

What about:
if (tl == sched_domain_topology)

It cost less than per_cpu_ptr(), isn't it?

Regards,
Michael Wang

> + *per_cpu_ptr(d.sd, i) = sd;
> if (tl->flags & SDTL_OVERLAP || sched_feat(FORCE_SD_OVERLAP))
> sd->flags |= SD_OVERLAP;
> if (cpumask_equal(cpu_map, sched_domain_span(sd)))
> break;
> }
> -
> - while (sd->child)
> - sd = sd->child;
> -
> - *per_cpu_ptr(d.sd, i) = sd;
> }
>
> /* Build the groups for the domains */
>



\
 
 \ /
  Last update: 2013-06-05 07:21    [W:0.075 / U:0.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site