From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59498) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1anUip-0003vI-5O for qemu-devel@nongnu.org; Tue, 05 Apr 2016 13:24:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1anUik-0005Qm-Qw for qemu-devel@nongnu.org; Tue, 05 Apr 2016 13:24:59 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:49885) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1anUik-0005Qf-LI for qemu-devel@nongnu.org; Tue, 05 Apr 2016 13:24:54 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 5142C20DB5 for ; Tue, 5 Apr 2016 13:24:54 -0400 (EDT) Date: Tue, 5 Apr 2016 13:24:53 -0400 From: "Emilio G. Cota" Message-ID: <20160405172453.GA5796@flamenco> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5703D9C1.2090307@redhat.com> Subject: Re: [Qemu-devel] [PATCH 02/10] compiler.h: add QEMU_CACHELINE + QEMU_ALIGN() + QEMU_CACHELINE_ALIGNED List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell , Paolo Bonzini Cc: MTTCG Devel , MTTCG Devel , Peter Crosthwaite , QEMU Developers , Sergey Fedorov , Alex =?iso-8859-1?Q?Benn=E9e?= , Richard Henderson On Tue, Apr 05, 2016 at 08:57:45 +0100, Peter Maydell wrote: > On 5 April 2016 at 06:30, Emilio G. Cota wrote: > > +#define QEMU_CACHELINE (64) > > Why 64? Does anything bad happen if the host's cache line > size turns out to be greater than the value here ? Defining a number lower than the host's cache line could result in some false sharing. No big deal for most workloads. Defining a number greater than the host's cache might result in wasted memory, which we really should avoid. I used 64 because it is common on x86, which I assume is what most developers develop on. On Tue, Apr 05, 2016 at 17:29:05 +0200, Paolo Bonzini wrote: > But the size of data structures cannot change at run-time. A bigger > worry is cross-compilation. > > Linux has these defaults: > > Alpha 32 or 64 > ARM configurable, 64 for ARMv7 > AArch64 128 > PPC 128 > s390 256 > x86 configurable, default 64 > > which should be easy to copy in QEMU too. So how about this: we add these defaults, and also add an optional --configure parameter to override said defaults. Otherwise I'd just stick to 64. Thanks, Emilio