From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753615Ab0EGDdi (ORCPT ); Thu, 6 May 2010 23:33:38 -0400 Received: from ozlabs.org ([203.10.76.45]:43900 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752361Ab0EGDdh (ORCPT ); Thu, 6 May 2010 23:33:37 -0400 From: Rusty Russell To: "Michael S. Tsirkin" Subject: Re: [PATCH RFC] virtio: put last seen used index into ring itself Date: Fri, 7 May 2010 13:03:28 +0930 User-Agent: KMail/1.13.2 (Linux/2.6.32-21-generic; KDE/4.4.2; i686; ; ) Cc: linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, kvm@vger.kernel.org, qemu-devel@nongnu.org References: <20100505205814.GA7090@redhat.com> <201005061201.35223.rusty@rustcorp.com.au> <20100506061945.GA8363@redhat.com> In-Reply-To: <20100506061945.GA8363@redhat.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201005071303.29129.rusty@rustcorp.com.au> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 6 May 2010 03:49:46 pm Michael S. Tsirkin wrote: > Now, I also added an mb() in guest between read and write so > that last used index write can not get ahead of used index read. > It does feel good to have it there, but I can not say why > it's helpful. Works fine without it, but then these > subtle races might be hard to trigger. What do you think? I couldn't see that in the patch? I don't think it's necessary though, since the write of depends last_used depends on the read of used (and no platform we care about would reorder such a thing). I'm reasonably happy, but we should write some convenient test for missing interrupts. I'm thinking of a sender which does a loop: blasts 1MB of UDP packets, then prints the time and sleep(1). The receiver would print the time every 1MB of received data. The two times should almost exactly correspond. Assuming that the network doesn't overflow and lose stuff, this should identify any missing wakeup/interrupts (depending on direction used). Cheers, Rusty. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rusty Russell Subject: Re: [PATCH RFC] virtio: put last seen used index into ring itself Date: Fri, 7 May 2010 13:03:28 +0930 Message-ID: <201005071303.29129.rusty@rustcorp.com.au> References: <20100505205814.GA7090@redhat.com> <201005061201.35223.rusty@rustcorp.com.au> <20100506061945.GA8363@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: qemu-devel@nongnu.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org To: "Michael S. Tsirkin" Return-path: In-Reply-To: <20100506061945.GA8363@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: virtualization-bounces@lists.linux-foundation.org Errors-To: virtualization-bounces@lists.linux-foundation.org List-Id: kvm.vger.kernel.org On Thu, 6 May 2010 03:49:46 pm Michael S. Tsirkin wrote: > Now, I also added an mb() in guest between read and write so > that last used index write can not get ahead of used index read. > It does feel good to have it there, but I can not say why > it's helpful. Works fine without it, but then these > subtle races might be hard to trigger. What do you think? I couldn't see that in the patch? I don't think it's necessary though, since the write of depends last_used depends on the read of used (and no platform we care about would reorder such a thing). I'm reasonably happy, but we should write some convenient test for missing interrupts. I'm thinking of a sender which does a loop: blasts 1MB of UDP packets, then prints the time and sleep(1). The receiver would print the time every 1MB of received data. The two times should almost exactly correspond. Assuming that the network doesn't overflow and lose stuff, this should identify any missing wakeup/interrupts (depending on direction used). Cheers, Rusty. From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1OAEJn-0001wP-U7 for qemu-devel@nongnu.org; Thu, 06 May 2010 23:33:39 -0400 Received: from [140.186.70.92] (port=34631 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OAEJm-0001uI-KS for qemu-devel@nongnu.org; Thu, 06 May 2010 23:33:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OAEJk-0001YY-UZ for qemu-devel@nongnu.org; Thu, 06 May 2010 23:33:38 -0400 Received: from ozlabs.org ([203.10.76.45]:35649) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OAEJk-0001YP-Fg for qemu-devel@nongnu.org; Thu, 06 May 2010 23:33:36 -0400 From: Rusty Russell Date: Fri, 7 May 2010 13:03:28 +0930 References: <20100505205814.GA7090@redhat.com> <201005061201.35223.rusty@rustcorp.com.au> <20100506061945.GA8363@redhat.com> In-Reply-To: <20100506061945.GA8363@redhat.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201005071303.29129.rusty@rustcorp.com.au> Subject: [Qemu-devel] Re: [PATCH RFC] virtio: put last seen used index into ring itself List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: qemu-devel@nongnu.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org On Thu, 6 May 2010 03:49:46 pm Michael S. Tsirkin wrote: > Now, I also added an mb() in guest between read and write so > that last used index write can not get ahead of used index read. > It does feel good to have it there, but I can not say why > it's helpful. Works fine without it, but then these > subtle races might be hard to trigger. What do you think? I couldn't see that in the patch? I don't think it's necessary though, since the write of depends last_used depends on the read of used (and no platform we care about would reorder such a thing). I'm reasonably happy, but we should write some convenient test for missing interrupts. I'm thinking of a sender which does a loop: blasts 1MB of UDP packets, then prints the time and sleep(1). The receiver would print the time every 1MB of received data. The two times should almost exactly correspond. Assuming that the network doesn't overflow and lose stuff, this should identify any missing wakeup/interrupts (depending on direction used). Cheers, Rusty.