[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCHv13 2/2] gnttab: steal maptrack entries from other VCPUs
>>> On 15.06.15 at 16:47, <david.vrabel@xxxxxxxxxx> wrote: > +static int steal_maptrack_handle(struct grant_table *t, struct vcpu *v) > +{ > + struct domain *d = v->domain; I think this and the vcpu pointer can be const. Also it looks like they should be named currd and curr respectively (the latter would also apply to get_maptrack_handle() in patch 1). > + unsigned int first, i; > + > + /* Find an initial victim. */ > + first = i = NOW() % d->max_vcpus; Do you think NOW() is cheaper than get_random(), or is there any other reason you use time as a pseudo random number here? > + do { > + unsigned int handle; > + > + handle = __get_maptrack_handle(t, d->vcpu[i]); Elsewhere we're trying to be careful not to run into d->vcpu[] slots being NULL - I think this should be done here too. Jan _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |