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/
Home Products Support Community News


[Xen-devel] Re: mem_sharing: summarized problems when domain is dying

To: Tim Deegan <Tim.Deegan@xxxxxxxxxx>
Subject: [Xen-devel] Re: mem_sharing: summarized problems when domain is dying
From: Jui-Hao Chiang <juihaochiang@xxxxxxxxx>
Date: Fri, 21 Jan 2011 14:45:14 -0500
Cc: MaoXiaoyun <tinnycloud@xxxxxxxxxxx>, xen devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Fri, 21 Jan 2011 11:45:54 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=oUP4X5yrefHqZIHh0E4fv7n4QxHDOhMUA97APnSFoXw=; b=rnmh3Ob8s+Wacu/dpDPbO7UiWq8LLiyi8unQGzcpmX/5plvvdr2mAj46qGSCh5Q22c 4bdv0wk/LgsPiFs2TtRPs3DJy2B9SSP8cwJJYFqQeGm4yjJnxiSp1XFPsvAUz+S22bLA qsoHVNoGQTziICDKPHIoZoUeMdQzbi/IFRTdA=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=ErdOjpRW+qlEZmhAgQs6EiRw6iWNxbw/nBoW/qw9Fwl0g19SClwSnclZ/ZzNOYvilf FWTeYsOClLo2KLueCKIDE3C46f9As3Kll9S8d+nSeLDGIQndykldag1foslzrMdrhpu1 aYIaVz8gdhte/SruOUUphnBtvy7P2OuvTE5fc=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <AANLkTi=wimfV7Wc6aEd2cYS-=dOb2V5Xy97eSCgW-gKh@xxxxxxxxxxxxxx>
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: <AANLkTi=wimfV7Wc6aEd2cYS-=dOb2V5Xy97eSCgW-gKh@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx

On Fri, Jan 21, 2011 at 11:19 AM, Jui-Hao Chiang <juihaochiang@xxxxxxxxx> wrote:
> Hi, Tim:
> From tinnycloud's result, here I summarize the current problem and
> findings of mem_sharing due to domain dying.
> (1) When domain is dying, alloc_domheap_page() and
> set_shared_p2m_entry() would just fail. So the shr_lock is not enough
> to ensure that the domain won't die in the middle of mem_sharing code.
> As tinnycloud's code shows, is that better to use
> rcu_lock_domain_by_id before calling the above two functions?

There seems no good locking to protect a domain from changing the
is_dying state. So the unshare function could fail in the middle in
several points, e.g., alloc_domheap_page and set_shared_p2m_entry.
If that's the case, we need to add some checking, and probably revert
the things we have done when is_dying is changed in the middle.

Any comments?


Xen-devel mailing list