From mboxrd@z Thu Jan 1 00:00:00 1970 From: harry Subject: Re: *** SPAM *** Re: [PATCH][2/17] USB virt 2.6 split driver---xenidc buffer resource provider Date: Tue, 22 Nov 2005 12:14:50 +0000 Message-ID: <1132661690.5956.24.camel@localhost.localdomain> References: <1132579125.31295.113.camel@localhost.localdomain> <20051121201811.GB22728@granada.merseine.nu> <1132608600.4739.24.camel@localhost> <20051122105506.GG25081@granada.merseine.nu> <64e3d60d2a534be2452382579107e1c7@cl.cam.ac.uk> <20051122112244.GH25081@granada.merseine.nu> <5e9bc581e376b78ad3bbe5cb6d64819b@cl.cam.ac.uk> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <5e9bc581e376b78ad3bbe5cb6d64819b@cl.cam.ac.uk> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On Tue, 2005-11-22 at 12:06 +0000, Keir Fraser wrote: > On 22 Nov 2005, at 11:22, Muli Ben-Yehuda wrote: > > > 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." > > He also says the correct fix is to not need a multi-page chunk in the > first place. If you do, then you should pre-allocate. If that's > impossible (e.g., you're a module) then you use vmalloc(). The page > allocator does not attempt any compaction, so even if there is plenty > of memory you may well not find a big contiguous extent. I have a couple of small vmallocs which will be OK as kmallocs and the others I'm just vmalloc-ing a chunk and then splitting it up into a number of smaller resources anyway so I could kmalloc them individually instead. > -- Keir > >