From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wei Liu Subject: Re: [PATCH v5 08/24] libxl: introduce libxl__vnuma_config_check Date: Sun, 22 Feb 2015 15:50:23 +0000 Message-ID: <20150222155023.GY2159@zion.uk.xensource.com> References: <1423770294-9779-1-git-send-email-wei.liu2@citrix.com> <1423770294-9779-9-git-send-email-wei.liu2@citrix.com> <21726.1811.311219.353545@mariner.uk.xensource.com> <20150213151251.GE13644@zion.uk.xensource.com> <20150213160635.GJ13644@zion.uk.xensource.com> <1424191861.4235.98.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1424191861.4235.98.camel@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Dario Faggioli Cc: Wei Liu , Ian Campbell , Andrew Cooper , "xen-devel@lists.xen.org" , "JBeulich@suse.com" , Ian Jackson , "ufimtseva@gmail.com" List-Id: xen-devel@lists.xenproject.org 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 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