Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751797AbbKJB5x (ORCPT ); Mon, 9 Nov 2015 20:57:53 -0500 Received: from ozlabs.org ([103.22.144.67]:37447 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751107AbbKJB5v (ORCPT ); Mon, 9 Nov 2015 20:57:51 -0500 From: Rusty Russell To: Peter Zijlstra Cc: linux-kernel@vger.kernel.org, Josh Poimboeuf Subject: Re: [PATCH 3/4] module: use a structure to encapsulate layout. In-Reply-To: <20151109094150.GF17308@twins.programming.kicks-ass.net> References: <1447043037-10833-1-git-send-email-rusty@rustcorp.com.au> <1447043037-10833-4-git-send-email-rusty@rustcorp.com.au> <20151109094150.GF17308@twins.programming.kicks-ass.net> User-Agent: Notmuch/0.20.2 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-pc-linux-gnu) Date: Tue, 10 Nov 2015 12:11:46 +1030 Message-ID: <878u66k4v9.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: 1659 Lines: 45 Peter Zijlstra writes: > On Mon, Nov 09, 2015 at 02:53:56PM +1030, Rusty Russell wrote: >> diff --git a/kernel/module.c b/kernel/module.c >> index 14b224967e7b..a0a3d6d9d5e8 100644 >> --- a/kernel/module.c >> +++ b/kernel/module.c >> @@ -108,13 +108,6 @@ static LIST_HEAD(modules); >> * Use a latched RB-tree for __module_address(); this allows us to use >> * RCU-sched lookups of the address from any context. >> * >> - * Because modules have two address ranges: init and core, we need two >> - * latch_tree_nodes entries. Therefore we need the back-pointer from >> - * mod_tree_node. > > We still have the back-pointers, so removing all of that seems a little > excessive. Well, I thought about filling the hole with a "am_init" flag, and putting the layouts in a [2] array, but seemed too cutesy. >> - * >> - * Because init ranges are short lived we mark them unlikely and have placed >> - * them outside the critical cacheline in struct module. > > This information also isn't preserved. Ah yeah, Intel still use 64-byte cachelines. Still, this comment covers what we actually care about: +#ifdef CONFIG_MODULES_TREE_LOOKUP +/* Only touch one cacheline for common rbtree-for-core-layout case. */ +#define __module_layout_align ____cacheline_aligned +#else +#define __module_layout_align +#endif > Acked-by: Peter Zijlstra (Intel) Thanks! 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/