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/
Home Products Support Community News


[Xen-devel] difference between alloc_vm_area() and balloon_alloc_empty_p

To: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] difference between alloc_vm_area() and balloon_alloc_empty_page_range()
From: "Lily Huang" <ushuanglily@xxxxxxxxx>
Date: Mon, 10 Jul 2006 10:50:19 -0400
Delivery-date: Mon, 10 Jul 2006 07:51:20 -0700
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type; b=TZejHch/4W+SZr8Mo/8flhYGi3iz6oVkTBWENJOHNG0V0YPnVXsjXdkxxOFfqL8aiCkyFJ8Sid8czm8OfqNPWhiWWakzJ0S5PgVQCkCC9m7MFr4vs+AsBJono641X24S7jhecDCNMHjCVlYZP5xWwiQPSSm4rusEPU4AYWRMQfM=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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!

Xen-devel mailing list
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] difference between alloc_vm_area() and balloon_alloc_empty_page_range(), Lily Huang <=