Charles Coffing
2006-Jun-19 22:15 UTC
[Xen-devel] balloon.py unaware of pages on page_scrub_list
Suppose I create a domain with a "large" amount of memory (for some value of "large") and I set "on_crash" to be "reboot". Then I crash the domain. All the domain''s memory gets put on the page_scrub_list. Then xend attempts to restart the domain. The balloon code in xend sees that very little memory is free, so it attempts to balloon dom0 down even more. At this point, the balloon code and the page scrubber are racing. The domain may fail to restart, or domain 0 may be squeezed down farther than necessary. If dom0-min-mem is not tuned for the machine, this can get ugly. I think this applies to rebooting too, not just crashing. Would it make sense to give this information to balloon.py, and apply some heuristics? Perhaps xend should wait for the scrub list to go to zero before trying to balloon. Or maybe it should consider that memory as free, and only try to balloon (needed - to_scrub). The most obvious way (to me) to get that information to xend is via DOM0_PHYSINFO. That way, the number of free pages and the number of pages to scrub can be gotten atomically. Thoughts? I volunteer to code and test this if there''s some agreement on how it should be done. Thanks, Chuck _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2006-Jun-20 07:20 UTC
Re: [Xen-devel] balloon.py unaware of pages on page_scrub_list
On 19 Jun 2006, at 23:15, Charles Coffing wrote:> Would it make sense to give this information to balloon.py, and apply > some heuristics? Perhaps xend should wait for the scrub list to go to > zero before trying to balloon. Or maybe it should consider that > memory as free, and only try to balloon (needed - to_scrub). > > The most obvious way (to me) to get that information to xend is via > DOM0_PHYSINFO. That way, the number of free pages and the number of > pages to scrub can be gotten atomically. > > Thoughts? > > I volunteer to code and test this if there''s some agreement on how it > should be done.Your approach sounds fine to me. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Charles Coffing
2006-Jun-23 18:51 UTC
Re: [Xen-devel] balloon.py unaware of pages on page_scrub_list
Keir, Attached is a patch that makes the ballooning logic in xend aware of pages that are on the page scrub list. This fixes the case where crashing/restarting a domain can cause dom0 to balloon more than necessary. I changed the physinfo dictionary in Python to be in KiB, rather than MiB, to avoid accumulating ugly rounding errors. I tried to avoid changing units anywhere else. The patch is against xen-unstable. It applies and works against xen-3.0-testing also (in fact that''s where I did most of my testing) but I don''t know if you want to apply it there. I changed the dom0_physinfo in a non-backwards-compatible way. Looked nicer to me to group the *_pages fields together, but that''s probably not something you''d want to do in 3.0.2... your call. Thanks, Charles Signed-off-by: Charles Coffing <ccoffing@novell.com> On Tue, Jun 20, 2006 at 1:20 AM, Keir Fraser <Keir.Fraser@cl.cam.ac.uk> wrote:> On 19 Jun 2006, at 23:15, Charles Coffing wrote: > >> Would it make sense to give this information to balloon.py, andapply>> some heuristics? Perhaps xend should wait for the scrub list to goto>> zero before trying to balloon. Or maybe it should consider that >> memory as free, and only try to balloon (needed - to_scrub). >> >> The most obvious way (to me) to get that information to xend is via>> DOM0_PHYSINFO. That way, the number of free pages and the number of>> pages to scrub can be gotten atomically. >> >> Thoughts? >> >> I volunteer to code and test this if there''s some agreement on howit>> should be done. > > Your approach sounds fine to me. > > -- Keir > > > _______________________________________________ > Xen- devel mailing list > Xen- devel@lists.xensource.com > http://lists.xensource.com/xen- devel_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel