[Cbe-oss-dev] [PATCH 4/3] spufs context switch - route spu interrupts to local node

Jeremy Kerr jk at ozlabs.org
Thu Apr 17 18:11:36 EST 2008


Luke,

>  static void cpu_affinity_set(struct spu *spu, int cpu)
>  {
> -	u64 target = iic_get_target_id(cpu);
> -	u64 route = target << 48 | target << 32 | target << 16;
> +	u64 target;
> +	u64 route;
> +
> +	if (nr_cpus_node(spu->node)) {
> +		cpumask_t mask = node_to_cpumask(spu->node);
> +
> +		if (!cpus_intersects(mask, cpu))
> +			cpu = first_cpu(mask);
> +	}
> +
> +	target = iic_get_target_id(cpu);
> +	route = target << 48 | target << 32 | target << 16;
>  	out_be64(&spu->priv1->int_route_RW, route);
>  }

If cpu isn't in this spu's node, first_cpu() isn't really making a 
better decision about the routing. How about we just leave it as-is in 
this case:

		if (!cpus_intersects(mask, cpu))
			return;

I'd also put the eieio() within cpu_affinity_set, it may not be required 
on other Cell platforms.

Cheers,


Jeremy



More information about the cbe-oss-dev mailing list