Bug 499644 - F-11 Xen 64-bit domU does not give memory back to the dom0
F-11 Xen 64-bit domU does not give memory back to the dom0
Product: Fedora
Classification: Fedora
Component: kernel (Show other bugs)
All Linux
low Severity medium
: ---
: ---
Assigned To: Justin M. Forbes
Fedora Extras Quality Assurance
Depends On:
Blocks: F11VirtTarget 523130
  Show dependency treegraph
Reported: 2009-05-07 10:33 EDT by Chris Lalancette
Modified: 2010-06-28 08:25 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 523130 (view as bug list)
Last Closed: 2010-06-28 08:25:34 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Patch for 2.6.29 kernel (1.85 KB, patch)
2009-08-20 04:01 EDT, Miroslav Rezanina
no flags Details | Diff
Returning memory not contained in e820 map (2.04 KB, patch)
2009-09-16 04:04 EDT, Miroslav Rezanina
no flags Details | Diff
patch as committed to jeremy's repo (5.14 KB, patch)
2010-02-23 12:03 EST, Paolo Bonzini
no flags Details | Diff

  None (edit)
Description Chris Lalancette 2009-05-07 10:33:09 EDT
Description of problem:
I'm following the test case here: https://fedoraproject.org/wiki/QA:Testcase_Virtualization_XenDomU_Cmdline_params.  My F-11 Xen domU is configured to start with 2047MB of memory.  However, while booting, I specified mem=1G on the kernel command-line, and the guest properly booted with only 1G of memory.  However, it does *not* give the spare memory back to the hypervisor.  That is, since we've set mem=, we can never balloon above that, so we should give that memory back to the HV so it can use it for other domains.  This works as expected in the RHEL-5 domU kernel, and in upstream linux-2.6.18-xen.hg.
Comment 1 Chris Lalancette 2009-05-08 11:23:54 EDT
     This one is much less important.  It would be nice to get it to work, but it's not critical.

Chris Lalancette
Comment 2 Bug Zapper 2009-06-09 11:20:31 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 11 development cycle.
Changing version to '11'.

More information and reason for this action is here:
Comment 3 Miroslav Rezanina 2009-08-20 04:01:51 EDT
Created attachment 358049 [details]
Patch for 2.6.29 kernel

Problem is caused by missing code for returning memory to HV. Patch adding this code to 2.6.29 kernel sent to Jeremy Fitzhardinge with CC na LKML and Xen-devel.
Comment 4 Mark McLoughlin 2009-08-21 04:40:59 EDT
Thread is here:


Sounds like Jeremy wants to use the e820 map to find unused memory rather than just max_pfn
Comment 5 Jeremy Fitzhardinge 2009-08-21 18:48:10 EDT
Yes, exactly.  Miroslav, would you mind reworking your patch along those lines?
Comment 6 Miroslav Rezanina 2009-09-16 04:04:39 EDT
Created attachment 361207 [details]
Returning memory  not contained in e820 map

General solution - returns all not mapped memory.
Comment 7 Justin M. Forbes 2009-10-07 12:44:41 EDT
Grabbing this one to get the patch tested and into Fedora.
Comment 8 Miroslav Rezanina 2009-10-08 01:02:52 EDT
There should be optimized version of patch in Jeremy's repo. However, this version has wrong location of return_unused_memory - it is in xen_memory_setup not in xen_post_allocator_init.

branch rebase/core-freemem branch at git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen.git
Comment 9 Justin M. Forbes 2009-10-14 14:18:14 EDT
Indeed, the version of the patch in jeremy's repo does not actually seem to return the unused memory.
Comment 10 Jeremy Fitzhardinge 2009-10-14 14:31:24 EDT
No, there's a problem with it.  Aside from releasing a bit too early, the test to make sure the page being released actually belongs to the domain seems to always return false, so it never wants to release anything.  I'm not sure why; it looks OK to me, but I haven't investigated it in detail yet.
Comment 11 Paolo Bonzini 2010-02-23 12:03:31 EST
Created attachment 395766 [details]
patch as committed to jeremy's repo

Attaching patch from Jeremy's repo for posterity.
Comment 12 Jeremy Fitzhardinge 2010-03-18 20:37:47 EDT
I just had another look at this and noticed a rather obvious bug in the patch: "mfn = pfn_to_mfn(mfn);" rather than "mfn = pfn_to_mfn(*p*fn);".  Fixing this makes it free memory properly as expected.
Comment 13 Bug Zapper 2010-04-27 10:11:32 EDT
This message is a reminder that Fedora 11 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 11.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '11'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 11's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 11 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
Comment 14 Bug Zapper 2010-06-28 08:25:34 EDT
Fedora 11 changed to end-of-life (EOL) status on 2010-06-25. Fedora 11 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.

Note You need to log in before you can comment on or make changes to this bug.