My machine is running 64bit-xen and 64bit-dom0. I am using Numa emulation by speicifying "numa=fake=16", which split 16GB memory into 16 virtual nodes. I traced the source code in page_alloc.c. The functions init_heap_pages and init_node_heap handle page range to the specified heap zone. In init_node_heap, I modify the code a little and let _heap[node] allocation occur on xenheap, say on virtual node 0. Then after all the nodes initialization, I printk all node information by invoking avail_heap_pages. However, I found nodes from 1 to 15 have lost one page, because each node should have 262144 pages( 1GB), but the result shows below:
node 0 = 261876
node 1 = 262143
node 2 = 262143
I also saw " Reserving non-aligned node boundary @ mfn 0x40000", " @mfn 0x8000 " and etc. in the "xm dmes". I checked the code and found some comments in function init_heap_pages, saying
" Hand the specified arbitrary page range to the specified heap zone
checking the node_id of the previous page. If they differ and the
latter is not on a MAX_ORDER boundary, then we reserve the page by
not freeing it to the buddy allocator."
I am wondering if the loss of a page is due to reserve the page not freeing back to buddy allocator. Is it possible to assign exactly 262144 pages to each virtual node ?
Xen-devel mailing list