Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751912AbbDNC5t (ORCPT ); Mon, 13 Apr 2015 22:57:49 -0400 Received: from ozlabs.org ([103.22.144.67]:48420 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751207AbbDNC5m (ORCPT ); Mon, 13 Apr 2015 22:57:42 -0400 From: Rusty Russell To: Ingo Molnar , Peter Zijlstra Cc: mathieu.desnoyers@efficios.com, oleg@redhat.com, paulmck@linux.vnet.ibm.com, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, andi@firstfloor.org, rostedt@goodmis.org, tglx@linutronix.de, laijs@cn.fujitsu.com, linux@horizon.com Subject: Re: [PATCH v5 10/10] module: Rework module_addr_{min,max} In-Reply-To: <20150413165636.GH6040@gmail.com> References: <20150413141126.756350256@infradead.org> <20150413141213.800009335@infradead.org> <20150413165636.GH6040@gmail.com> User-Agent: Notmuch/0.17 (http://notmuchmail.org) Emacs/24.3.1 (x86_64-pc-linux-gnu) Date: Tue, 14 Apr 2015 12:25:45 +0930 Message-ID: <87y4lvs9ji.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: 1600 Lines: 44 Ingo Molnar writes: > * Peter Zijlstra wrote: > >> __module_address() does an initial bound check before doing the >> {list/tree} iteration to find the actual module. The bound variables >> are nowhere near the mod_tree cacheline, in fact they're nowhere >> near one another. >> >> module_addr_min lives in .data while module_addr_max lives in .bss >> (smarty pants GCC thinks the explicit 0 assignment is a mistake). >> >> Rectify this by moving the two variables into a structure together >> with the latch_tree_root to guarantee they all share the same >> cacheline and avoid hitting two extra cachelines for the lookup. >> >> While reworking the bounds code, move the bound update from >> allocation to insertion time, this avoids updating the bounds for a >> few error paths. > >> +static struct mod_tree_root { >> + struct latch_tree_root root; >> + unsigned long addr_min; >> + unsigned long addr_max; >> +} mod_tree __cacheline_aligned = { >> + .addr_min = -1UL, >> +}; >> + >> +#define module_addr_min mod_tree.addr_min >> +#define module_addr_max mod_tree.addr_max Nice catch. Does the min/max comparison still win us anything? (I'm guessing yes...) In general, I'm happy with this series. Assume you want another go-round for Ingo's tweaks, then I'll take them for 4.2. 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/