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

xen-devel

[Top] [All Lists]

[Xen-devel] [PATCH][Xen 4.0-testing.hg] fix small bugs of memory sharing

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH][Xen 4.0-testing.hg] fix small bugs of memory sharing
From: Jui-Hao Chiang <juihaochiang@xxxxxxxxx>
Date: Fri, 3 Dec 2010 10:56:30 +0800
Delivery-date: 2010年12月02日 18:57:28 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=qyMFcQS/oTuiy6MqsjTKIIiI2LO40ZhFqlRhfjA4UQA=; b=FdnImdyqL4t7C4W40qsHR09mEaPOwELjUj2M2WTJx2MfSyPTTnSyYPHBLi0kV/B2+x qPlT0WlYGeaKFqGzfjh8kuR+ur6TYitoajaPiKY4WJ27LDqhymFhIc5ULULbStMbYpmo 0IZXHBsPfzPpQtXMSt7o/L+hdMbdqCHg9g78o=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=dnsv/Sy7dxJZdYew5WHA/1Ntzd5HwT8cwjyun0AxxT9X5abq9JRr3Zpp8tYYRf9Mbn Rf7BXoN0mj/rqLiwgcbFJMU0vqjXwv05utItwE6Lyn7DkCmyJ1VKKUDYzvwfnJdlobFp aSsEQxbhkZ5D/smFjOkVeUrr6zcSnNKZJat5E=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Hi, all:

xen/arch/x86/hvm/hvm.c        |   2 ++
xen/arch/x86/mm.c             |  20 ++++++++++----------
xen/arch/x86/mm/mem_sharing.c |   4 ++--
3 files changed, 14 insertions(+), 12 deletions(-)

This small patch fixes 2 problems of memory sharing for xen-4.0-testing.hg
(I haven't submitted patch here, if it violates any conventional rules, I'm glad to have advices)
(1)  When nominating a shared page, the page_make_sharable() does not recover the type_info count if it fails to nominate the page.

(2) When building xen with debug=n, the code in ASSERT() won't get executed. Change to BUG_ON.

Besides, I don't understand why the page_make_sharable() force checking the count_info with the following way?
/* Check if the ref count is 2. The first from PGT_allocated, and the second
     * from get_page at the top of this function */
    if(page->count_info != (PGC_allocated | (2 + expected_refcnt)))


This seems to imply that the following kind of page can never be nominated for shared pages because ci (count_info) is greater than 2 after get_page. Here, domain 3 is a 64-bit HVM with hap=1, pae=1 on 64bit Xen.
(XEN) Debug for domain=3, gfn=10, Debug page: MFN=c210ad is ci=8000000000000002, ti=0, owner_id=3

Can someone gives a hint that
(1) in what kind of scenario that ci = 2 and ti=0?
(2) or why not allow ci >=2 to be nominated?

Bests,
Jui-Hao Chiang at CCMA, ITRI, R.O.C


Attachment: xen-4.0-testing.hg.mem_sharing.patch
Description: Text Data

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
Previous by Date: [Xen-devel] [xen-unstable test] 2957: regressions - FAIL , xen . org
Next by Date: [Xen-devel] NVIDIA Geforce 8400 GS PCI Express x16 Xen 4.0.2-rc1-pre VGA Passthrough Partial Success , "Singapore Citizen Mr. Teo En Ming (Zhang Enming) 张恩鸣 "
Previous by Thread: [Xen-devel] [xen-unstable test] 2957: regressions - FAIL , xen . org
Next by Thread: Re: [Xen-devel] [PATCH][Xen 4.0-testing.hg] fix small bugs of memory sharing , Tim Deegan
Indexes: [Date] [Thread] [Top] [All Lists]

Copyright ©, Citrix Systems Inc. All rights reserved. Legal and Privacy
Citrix This site is hosted by Citrix

AltStyle によって変換されたページ (->オリジナル) /