Lily Huang
2006-Aug-11 01:27 UTC
[Xen-devel] How to allocate a memory page in virtual memory, but does not use physical memory?
Sorry, this question might be a little dumb. I am trying to allocate pages in a domU and map certain pages from Dom0. Since the pages are already in dom0''s physical memory, it is desired that domu only allocate a "virtual space" for remapping, but does not need to use physical memory allocated to domu. I tried function balloon_alloc_empty_page_range() and alloc_pages(). But both of them seem to use physical memory once allocation succeed. So is there any way to allocate virtual space in address space, but does not pay any physical memory? This space is used only for remapping. Thanks in advance for generous help! -lily _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2006-Aug-11 09:27 UTC
Re: [Xen-devel] How to allocate a memory page in virtual memory, but does not use physical memory?
On 11/8/06 2:27 am, "Lily Huang" <ushuanglily@gmail.com> wrote:> I am trying to allocate pages in a domU and map certain pages from Dom0. Since > the pages are already in dom0''s physical memory, it is desired that domu only > allocate a "virtual space" for remapping, but does not need to use physical > memory allocated to domu. I tried function balloon_alloc_empty_page_range() > and alloc_pages(). But both of them seem to use physical memory once > allocation succeed.Balloon_empty_alloc_page_range() does what you want. It frees up the RAM which was previously mapped in the virtual address range that it returns to the caller. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel