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

Luke Browning lukebr at linux.vnet.ibm.com
Tue Apr 22 07:17:54 EST 2008


On Thu, 2008-04-17 at 18:11 +1000, Jeremy Kerr wrote:
> 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;

You could return, but your are assuming that it is correctly assigned.
What is the default behaviour if the register is not set.  

> 
> 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