>>> On 15.06.15 at 16:47, <david.vra...@citrix.com> 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@lists.xen.org
http://lists.xen.org/xen-devel

Reply via email to