|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCHv12 5/5] [RFC] gnttab: steal maptrack entries from other VCPUs
>>> On 12.06.15 at 15:33, <david.vrabel@xxxxxxxxxx> wrote:
> +static int steal_maptrack_handle(struct grant_table *t, struct vcpu *v)
> +{
> + struct domain *d = v->domain;
> + unsigned int first, i;
> +
> + /* Find an initial victim. */
> + first = i = NOW() % d->max_vcpus;
> +
> + do {
> + unsigned int handle;
> +
> + handle = __get_maptrack_handle(t, d->vcpu[i]);
> + if ( handle >= 0 ) {
Coding style.
> @@ -337,10 +376,14 @@ get_maptrack_handle(
> /*
> * max_maptrack_frames is per domain so each VCPU gets a share of
> * the maximum, but allow at least one frame per VCPU.
> + *
> + * If this VCPU has run out of frames, try stealing an entry from
> + * another VCPU (in case the guest isn't mapping across its VCPUs
> + * evenly).
> */
> if ( v->maptrack_frames
> && v->maptrack_frames >= max_maptrack_frames / v->domain->max_vcpus
> )
> - return -1;
> + return steal_maptrack_handle(lgt, v);
This "allow at least one frame per vCPU" imo needs to go away
again now.
Looks okay to me apart from that; quite nice an idea to utilize
the fact that ownership of each entry is already being tracked.
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |