[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 02/10] compiler.h: add QEMU_CACHELINE + QEMU_ALI
From: |
Emilio G. Cota |
Subject: |
Re: [Qemu-devel] [PATCH 02/10] compiler.h: add QEMU_CACHELINE + QEMU_ALIGN() + QEMU_CACHELINE_ALIGNED |
Date: |
Tue, 5 Apr 2016 13:24:53 -0400 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Tue, Apr 05, 2016 at 08:57:45 +0100, Peter Maydell wrote:
> On 5 April 2016 at 06:30, Emilio G. Cota <address@hidden> 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
- [Qemu-devel] [PATCH 00/10] tb hash improvements, Emilio G. Cota, 2016/04/05
- Re: [Qemu-devel] [PATCH 02/10] compiler.h: add QEMU_CACHELINE + QEMU_ALIGN() + QEMU_CACHELINE_ALIGNED, Paolo Bonzini, 2016/04/05
- Re: [Qemu-devel] [PATCH 02/10] compiler.h: add QEMU_CACHELINE + QEMU_ALIGN() + QEMU_CACHELINE_ALIGNED, Lluís Vilanova, 2016/04/05
- Re: [Qemu-devel] [PATCH 02/10] compiler.h: add QEMU_CACHELINE + QEMU_ALIGN() + QEMU_CACHELINE_ALIGNED, Peter Maydell, 2016/04/05
- Re: [Qemu-devel] [PATCH 02/10] compiler.h: add QEMU_CACHELINE + QEMU_ALIGN() + QEMU_CACHELINE_ALIGNED, Paolo Bonzini, 2016/04/05
- Re: [Qemu-devel] [PATCH 02/10] compiler.h: add QEMU_CACHELINE + QEMU_ALIGN() + QEMU_CACHELINE_ALIGNED, Lluís Vilanova, 2016/04/05
- Re: [Qemu-devel] [PATCH 02/10] compiler.h: add QEMU_CACHELINE + QEMU_ALIGN() + QEMU_CACHELINE_ALIGNED, Richard Henderson, 2016/04/05
- Re: [Qemu-devel] [PATCH 02/10] compiler.h: add QEMU_CACHELINE + QEMU_ALIGN() + QEMU_CACHELINE_ALIGNED, Peter Maydell, 2016/04/05
- Re: [Qemu-devel] [PATCH 02/10] compiler.h: add QEMU_CACHELINE + QEMU_ALIGN() + QEMU_CACHELINE_ALIGNED, Lluís Vilanova, 2016/04/05