From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pekka Enberg Subject: Re: [PATCH 3/3] kvm tools: Make virtio-blk kvm__irq_line thread safe Date: Fri, 29 Apr 2011 09:55:13 +0300 Message-ID: References: <1304058985-13833-1-git-send-email-asias.hejun@gmail.com> <1304058985-13833-3-git-send-email-asias.hejun@gmail.com> <20110429064433.GB13893@elte.hu> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Cc: Asias He , Cyrill Gorcunov , Sasha Levin , Prasad Joshi , kvm@vger.kernel.org To: Ingo Molnar Return-path: Received: from mail-gy0-f174.google.com ([209.85.160.174]:57974 "EHLO mail-gy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752501Ab1D2GzP (ORCPT ); Fri, 29 Apr 2011 02:55:15 -0400 Received: by gyd10 with SMTP id 10so1216684gyd.19 for ; Thu, 28 Apr 2011 23:55:14 -0700 (PDT) In-Reply-To: <20110429064433.GB13893@elte.hu> Sender: kvm-owner@vger.kernel.org List-ID: On Fri, Apr 29, 2011 at 9:44 AM, Ingo Molnar wrote: > Hm, this looks a bit strange (the mutex here protects only a kernel call - that > cannot be right) and there's no explanation why it's needed. Why do > VIRTIO_BLK_IRQ (== KVM_IRQ_LINE ioctl()) calls have to be covered by the mutex? > > A short blurb about expected behavior on SMP and locking rules at the top of > virtio-blk.c would be nice. Yes, looks strange. Asias, did you see some bad behavior that this fixes? The per-device mutexes are there to protect device state. The assumption here is that KVM handles KVM_IRQ_LINE ioctl() serialization by titself.