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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C1F19C54EAA for ; Mon, 23 Jan 2023 06:57:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230266AbjAWG5y (ORCPT ); Mon, 23 Jan 2023 01:57:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229519AbjAWG5v (ORCPT ); Mon, 23 Jan 2023 01:57:51 -0500 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7D8513528; Sun, 22 Jan 2023 22:57:50 -0800 (PST) Received: by verein.lst.de (Postfix, from userid 2407) id 0C7E668BEB; Mon, 23 Jan 2023 07:57:47 +0100 (CET) Date: Mon, 23 Jan 2023 07:57:46 +0100 From: Christoph Hellwig To: Song Liu Cc: Christoph Hellwig , Thomas Gleixner , Luis Chamberlain , Christophe Leroy , songliubraving@fb.com, Peter Zijlstra , linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH/RFC] module: replace module_layout with module_memory Message-ID: <20230123065746.GB30529@lst.de> References: <20230106220959.3398792-1-song@kernel.org> <20230118074047.GA27385@lst.de> <20230119053545.GA16775@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 20, 2023 at 09:42:26AM -0800, Song Liu wrote: > So here are the two versions, both with secondary addr_[min|max] for > CONFIG_ARCH_WANTS_MODULES_DATA_IN_VMALLOC. > > v2. Just use mod_mem array: > https://git.kernel.org/pub/scm/linux/kernel/git/song/md.git/commit/?h=remotes/song-md/new_module_alloc_build_test_v2 > > v3. mod_mem array and the defines: > #define mod_core_text mod_mem[MOD_MEM_TYPE_TEXT] > #define mod_core_data mod_mem[MOD_MEM_TYPE_DATA] > etc. > https://git.kernel.org/pub/scm/linux/kernel/git/song/md.git/commit/?h=remotes/song-md/new_module_alloc_build_test_v3 I find v2 much preferably. Having magic layouts with different access methods is horribly confusing. It might be a way changes things if modifying every caller would be intrusive, but starting out that way does not seem like a very good idea.