Re: [PATCH 1/2] futex: eliminate cache miss from futex_hash()
From: Rasmus Villemoes
Date: Mon Jun 22 2015 - 09:45:27 EST
On Mon, Jun 22 2015, Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
> On Mon, Jun 22, 2015 at 03:16:18PM +0200, Rasmus Villemoes wrote:
>> +static struct {
>> + struct futex_hash_bucket *queues;
>> + unsigned long hashsize;
>> +} __futex_data __read_mostly __aligned(16);
>
> Does: __aligned(sizeof(__futex_data)), work?
>
Unfortunately not:
kernel/futex.c:265:30: error: â__futex_dataâ undeclared here (not in a function)
kernel/futex.c:265:1: error: requested alignment is not an integer constant
> Because 16 might waste 8 bytes on 32bit.
Yeah, wasting >= 48 bytes was the reason I didn't make it
____cacheline_aligned. If 8 bytes is also too much, I suppose one could
just give the struct a tag and then use sizeof(struct futex_data).
Rasmus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at http://www.tux.org/lkml/