Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753597AbbB0MLo (ORCPT ); Fri, 27 Feb 2015 07:11:44 -0500 Received: from ozlabs.org ([103.22.144.67]:37671 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752501AbbB0MLS (ORCPT ); Fri, 27 Feb 2015 07:11:18 -0500 From: Rusty Russell To: Peter Zijlstra , Andi Kleen Cc: Andi Kleen , x86@kernel.org, linux-kernel@vger.kernel.org, mathieu.desnoyers@efficios.com, oleg@redhat.com, paulmck@linux.vnet.ibm.com, mingo@kernel.org Subject: Re: [RFC][PATCH] module: Optimize __module_address() using a latched RB-tree In-Reply-To: <20150226141256.GY24151@twins.programming.kicks-ass.net> References: <1424482737-958-1-git-send-email-andi@firstfloor.org> <20150223170436.GC5029@twins.programming.kicks-ass.net> <20150223174340.GD27767@tassilo.jf.intel.com> <20150226114309.GR21418@twins.programming.kicks-ass.net> <20150226141256.GY24151@twins.programming.kicks-ass.net> User-Agent: Notmuch/0.17 (http://notmuchmail.org) Emacs/24.3.1 (x86_64-pc-linux-gnu) Date: Fri, 27 Feb 2015 22:21:26 +1030 Message-ID: <87mw3zlght.fsf@rustcorp.com.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1021 Lines: 31 Peter Zijlstra writes: > On Thu, Feb 26, 2015 at 12:43:09PM +0100, Peter Zijlstra wrote: > > Assuming struct module is cacheline aligned, Rusty? from what I can find > its squirreled away in some data structure: > > mod = (void *)info->sechdrs[info->index.mod].sh_addr > > And I can't seem to quickly find its alignment. If its not cacheline > aligned, can we make it so? If the ELF says to align it, it will be aligned. Thus your patch below should make it Just Work: > @@ -278,7 +276,7 @@ > int (*init)(void); > > /* If this is non-NULL, vfree after init() returns */ > - void *module_init; > + void *module_init ____cacheline_aligned; > > /* Here is the actual code + data, vfree'd on unload. */ > void *module_core; Cheers, Rusty. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/