Skip to contentSkip to conversation

Memory fragmentation, order>0 allocation, and 4.0 dynamic RAM optimization features

DISCUSSION Dan Magenheimer 4 participants 4 messages Feb 8, 2010 – Feb 9, 2010

lore
Share & tools
lore
#0 lore raw

In a recent thread:

http://lists.xensource.com/archives/html/xen-devel/2010-02/msg00295.html

Jan Beulich points out that the memory fragmentation that results from Transcendent Memory ("tmem") sometimes causes problems for domain creation and PV migration because the shadow code requires order=2 allocations and the domain struct is order=4.

Though tmem accelerates fragmentation, I *think* this fragmentation can occur with page sharing/swapping, and possibly PoD. In fact, I think it can occur even with just ballooning.

I think the domain struct issue should be relatively easy to resolve (though maybe with a large patch), but the shadow code may be much harder.

But unless the shadow code is also fixed, theoretically 75% of RAM could be "free" but domain creation/migration failures may occur, reported only as insufficient memory.

Clearly it's too late to fix this for 4.0 but, given that 4.0-based product announcements are likely to emphasize the new 4.0 memory optimization technologies, it might be good to resolve it very early in 4.1/xen-unstable development.

Comments?

Are there other known order>0 allocations that might result in similar issues?

Thanks,
Dan

#1 lore raw
Quoted 9 lines · Dan Magenheimer

In a recent thread:

http://lists.xensource.com/archives/html/xen-devel/2010-02/msg00295.html

Jan Beulich points out that the memory fragmentation that results from Transcendent Memory ("tmem") sometimes causes problems for domain creation and PV migration because the shadow code requires order=2 allocations and the domain struct is order=4.

Quoted 7 lines

Though tmem accelerates fragmentation, I *think* this fragmentation can occur with page sharing/swapping, and possibly PoD. In fact, I think it can occur even with just ballooning.

I think the domain struct issue should be relatively easy to resolve (though maybe with a large patch), but the shadow code may be much harder.

I think everything but the shadow use of order-2 allocations is pretty easy to fix; just a case of logically carving up the multi-page structures.

I'm not sure, but suspect that fragmenting the shadow allocations may require extra book-keeping space in the page_info structure, for example.

-- Keir

#2 lore raw
Quoted 5 lines · Keir Fraser

I think everything but the shadow use of order-2 allocations is pretty easy to fix; just a case of logically carving up the multi-page structures.

I'm not sure, but suspect that fragmenting the shadow allocations may require extra book-keeping space in the page_info structure, for example.

I think it can be done without expanding page_info, but it involves pretty invasive changes to all the parts of the shadow code that deal with guest<->shadow mappings and with iterating across shadows.

As I said in response to an earlier email, I think the right thing to do here is to move pretty much all allocation in Xen to superpage granularity (and not just because it makes this issue go away!).

Tim

Signature · 3 lines
Tim Deegan <[email protected]>
Principal Software Engineer, XenServer Engineering
Citrix Systems UK Ltd.  (Company #02937203, SL9 0BG)
#3 lore raw
In reply to Dan Magenheimer
Quoted 3 lines
Quoted 1 line
Quoted 1 line

Dan Magenheimer <[email protected]> 08.02.10 19:13 >>>

Are there other known order>0 allocations that might result in similar issues?

The passthrough code has data structures which dynamically (nr_irqs- based) can exceed a page (see pt_irq_create_bind_vtd()).

Jan