[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH V3] xen/privcmd: improve performance of mapping of guest memory to dom0



>>> On 21.11.12 at 18:19, Mats Petersson <mats.petersson@xxxxxxxxxx> wrote:
> @@ -2526,19 +2557,94 @@ int xen_remap_domain_mfn_range(struct vm_area_struct 
> *vma,
>               if (err)
>                       goto out;
>  
> -             err = HYPERVISOR_mmu_update(mmu_update, batch, NULL, domid);
> -             if (err < 0)
> -                     goto out;
> +             /* We record the error for each page that gives an error, but
> +              * continue mapping until the whole set is done */
> +             do {
> +                     err = HYPERVISOR_mmu_update(&mmu_update[index],
> +                                                 batch_left, &done, domid);
> +                     if (err < 0) {
> +                             /* incrememnt done so we skip the error item */

increment

> +                             done++;
> +                             if (err_ptr)
> +                                     last_err = err_ptr[index] = err;
> +                             else
> +                                     /* exit if error and no err_ptr */
> +                                     goto out;

For readability/reduction of indentation, I'd suggest


                                /* exit if error and no err_ptr */
                                if (!err_ptr)
                                        goto out;
                                /* increment done so we skip the error item */
                                done++;
                                last_err = err_ptr[index] = err;

However, I wonder how a caller of the function would find out
at which slot the error happened when not passing an error
indicator array (after all, the function also doesn't undo what
already succeeded in that case, i.e. the state is completely
unknown to such a caller).

Jan

> +                     }
> +                     batch_left -= done;
> +                     index += done;
> +             } while (batch_left);



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.