[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] Re: An issue in xen_limit_pages_to_max_mfn() in Xenlinux Ver. 2.6.18



>>> On 10.11.11 at 09:58, Daniel Kiper <dkiper@xxxxxxxxxxxx> wrote:
> Hi Jan,
> 
> During work on kexec/kdump for Xen domU I found that
> xen_limit_pages_to_max_mfn() registers undo_limit_pages()
> destructor which breaks __free_pages(). When __free_pages()
> is called then at beginning of this function put_page_testzero()
> is called which decrements page count for given page. Later
> undo_limit_pages() destructor is called which once again
> calls __free_pages() and in consequence put_page_testzero()
> fails (BUG_ON() is called) because page count is 0.

Seems like (on newer kernels, where this is a VM_BUG_ON()) this was
never hit on a configuration with CONFIG_DEBUG_VM, and on the older
kernels the function was never used for memory that would get freed
later (only kexec uses it there).

> It could
> be easily fixed, however, after reviewing xen_limit_pages_to_max_mfn()
> I could not find any good reason for which undo_limit_pages()
> destructor is registered. Maybe it could be removed at all because
> all pages are freed when __free_pages() is called and in this
> case we do not care where they live. However, maybe I missed
> something important.

It does matter - otherwise, over time, we could exhaust memory
below a certain boundary in Xen. So I think we need to add an
init_page_count() call to undo_limit_pages().

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.