WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

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

To: "Daniel Kiper" <dkiper@xxxxxxxxxxxx>
Subject: [Xen-devel] Re: An issue in xen_limit_pages_to_max_mfn() in Xenlinux Ver. 2.6.18
From: "Jan Beulich" <JBeulich@xxxxxxxx>
Date: Thu, 10 Nov 2011 10:27:57 +0000
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, konrad.wilk@xxxxxxxxxx
Delivery-date: Thu, 10 Nov 2011 02:28:27 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20111110085821.GA15751@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20111110085821.GA15751@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
>>> 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