From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757420Ab0EFKAp (ORCPT ); Thu, 6 May 2010 06:00:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53755 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753302Ab0EFKAo (ORCPT ); Thu, 6 May 2010 06:00:44 -0400 Message-ID: <4BE29320.5090506@redhat.com> Date: Thu, 06 May 2010 13:00:00 +0300 From: Avi Kivity User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100330 Fedora/3.0.4-1.fc12 Thunderbird/3.0.4 MIME-Version: 1.0 To: "Michael S. Tsirkin" CC: Rusty Russell , linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, kvm@vger.kernel.org, qemu-devel@nongnu.org Subject: Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used index into ring itself References: <20100505205814.GA7090@redhat.com> In-Reply-To: <20100505205814.GA7090@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/05/2010 11:58 PM, Michael S. Tsirkin wrote: > + /* We publish the last-seen used index at the end of the available ring. > + * It is at the end for backwards compatibility. */ > + vr->last_used_idx =&(vr)->avail->ring[num]; > + /* Verify that last used index does not spill over the used ring. */ > + BUG_ON((void *)vr->last_used_idx + > + sizeof *vr->last_used_idx> (void *)vr->used); > } > Shouldn't this be on its own cache line? One way to achieve this is to allocate it at the end. -- error compiling committee.c: too many arguments to function From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O9xsq-0007Rt-Sv for qemu-devel@nongnu.org; Thu, 06 May 2010 06:00:44 -0400 Received: from [140.186.70.92] (port=52112 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O9xsp-0007PZ-BB for qemu-devel@nongnu.org; Thu, 06 May 2010 06:00:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O9xsn-0006zw-RP for qemu-devel@nongnu.org; Thu, 06 May 2010 06:00:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42868) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O9xsn-0006zS-K9 for qemu-devel@nongnu.org; Thu, 06 May 2010 06:00:41 -0400 Message-ID: <4BE29320.5090506@redhat.com> Date: Thu, 06 May 2010 13:00:00 +0300 From: Avi Kivity MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used index into ring itself References: <20100505205814.GA7090@redhat.com> In-Reply-To: <20100505205814.GA7090@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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, Rusty Russell , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org On 05/05/2010 11:58 PM, Michael S. Tsirkin wrote: > + /* We publish the last-seen used index at the end of the available ring. > + * It is at the end for backwards compatibility. */ > + vr->last_used_idx =&(vr)->avail->ring[num]; > + /* Verify that last used index does not spill over the used ring. */ > + BUG_ON((void *)vr->last_used_idx + > + sizeof *vr->last_used_idx> (void *)vr->used); > } > Shouldn't this be on its own cache line? One way to achieve this is to allocate it at the end. -- error compiling committee.c: too many arguments to function