From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hongkaixing Subject: Re: [PATCH] xenpaging:close domU's event channel and free port Date: Mon, 13 Feb 2012 13:47:00 +0800 Message-ID: <002201ccea12$e83c0420$b8b40c60$@com> References: <9f4640e40d4f31563885.1328777634@h00166998.china.huawei.com> <20120210164010.GA10009@aepfle.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-reply-to: <20120210164010.GA10009@aepfle.de> Content-language: zh-cn List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: 'Olaf Hering' Cc: bicky.shi@huawei.com, xiaowei.yang@huawei.com, xen-devel@lists.xensource.com, yanqiangjun@huawei.com, hanweidong@huawei.com List-Id: xen-devel@lists.xenproject.org > -----Original Message----- > From: Olaf Hering [mailto:olaf@aepfle.de] > Sent: Saturday, February 11, 2012 12:40 AM > To: hongkaixing@huawei.com > Cc: xen-devel@lists.xensource.com; yanqiangjun@huawei.com; bicky.shi@huawei.com; xiaowei.yang@huawei.com; > hanweidong@huawei.com > Subject: Re: [PATCH] xenpaging:close domU's event channel and free port > > On Thu, Feb 09, hongkaixing@huawei.com wrote: > > > xenpaging:close domU's event channel and free port > > > > Every domain (X86 64 bit)has 4096 event channels.In source code, > > domU's event channel is allocated in mem_event_enable(),but just > > unbind dom0's event channel in xenpaging_teardown().This bug will > > result in that we can not use xenpaging after reopening it for 4096 > > times.We should free domU's event channel in mem_event_disable().so > > that we can reuse the port. > > Does that fix a real bug? > > xenpaging_teardown() does both xc_mem_paging_disable() and > xc_evtchn_unbind(). The former fails often because the domain is gone > and so it doesnt even reach the function in mem_event.c. > The latter is called unconditionally. I have tested whether the kernel driver does a cleanup of all used ports once xenpaging exits. Every domain has 1024 event channels.In xc_evtchn_unbind(),it just frees dom0's event channel's port, and changes its state to be ECS_FREE;but the remote domain(domU)'s port is still ECS_UNBOUND. so when each domU triggers 1024 times of xenpaging,it will fail of "Error initialising shared page (28 = No space left on device): Internal error".Because there is no available free port for this domU. Only the port's state is ECS_FREE,then it can be allocated by get_free_port(); > > Also I would expect that once xenpaging exits the kernel driver does a > cleanup of all used ports. I havent checked wether thats true. > > Olaf