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

Re: [Xen-devel] [PATCH] xenpaging:close domU's event channel and free port



On Fri, 2012-02-17 at 06:21 +0000, Hongkaixing wrote:
> 
> > -----Original Message-----
> > From: Ian Campbell [mailto:Ian.Campbell@xxxxxxxxxx]
> > Sent: Wednesday, February 15, 2012 5:27 PM
> > To: Hongkaixing
> > Cc: 'Olaf Hering'; bicky.shi@xxxxxxxxxx; xiaowei.yang@xxxxxxxxxx; 
> > xen-devel@xxxxxxxxxxxxxxxxxxx; yanqiangjun@xxxxxxxxxx;
> > hanweidong@xxxxxxxxxx
> > 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@xxxxxxxxxx]
> > > > 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

I wasn't querying the presence of the leak or the validity of the fix, I
was asking what the domU event channel was even for (i.e. why does it
exist at all?).

I answered that myself in my previous mail -- it's actually a Xen event
channel not a guest visible one.

Ian.

> 
> 
>  Hong Kaixing.
> 
> > 
> > Ian.
> 



_______________________________________________
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®.