xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Hongkaixing <hongkaixing@huawei.com>
To: 'Ian Campbell' <Ian.Campbell@citrix.com>
Cc: xiaowei.yang@huawei.com, 'Olaf Hering' <olaf@aepfle.de>,
	xen-devel@lists.xensource.com, hanweidong@huawei.com,
	yanqiangjun@huawei.com, bicky.shi@huawei.com
Subject: Re: [PATCH] xenpaging:close domU's event channel and free port
Date: Fri, 17 Feb 2012 14:21:54 +0800	[thread overview]
Message-ID: <004201cced3c$73b1baf0$5b1530d0$@com> (raw)
In-Reply-To: <1329298049.31256.277.camel@zakaz.uk.xensource.com>



> -----Original Message-----
> From: Ian Campbell [mailto:Ian.Campbell@citrix.com]
> Sent: Wednesday, February 15, 2012 5:27 PM
> To: Hongkaixing
> Cc: 'Olaf Hering'; bicky.shi@huawei.com; xiaowei.yang@huawei.com; xen-devel@lists.xensource.com; yanqiangjun@huawei.com;
> hanweidong@huawei.com
> Subject: RE: [Xen-devel] [PATCH] xenpaging:close domU's event channel and free port
> 
> On Wed, 2012-02-15 at 02:24 +0000, Hongkaixing wrote:
> >
> > > -----Original Message-----
> > > From: Ian Campbell [mailto:Ian.Campbell@citrix.com]
> > > Perhaps I'm misunderstanding something and/or showing my ignorance about
> > > how xenpaging works but why does paging need a domU event channel
> > > anyway? Surely paging is transparent to the guest.
> > >
> > > Or is this really a dom0<->Xen event channel which just appears to be
> > > assigned to the guest?
> >
> > In xenpaging source code, there is an inter-domain event channel between dom0 and domU.
> [...]
> > > Who assigns this remote domain port? Shouldn't it either be closed when
> > > the dom0 end is closed or retained such that it can be reused each time
> > > instead of leaking?
> >
> >   In mem_event_enable(), the function alloc_unbound_xen_event_channel() allocates a free port for domU,
> > and assigns to xen_consumer;When xenpaging tears down, it just frees dom0's event channel port by xc_evtchn_unbind(),
> > leaves domU's port still occupied. So we should add the patch to free domU's port when xenpaging exits.
> 
> The two ends of that event channel are actually dom0 and Xen, because
> chn->xen_consumer is not NULL, even though the Xen end does live in the
> domU evtchn address space. It is not exactly dom0 and domU as you
> suggest, which is where my confused question arose.

   See what xenpaging_init() does when xenpaging is launched:
   xc_mem_paging_enable() ---> this function allocate a event channel of domain U, the remote port is stored in paging->mem_event.shared_page->port
            |
            V
    Xc_event_bind_interdomain() --> this function bind dom0 with domU port allocated above

   But when xenpaging is tear down:
   xc_mem_paging_disable()  -->  do nothing about event channel
            |
            V
   xc_evtchn_unbind()  -->  free the dom0 port, but leave remote port(domU )  ECS_UNBOUND


 Hong Kaixing.

> 
> Ian.

  reply	other threads:[~2012-02-17  6:21 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-09  8:53 [PATCH] xenpaging:close domU's event channel and free port hongkaixing
2012-02-10 16:22 ` Tim Deegan
2012-02-10 16:32 ` Andrew Cooper
2012-02-10 16:40 ` Olaf Hering
2012-02-13  5:47   ` Hongkaixing
2012-02-13 12:11     ` Ian Campbell
2012-02-15  2:24       ` Hongkaixing
2012-02-15  9:27         ` Ian Campbell
2012-02-17  6:21           ` Hongkaixing [this message]
2012-02-17  8:20             ` Ian Campbell
2012-02-17 10:28               ` Hongkaixing
2012-02-14 20:59     ` Olaf Hering
2012-02-14 21:19       ` Olaf Hering
2012-02-15  2:33         ` Hongkaixing

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='004201cced3c$73b1baf0$5b1530d0$@com' \
    --to=hongkaixing@huawei.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=bicky.shi@huawei.com \
    --cc=hanweidong@huawei.com \
    --cc=olaf@aepfle.de \
    --cc=xen-devel@lists.xensource.com \
    --cc=xiaowei.yang@huawei.com \
    --cc=yanqiangjun@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).