From: "Lily Huang" Subject: difference between alloc_vm_area() and balloon_alloc_empty_page_range() Date: Mon, 10 Jul 2006 10:50:19 -0400 Message-ID: <4d616cca0607100750p659af1d1l52045530d8c319f1@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1241673427==" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Mime-version: 1.0 Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel List-Id: xen-devel@lists.xenproject.org --===============1241673427== Content-Type: multipart/alternative; boundary="----=_Part_116317_15922651.1152543019527" ------=_Part_116317_15922651.1152543019527 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline When I read the blkfront.c and blkback.c, I noticed that in some places (e.g, map_frontend_page()) it uses alloc_vm_area() to allocate memory for foreign page mapping. However, in some other places, it used balloon_alloc_empty_page_range() to allocate memory for mapping. What's the difference between these two functions? Why not just use one function like alloc_vm_area() or balloon_alloc_empty_page_range()? More important, I noticed that with alloc_vm_area(), it requires lock_vm_area() to lock down the vm area. Why do we need this? Why don't we need some locking mechanisms on memory allocated with balloon_alloc_empty_page_range()? thanks in advance for your kind help! lily ------=_Part_116317_15922651.1152543019527 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline When I read the blkfront.c and blkback.c, I noticed that in some places (e.g, map_frontend_page()) it uses alloc_vm_area() to allocate memory for foreign page mapping.  However, in some other places,
it used balloon_alloc_empty_page_range() to allocate memory for mapping.  What's the difference between these two functions? Why not just use one function like alloc_vm_area() or balloon_alloc_empty_page_range()?

More important, I noticed that with alloc_vm_area(), it requires lock_vm_area() to lock down the vm area. Why do we need this? Why don't we need some locking mechanisms on memory allocated with balloon_alloc_empty_page_range()?

thanks in advance for your kind help!

lily
------=_Part_116317_15922651.1152543019527-- --===============1241673427== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============1241673427==--