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

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


  • To: xen-devel@xxxxxxxxxxxxxxxxxxx
  • From: Jui-Hao Chiang <juihaochiang@xxxxxxxxx>
  • Date: Fri, 3 Dec 2010 10:56:30 +0800
  • Delivery-date: Thu, 02 Dec 2010 18:57:28 -0800
  • 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=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

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

 


Rackspace

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