From: Ingo Molnar Subject: Re: [PATCH 1/3] kvm tools: Make virtio-net kvm__irq_line thread safe Date: Fri, 29 Apr 2011 21:59:00 +0200 Message-ID: <20110429195900.GB17166@elte.hu> References: <1304058985-13833-1-git-send-email-asias.hejun@gmail.com> <20110429073006.GB16371@elte.hu> <4DBA6CFE.5090400@gmail.com> <20110429103210.GB24217@elte.hu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Asias He , Cyrill Gorcunov , Sasha Levin , Prasad Joshi , kvm@vger.kernel.org To: Pekka Enberg Return-path: Received: from mx3.mail.elte.hu ([157.181.1.138]:57587 "EHLO mx3.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755515Ab1D2T7E (ORCPT ); Fri, 29 Apr 2011 15:59:04 -0400 Content-Disposition: inline In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: * Pekka Enberg wrote: > On Fri, Apr 29, 2011 at 1:32 PM, Ingo Molnar wrote: > >>> Without the mutex around the kvm__irq_line, I am still seeing the > >>> hangs(with the irq assertion movement patch). > >> > >> since the mutex has no effect on the other party that modifies the virtual > >> queue (the guest OS), this at best only changes timings and hides the bug. > > On Fri, Apr 29, 2011 at 1:42 PM, Pekka Enberg wrote: > > Yes, I don't think it has anything to do with the queues - it's simply > > a bug in the RX path which requires other work to happen to raise the > > IRQ. > > Turns out thread pool isn't related to the problem. Asias and Sasha reported > that the problem triggers even with all the thread pool code reverted. I'm > guessing it's a latent bug in the virtio network driver that got exposed by > Cyrill's patch. It seems to be related to IRQ handling and I still think it's > related to assuming VIRTIO_PCI_QUEUE_NOTIFY will be triggered for the RX > path. Some sort of timeout would make it more robust i suspect, although the guest can always 'hang' both the rx and tx flow: by not clearing ring entries. So i think it needs to be understood how those stalls occur - who misses to issue a notification? Also, do perhaps TX activity assume a wakeup for RX processing? Right now the TX and RX threads are independent. So it would be nice to document how the virtio protocol works. Thanks, Ingo