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

Re: [Xen-devel] [PATCH][2/17] USB virt 2.6 split driver---xenidc buffer resource provider



On Mon, Nov 21, 2005 at 09:30:00PM +0000, Harry Butterworth wrote:

> > > +                 if (xenidc_buffer_resource_provider_init_or_exit
> > > +                     (provider, 0)
> > > +                     != 0) {
> > > +                         vfree(provider);
> > 
> > using vmalloc/vfree is discouraged unless you must.
> 
> I don't understand this.  I thought vmalloc was more likely to be
> successful than kmalloc because the memory doesn't need to be contiguous
> so I thought it was preferable to use vmalloc when possible.

Nope, vmalloc has both a resource usage issue (we only have a limited
vmalloc space) and some small overhead that kmalloc doesn't. The only
time you should use vmalloc is if you know that kmalloc can't give you
a large enough buffer.

> > You have a lot of empty lines. This function needs no empty lines, for
> > example, except maybe after the variable declarations. Also, does
> > 'list' need to be reference counted here?
> 
> I'm used to a lot of empty lines.  I can get rid of them all if you
> like.

I would like it, but I'm not the one who will end up deciding whether
to commit it or not ;-)

Cheers,
Muli
-- 
Muli Ben-Yehuda
http://www.mulix.org | http://mulix.livejournal.com/


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

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