WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

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

On Tue, Nov 22, 2005 at 11:12:29AM +0000, Keir Fraser wrote:

> If the buffer is > PAGE_SIZE, you should use vmalloc if at all 
> possible. Order != 0 allocations can easily fail on a churned box with 
> lots of memory fragmentation.

Quoth Linus[1[:

"vmalloc() is NOT SOMETHING YOU SHOULD EVER USE! It's only valid for
when you _need_ a big array, and you don't have any choice. It's slow,
and it's a very restricted resource: it's a global resource that is
literally restricted to a few tens of megabytes. It should be _very_
carefully used."

The main reason not to use vmalloc has a run-time overhead due to the
increased tlb footprint and is also a limited resource (128MB on x86,
IIRC). I've heard of systems running out of vmalloc space and
dying with plenty of memory otherwise available. There are other ways
to deal with high order allocations failing, e.g. pre-allocating, not
using GFP_ATOMIC where not absolutely necessary, etc.

[1] http://www.ussg.iu.edu/hypermail/linux/kernel/0311.1/0576.html

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