Skip to contentSkip to conversation

How to allocate a memory page in virtual memory, but does not use physical memory?

DISCUSSION Lily Huang 2 participants 2 messages Aug 11, 2006

lore
Share & tools
lore

Lily Huang

author
#0 lore raw

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
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw
Quoted 6 lines · Lily Huang

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
[email protected]
http://lists.xensource.com/xen-devel