From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [RFC] virtio: Support releasing lock during kick Date: Tue, 29 Jun 2010 10:12:01 +0300 Message-ID: <4C299CC1.1020003@redhat.com> References: <1277328242-10685-1-git-send-email-stefanha@linux.vnet.ibm.com> <20100628155505.GB4717@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Marcelo Tosatti , Stefan Hajnoczi , virtualization@lists.linux-foundation.org, kvm@vger.kernel.org To: Stefan Hajnoczi Return-path: Received: from mx1.redhat.com ([209.132.183.28]:17949 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753469Ab0F2HMP (ORCPT ); Tue, 29 Jun 2010 03:12:15 -0400 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On 06/29/2010 10:08 AM, Stefan Hajnoczi wrote: > > Is it incorrect to have the following pattern? > spin_lock_irqsave(q->queue_lock); > spin_unlock(q->queue_lock); > spin_lock(q->queue_lock); > spin_unlock_irqrestore(q->queue_lock); > Perfectly legitimate. spin_lock_irqsave() is equivalent to local_irq_save() followed by spin_lock() (with the potential optimization that we can service interrupts while spinning). -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.