Bug 499644 - F-11 Xen 64-bit domU does not give memory back to the dom0
Summary: F-11 Xen 64-bit domU does not give memory back to the dom0
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: 11
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Justin M. Forbes
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: F11VirtTarget 523130
TreeView+ depends on / blocked
 
Reported: 2009-05-07 14:33 UTC by Chris Lalancette
Modified: 2010-06-28 12:25 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 523130 (view as bug list)
Environment:
Last Closed: 2010-06-28 12:25:34 UTC
Type: ---
Embargoed:


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

Description Chris Lalancette 2009-05-07 14:33:09 UTC
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 15:23:54 UTC
Miroslav,
     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 15:20:31 UTC
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:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 3 Miroslav Rezanina 2009-08-20 08:01:51 UTC
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 08:40:59 UTC
Thread is here:

  http://lists.xensource.com/archives/html/xen-devel/2009-08/threads.html#00573

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 22:48:10 UTC
Yes, exactly.  Miroslav, would you mind reworking your patch along those lines?

Comment 6 Miroslav Rezanina 2009-09-16 08:04:39 UTC
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 16:44:41 UTC
Grabbing this one to get the patch tested and into Fedora.

Comment 8 Miroslav Rezanina 2009-10-08 05:02:52 UTC
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 18:18:14 UTC
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 18:31:24 UTC
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 17:03:31 UTC
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-19 00:37:47 UTC
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 14:11:32 UTC
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: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 14 Bug Zapper 2010-06-28 12:25:34 UTC
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.