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

Re: [Xen-devel] [PATCH v5 04/28] vmap: Add vmalloc_cb and vfree_cb



On Wed, Mar 30, 2016 at 10:24:41AM -0600, Jan Beulich wrote:
> >>> On 24.03.16 at 21:00, <konrad.wilk@xxxxxxxxxx> wrote:
> > @@ -266,16 +275,15 @@ void *vzalloc(size_t size)
> >      return p;
> >  }
> >  
> > -void vfree(void *va)
> > +void vfree_cb(void *va, unsigned int pages, vfree_cb_t *vfree_cb_fnc)
> 
> Just to repeat: This "caller provides size" worries me, the more that
> this doesn't mirror anything the allocation side does. Would you mind
> providing a case where using vm_size() instead is not correct?

When the virtual addresses (to which we will stitch the pages allocated
by vmalloc) are not allocated (provided?) by vmap.

vm_size() will be very unhappy if that virtual address it is provided with
are not from the 'vmap' pool and will return 0.

> 
> > --- a/xen/include/xen/vmap.h
> > +++ b/xen/include/xen/vmap.h
> > @@ -12,9 +12,23 @@ void *__vmap(const mfn_t *mfn, unsigned int granularity,
> >  void *vmap(const mfn_t *mfn, unsigned int nr);
> >  void vunmap(const void *);
> >  void *vmalloc(size_t size);
> > +
> > +/*
> > + * Callback for vmalloc_cb to use when vmap-ing.
> > + */
> 
> Comment style.
> 
> > +typedef void *(vmap_cb_t)(const mfn_t *mfn, unsigned int pages);
> 
> Stray parentheses (again).

<sigh> I swore I fixed it and then did a pass through the rest to fix
others!

But a grep tells me:

+typedef void *(vmap_cb_t)(const mfn_t *mfn, unsigned int pages);
+typedef void (vfree_cb_t)(void *va, unsigned int pages);
+typedef int (find_space_t)(size_t, unsigned long *, unsigned long *);
+typedef void (*xsplice_loadcall_t)(void);
+typedef void (*xsplice_unloadcall_t)(void);

I need to fix those. Sorry about that - I really though I had them fixed.

> 
> Jan
> 

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