From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933459AbbFVNpY (ORCPT ); Mon, 22 Jun 2015 09:45:24 -0400 Received: from mail-lb0-f175.google.com ([209.85.217.175]:34965 "EHLO mail-lb0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754750AbbFVNpO convert rfc822-to-8bit (ORCPT ); Mon, 22 Jun 2015 09:45:14 -0400 From: Rasmus Villemoes To: Peter Zijlstra Cc: Andrew Morton , Richard Weinberger , Andy Lutomirski , Darren Hart , Oleg Nesterov , Michael Kerrisk , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] futex: eliminate cache miss from futex_hash() Organization: D03 References: <1434978981-12831-1-git-send-email-linux@rasmusvillemoes.dk> <20150622133327.GT3644@twins.programming.kicks-ass.net> X-Hashcash: 1:20:150622:darren@dvhart.com::KWe6EuWXO8PVuJlJ:000000000000000000000000000000000000000000000aMS X-Hashcash: 1:20:150622:peterz@infradead.org::YWzauekMHhCM58Wa:000000000000000000000000000000000000000000ius X-Hashcash: 1:20:150622:akpm@linux-foundation.org::Jlm11Oz0r/E+tute:0000000000000000000000000000000000002g8j X-Hashcash: 1:20:150622:luto@amacapital.net::RPXnFFVHyV0a1bfX:00000000000000000000000000000000000000000032vL X-Hashcash: 1:20:150622:oleg@redhat.com::fgEi8xTArddB7DXQ:0047fL X-Hashcash: 1:20:150622:linux-kernel@vger.kernel.org::bYjSN9obO43O6p7D:0000000000000000000000000000000005G9M X-Hashcash: 1:20:150622:mtk.manpages@gmail.com::PflUFPDaqrGTGf1c:0000000000000000000000000000000000000005x8B X-Hashcash: 1:20:150622:richard@nod.at::M2jrHqPst3pMrxPz:000BoVh Date: Mon, 22 Jun 2015 15:45:10 +0200 In-Reply-To: <20150622133327.GT3644@twins.programming.kicks-ass.net> (Peter Zijlstra's message of "Mon, 22 Jun 2015 15:33:27 +0200") Message-ID: <87616fluvt.fsf@rasmusvillemoes.dk> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 22 2015, Peter Zijlstra 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/