On Tue, Feb 17, 2015 at 04:51:03PM +0000, Dario Faggioli wrote: > On Fri, 2015-02-13 at 11:11 -0500, Elena Ufimtseva wrote: > > On Fri, Feb 13, 2015 at 11:06 AM, Wei Liu <wei.l...@citrix.com> wrote: > > > On Fri, Feb 13, 2015 at 10:39:25AM -0500, Elena Ufimtseva wrote: > > > >> Any sanity checks for distances? > > >> > > > > > > The same applies, what is a valid distance what is not? I guess zero is > > > not valid? Or do we enforce that the distance to local node must be > > > smaller than or equal to the distance to remote node? > > > > Yes, I think the second condition is enough for strict checking. > > > That would not harm, probably but I honestly would not put down much > enforcement on distance values. We can enforce non-zero values, we can > enforce local < remote, we can enforce the symmetry of the distance > matrix, but, really, I wouldn't go that far. > > What matters most wrt specification of the distances, is to provide a > sane default, in case one does not want to bother writing it down (or > does not want to write it down completely, as it could be tedious). > > So, if one does not say anything, we should come up with something that > makes sense (and I'll say more about this while reviewing patch 24). If > the user does say something, I would just go with that... perhaps after > printing a warning, but no more than that. >
The checking here and a sensible default are two things and are parallel to each other, I think. I've come up with something like this, to enforce local distance not larger than remote distance. /* Check vdistances */ for (i = 0; i < b_info->num_vnuma_nodes; i++) { uint32_t local_distance, remote_distance; v = &b_info->vnuma_nodes[i]; local_distance = v->distances[i]; for (j = 0; j < v->num_distances; j++) { if (i == j) continue; remote_distance = v->distances[j]; if (local_distance > remote_distance) { LOG(ERROR, "Distance from %u to %u smaller than %u's local distance", i, j, i); goto out; } } } Wei. > Regards, > Dario _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel