Re: [Qemu-devel] hotplug: VM got stuck when attaching a pass-through device to the non-pass-through VM for the first time

2014-02-24 Thread Zhanghaoyu (A)
>>> > I agree it's either COW breaking or (similarly) locking pages that >>> > the guest hasn't touched yet. >>> > >>> > You can use prealloc or "-rt mlock=on" to avoid this problem. >>> > >>> > Paolo >> Or the new shared flag - IIRC shared VMAs don't do COW either. > >Only if the problem isn't lo

Re: [Qemu-devel] hotplug: VM got stuck when attaching a pass-through device to the non-pass-through VM for the first time

2014-02-18 Thread Zhanghaoyu (A)
>> What if you detach and re-attach? >> Is it fast then? >> If yes this means the issue is COW breaking that occurs with >> get_user_pages, not translation as such. >> Try hugepages with prealloc - does it help? > >I agree it's either COW breaking or (similarly) locking pages that the guest >hasn

Re: [Qemu-devel] hotplug: VM got stuck when attaching a pass-through device to the non-pass-through VM for the first time

2014-02-18 Thread Michael S. Tsirkin
On Tue, Feb 18, 2014 at 12:05:19PM +0100, Paolo Bonzini wrote: > Il 18/02/2014 11:51, Michael S. Tsirkin ha scritto: > >>> I agree it's either COW breaking or (similarly) locking pages that > >>> the guest hasn't touched yet. > >>> > >>> You can use prealloc or "-rt mlock=on" to avoid this problem.

Re: [Qemu-devel] hotplug: VM got stuck when attaching a pass-through device to the non-pass-through VM for the first time

2014-02-18 Thread Paolo Bonzini
Il 18/02/2014 11:51, Michael S. Tsirkin ha scritto: > I agree it's either COW breaking or (similarly) locking pages that > the guest hasn't touched yet. > > You can use prealloc or "-rt mlock=on" to avoid this problem. > > Paolo Or the new shared flag - IIRC shared VMAs don't do COW either. On

Re: [Qemu-devel] hotplug: VM got stuck when attaching a pass-through device to the non-pass-through VM for the first time

2014-02-18 Thread Zhanghaoyu (A)
>> Hi, all >> >> The VM will get stuck for a while(about 6s for a VM with 20GB memory) when >> attaching a pass-through PCI card to the non-pass-through VM for the first >> time. >> The reason is that the host will build the whole VT-d GPA->HPA DMAR >> page-table, which needs a lot of time, an

Re: [Qemu-devel] hotplug: VM got stuck when attaching a pass-through device to the non-pass-through VM for the first time

2014-02-18 Thread Michael S. Tsirkin
On Tue, Feb 18, 2014 at 11:42:19AM +0100, Paolo Bonzini wrote: > Il 18/02/2014 11:38, Michael S. Tsirkin ha scritto: > >What if you detach and re-attach? > >Is it fast then? > >If yes this means the issue is COW breaking that occurs > >with get_user_pages, not translation as such. > >Try hugepages

Re: [Qemu-devel] hotplug: VM got stuck when attaching a pass-through device to the non-pass-through VM for the first time

2014-02-18 Thread Paolo Bonzini
Il 18/02/2014 11:38, Michael S. Tsirkin ha scritto: What if you detach and re-attach? Is it fast then? If yes this means the issue is COW breaking that occurs with get_user_pages, not translation as such. Try hugepages with prealloc - does it help? I agree it's either COW breaking or (similarly

Re: [Qemu-devel] hotplug: VM got stuck when attaching a pass-through device to the non-pass-through VM for the first time

2014-02-18 Thread Michael S. Tsirkin
On Tue, Feb 18, 2014 at 02:38:40AM +, Zhanghaoyu (A) wrote: > Hi, all > > The VM will get stuck for a while(about 6s for a VM with 20GB memory) when > attaching a pass-through PCI card to the non-pass-through VM for the first > time. > The reason is that the host will build the whole VT-d G

[Qemu-devel] hotplug: VM got stuck when attaching a pass-through device to the non-pass-through VM for the first time

2014-02-17 Thread Zhanghaoyu (A)
Hi, all The VM will get stuck for a while(about 6s for a VM with 20GB memory) when attaching a pass-through PCI card to the non-pass-through VM for the first time. The reason is that the host will build the whole VT-d GPA->HPA DMAR page-table, which needs a lot of time, and during this time, t