From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id DBE3AC433F5 for ; Thu, 3 Feb 2022 00:02:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 468E48D0120; Wed, 2 Feb 2022 19:02:01 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 418818D0119; Wed, 2 Feb 2022 19:02:01 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3068D8D0120; Wed, 2 Feb 2022 19:02:01 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0049.hostedemail.com [216.40.44.49]) by kanga.kvack.org (Postfix) with ESMTP id 203838D0119 for ; Wed, 2 Feb 2022 19:02:01 -0500 (EST) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id C9FE3824C454 for ; Thu, 3 Feb 2022 00:02:00 +0000 (UTC) X-FDA: 79099515600.16.6719681 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf04.hostedemail.com (Postfix) with ESMTP id 3FA9540006 for ; Thu, 3 Feb 2022 00:02:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=yI1c1Z9vXRpl2FDXC3ecyHJ59PiRNE8pG+XB1IRwy/4=; b=TQZ8uehuc4i6CSbxxV4Hj0ILbQ uw3bCU6M7RsrnOZIOmmsp709oeCm+Z3nSsimNrWc3/oRZyW22osgVtdoOaTvrbfscuQGVFuMM60Ii 6qOHhYip+BMTiTYm2hdkuT5e6WmD1I6Q0CLllhHc+vnOoIpcY/XqjE574FMPPOtKGugT46xA16OnN 0EsxAWAEGTMJknLtKflVSgCGEncWI+ZgffS/Wfsr3V0a8q5rD3jwnQXAiKHiLKoBFi35OGfjjXoBF bQ/GbSwbWC5tgN0wkF0k0e5TXQoD60mH38j7QsTCYxZke4Fk4ICP+k1NFqJrS6vX6yNuGjtW1W6VN J1Z+D4Gg==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nFPZR-00H7Rx-NH; Thu, 03 Feb 2022 00:01:53 +0000 Date: Wed, 2 Feb 2022 16:01:53 -0800 From: Luis Chamberlain To: Christophe Leroy , Aaron Tomlin Cc: Jessica Yu , "linux-kernel@vger.kernel.org" , "linuxppc-dev@lists.ozlabs.org" , "kgdb-bugreport@lists.sourceforge.net" , "linux-mm@kvack.org" , "linux-arch@vger.kernel.org" , Jason Wessel , Daniel Thompson , Douglas Anderson Subject: Re: [PATCH v3 4/6] modules: Add CONFIG_ARCH_WANTS_MODULES_DATA_IN_VMALLOC Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Stat-Signature: d6sgeafkswc3go1iadejr3phhepb9qy7 X-Rspam-User: nil Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=TQZ8uehu; spf=none (imf04.hostedemail.com: domain of mcgrof@infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=mcgrof@infradead.org; dmarc=fail reason="No valid SPF, DKIM not aligned (relaxed)" header.from=kernel.org (policy=none) X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 3FA9540006 X-HE-Tag: 1643846520-674627 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Sat, Jan 29, 2022 at 05:02:09PM +0000, Christophe Leroy wrote: > diff --git a/kernel/module.c b/kernel/module.c > index 11f51e17fb9f..f3758115ebaa 100644 > --- a/kernel/module.c > +++ b/kernel/module.c > @@ -81,7 +81,9 @@ > /* If this is set, the section belongs in the init part of the module */ > #define INIT_OFFSET_MASK (1UL << (BITS_PER_LONG-1)) > > +#ifndef CONFIG_ARCH_WANTS_MODULES_DATA_IN_VMALLOC > #define data_layout core_layout > +#endif > > /* > * Mutex protects: > @@ -111,6 +113,12 @@ static struct mod_tree_root { > #define module_addr_min mod_tree.addr_min > #define module_addr_max mod_tree.addr_max > > +#ifdef CONFIG_ARCH_WANTS_MODULES_DATA_IN_VMALLOC > +static struct mod_tree_root mod_data_tree __cacheline_aligned = { > + .addr_min = -1UL, > +}; > +#endif > + > #ifdef CONFIG_MODULES_TREE_LOOKUP > > /* > @@ -186,6 +194,11 @@ static void mod_tree_insert(struct module *mod) > __mod_tree_insert(&mod->core_layout.mtn, &mod_tree); > if (mod->init_layout.size) > __mod_tree_insert(&mod->init_layout.mtn, &mod_tree); > + > +#ifdef CONFIG_ARCH_WANTS_MODULES_DATA_IN_VMALLOC > + mod->data_layout.mtn.mod = mod; > + __mod_tree_insert(&mod->data_layout.mtn, &mod_data_tree); > +#endif kernel/ directory has quite a few files, module.c is the second to largest file, and it has tons of stuff. Aaron is doing work to split things out to make code easier to read and so that its easier to review changes. See: https://lkml.kernel.org/r/20220130213214.1042497-1-atomlin@redhat.com I think this is a good patch example which could benefit from that work. So I'd much prefer to see that work go in first than this, so to see if we can make the below changes more compartamentalized. Curious, how much testing has been put into this series? Luis