From patchwork Tue May 7 11:07:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cornelia Huck X-Patchwork-Id: 2532791 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 85F0DDF215 for ; Tue, 7 May 2013 11:07:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756492Ab3EGLHO (ORCPT ); Tue, 7 May 2013 07:07:14 -0400 Received: from e06smtp12.uk.ibm.com ([195.75.94.108]:48465 "EHLO e06smtp12.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755257Ab3EGLHN (ORCPT ); Tue, 7 May 2013 07:07:13 -0400 Received: from /spool/local by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 7 May 2013 12:03:27 +0100 Received: from d06dlp01.portsmouth.uk.ibm.com (9.149.20.13) by e06smtp12.uk.ibm.com (192.168.101.142) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 7 May 2013 12:03:25 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id F307A17D801A for ; Tue, 7 May 2013 12:08:12 +0100 (BST) Received: from d06av08.portsmouth.uk.ibm.com (d06av08.portsmouth.uk.ibm.com [9.149.37.249]) by b06cxnps4074.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r47B6wKE50856110 for ; Tue, 7 May 2013 11:06:58 GMT Received: from d06av08.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av08.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id r47B78Dr028726 for ; Tue, 7 May 2013 05:07:08 -0600 Received: from gondolin (dyn-9-152-224-122.boeblingen.de.ibm.com [9.152.224.122]) by d06av08.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id r47B787i028716; Tue, 7 May 2013 05:07:08 -0600 Date: Tue, 7 May 2013 13:07:06 +0200 From: Cornelia Huck To: Asias He Cc: Gleb Natapov , kvm@vger.kernel.org, "Michael S. Tsirkin" Subject: Re: irqfd issue Message-ID: <20130507130706.21663153@gondolin> In-Reply-To: <20130507112109.5ba311ca@gondolin> References: <20130507013730.GA8395@hj.localdomain> <20130507075536.GD12349@redhat.com> <20130507081450.GA13576@hj.localdomain> <20130507081838.GG12349@redhat.com> <20130507083650.GA14268@hj.localdomain> <20130507084207.GH12349@redhat.com> <20130507091040.GA14460@hj.localdomain> <20130507091209.GJ12349@redhat.com> <20130507112109.5ba311ca@gondolin> Organization: IBM Deutschland Research & Development GmbH Vorsitzende des Aufsichtsrats: Martina Koederitz =?UTF-8?B?R2VzY2jDpGZ0c2bDvGhydW5nOg==?= Dirk Wittkopp Sitz der Gesellschaft: =?UTF-8?B?QsO2Ymxpbmdlbg==?= Registergericht: Amtsgericht Stuttgart, HRB 243294 Mime-Version: 1.0 X-TM-AS-MML: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13050711-8372-0000-0000-000005F21696 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Tue, 7 May 2013 11:21:09 +0200 Cornelia Huck wrote: > On Tue, 7 May 2013 12:12:09 +0300 > Gleb Natapov wrote: > > > On Tue, May 07, 2013 at 05:10:41PM +0800, Asias He wrote: > > > On Tue, May 07, 2013 at 11:42:07AM +0300, Gleb Natapov wrote: > > > > On Tue, May 07, 2013 at 04:36:50PM +0800, Asias He wrote: > > > > > On Tue, May 07, 2013 at 11:18:38AM +0300, Gleb Natapov wrote: > > > > > > On Tue, May 07, 2013 at 04:14:50PM +0800, Asias He wrote: > > > > > > > On Tue, May 07, 2013 at 10:55:36AM +0300, Gleb Natapov wrote: > > > > > > > > On Tue, May 07, 2013 at 09:37:30AM +0800, Asias He wrote: > > > > > > > > > Hi, > > > > > > > > > > > > > > > > > > I am seeing this with linus/master. Any ideas? > > > > > > > > > > > > > > > > > How reproducible it this? What HEAD are you seeing this with? > > > > > > > > > > > > > > Almost always. Start a guest with vhost-net on. > > > > > > > > > > > > > It happens during start or on VM exit? The trace shows do_exit() > > > > > > > > > > > > > QEMU : e3351000cd682200835763caca87adf708ed1c65 > > > > > > > KERNEL: 51a26ae7a14b85c99c9be470c2d28eeeba0f26a3 > > > > > > > > > > > > > Can you try with kvm.git next branch? > > > > > > > > > > With next branch db6ae6158186a17165ef990bda2895ae7594b039, > > > > > > > > > Can you revert a0f155e9646d5f1c263f6f9aae880151100243bb and try again? > > > > > > The issue is gone with a0f155e9646d5f1c263f6f9aae880151100243bb > > > reverted. > > > > > Cornelia, any ideas? > > irqfd_deactivate before kvm_init or after kvm_exit? Let me look... > Hm, no idea. Asias, could you try whether the patch below yields any interesting backtraces? --- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c index 64ee720..59c3810 100644 --- a/virt/kvm/eventfd.c +++ b/virt/kvm/eventfd.c @@ -92,6 +92,8 @@ struct _irqfd { }; static struct workqueue_struct *irqfd_cleanup_wq; +static int irqfd_ready; +static unsigned long irqfd_cnt; static void irqfd_inject(struct work_struct *work) @@ -410,6 +412,8 @@ kvm_irqfd_assign(struct kvm *kvm, struct kvm_irqfd *args) */ fput(file); + irqfd_cnt++; + return 0; fail: @@ -483,12 +487,16 @@ kvm_irqfd_deassign(struct kvm *kvm, struct kvm_irqfd *args) */ flush_workqueue(irqfd_cleanup_wq); + irqfd_cnt--; + return 0; } int kvm_irqfd(struct kvm *kvm, struct kvm_irqfd *args) { + WARN_ON(!irqfd_ready); + if (args->flags & ~(KVM_IRQFD_FLAG_DEASSIGN | KVM_IRQFD_FLAG_RESAMPLE)) return -EINVAL; @@ -548,15 +556,22 @@ void kvm_irq_routing_update(struct kvm *kvm, */ int kvm_irqfd_init(void) { + WARN_ON(irqfd_cnt); + irqfd_cleanup_wq = create_singlethread_workqueue("kvm-irqfd-cleanup"); if (!irqfd_cleanup_wq) return -ENOMEM; + irqfd_ready = 1; + return 0; } void kvm_irqfd_exit(void) { + WARN_ON(irqfd_cnt); + irqfd_ready = 0; + destroy_workqueue(irqfd_cleanup_wq); } #endif