Re: [PATCH x86/mm] x86-64, NUMA: Don't call numa_set_distanc() forall possible node combinations during emulation

From: Tejun Heo
Date: Fri Mar 11 2011 - 11:04:07 EST


Hello, Yinghai.

On Fri, Mar 11, 2011 at 07:42:26AM -0800, Yinghai Lu wrote:
> > @@ -393,14 +398,10 @@ void __init numa_emulation(struct numa_meminfo *numa_meminfo, int numa_dist_cnt)
> > if (emu_nid_to_phys[i] == NUMA_NO_NODE)
> > emu_nid_to_phys[i] = dfl_phys_nid;
> >
> > - /*
> > - * Transform distance table. numa_set_distance() ignores all
> > - * out-of-bound distances. Just call it for every possible node
> > - * combination.
> > - */
> > + /* transform distance table */
> > numa_reset_distance();
> > - for (i = 0; i < MAX_NUMNODES; i++) {
> > - for (j = 0; j < MAX_NUMNODES; j++) {
> > + for (i = 0; i < max_emu_nid + 1; i++) {
> > + for (j = 0; j < max_emu_nid + 1; j++) {
>
> using num_emu_nids would be better?

Well, this is mostly frivolous but I think max is better here. We
don't really care about the number of emulated nodes. The number
we're looking for is the number which allows the code to cover all
enabled configurations. So, I think max reflects the logic better.

Thanks.

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