Re: Externalize SLIT table

From: Andi Kleen
Date: Sat Nov 06 2004 - 01:31:48 EST


Jack Steiner <steiner@xxxxxxx> writes:
>
> +static ssize_t node_read_distance(struct sys_device * dev, char * buf)
> +{
> + int nid = dev->id;
> + int len = 0;
> + int i;
> +
> + for (i = 0; i < numnodes; i++)
> + len += sprintf(buf + len, "%s%d", i ? " " : "", node_distance(nid, i));


One problem is that most architectures define node_distance currently
as nid != i. This would give 0 on them for the identity mapping and 10
on IA64 which uses the SLIT values. Not good for a portable interface.
I would suggest to at least change them to return 10 for a zero node distance.

Also in general I would prefer if you could move all the SLIT parsing
into drivers/acpi/numa.c. Then the other ACPI architectures don't need to copy
the basically identical code from ia64.

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