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

Re: [Xen-devel] [PATCH 5/7] libxc: implement gntshr for minios



Marek Marczykowski, le Mon 29 Apr 2013 01:17:16 +0200, a écrit :
> On 29.04.2013 00:44, Samuel Thibault wrote:
> > Marek Marczykowski, le Tue 23 Apr 2013 05:17:59 +0200, a écrit :
> >> +static int minios_gntshr_munmap(xc_gntshr *xcg, xc_osdep_handle h,
> >> +                               void *start_address, uint32_t count)
> >> +{
> >> +    int i;
> >> +    uint32_t gref;
> >> +
> >> +    for (i = 0; i < count; i++) {
> >> +        gref = gnttab_find_grant_of_page(start_address + i * PAGE_SIZE);
> > 
> > This can become quite expensive. Can we really not afford allocating the
> > list of grants, keeping its adresse in the xc_osdep_handle?
> 
> count is number of pages,

But that could be somehow big if using e.g. a 1MiB buffer.

> Also most likely munmap will be called very rarely (connection close).

Quadratic complexity is still not a good thing :)

> Anyway I haven't calculated how much memory such mapping will require

Well, just the gref per page, so about 0.1% of the memory you allocate
with memalign.

> and how much memory is still available in stubdom. Do you have some
> numbers?

Well, it's essentially up to the user.

> What can be xc_osdep_handle? In (almost?) every case it is file descriptor.
> Can it be some memory pointer?

IIRC Xen already assumes that a pointer can fit into an unsigned long,
yes. In the current implementation of minios it is true at least.

Samuel

_______________________________________________
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®.