Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1375750rwd; Wed, 31 May 2023 13:02:45 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7Bqd3hqeZud0okLgE0B6DaFSxJHhYasiI9TBnUBEGlYf3DTkAPIqFMrZcKmcPBH4wTAKe4 X-Received: by 2002:a17:903:120f:b0:1ae:1364:6079 with SMTP id l15-20020a170903120f00b001ae13646079mr5758360plh.44.1685563364790; Wed, 31 May 2023 13:02:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685563364; cv=none; d=google.com; s=arc-20160816; b=bf7FyMfUqhEMg25GUZdhJpuvELSHocy4tIxsob4ItVLKXGPVvTtCZz9QUR83nRRm5a 4ruyvXy+P7bFl8+/sUvKJW2NI/mMDpB0uiYf6u7wLA1/Lf5xrVWxGb8gykfV8y1EjQ0V GVoUoyk69S/VuNJ9OwVO2DLaDx+D6tbEawsVF0VGmoSOMIpFzOBVZ0lqF9RbARMhlo9W tyUDcig6XG16pPIWBznJhIQ/77uAq9gfDUCzn4XFrT5DksWKQ5XJfbjMlf4lD81/lOI3 zcyhVssE+UKQmbfIEpoJU90lStsdCd5is6F+3iujJM3C3Oc0+wFqQe3FIhnHpTrKLiW+ B0Iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=z52sOsfNfgV+KU5R/Bi827pzytsp4CjFmNR0KgwZ8Ts=; b=spwmDJdFUynY/KLQ5jvKTBUsc4NkmRFB1XRTimyLIIDGR7JmiyDaBgyit7A8hur5ru MPV7Nb4h8WqOOQl66/7JxL0bH49NGM9O8ShmvLQjir6lwOiX5PbGZkJ9HAL63IA+uuL7 gbIB0wwq58sEmWxHaLEppemz8lfPwhZJWWjiIxJ7LrVEuCBMQGckiO88Z0knpGqrGudI csxrbl8On3KmS/p1Pw2sn8sRrXi52ceRYv10MNIaV6y3y0Y3YeCn62iHa8ycykRU9Ltc QVGRTT5ssaaWbAWduMjgC2FiLH4lod887D4vgsCLFp9AHf/UnYdG8vCVG86Q6iHqu1BC eZSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="JuSCt7/4"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 13-20020a170902c14d00b001b036adfdf7si1420896plj.107.2023.05.31.13.02.24; Wed, 31 May 2023 13:02:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="JuSCt7/4"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229935AbjEaTzf (ORCPT + 99 others); Wed, 31 May 2023 15:55:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229913AbjEaTzc (ORCPT ); Wed, 31 May 2023 15:55:32 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ADA92185 for ; Wed, 31 May 2023 12:55:27 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 32DBE617E7 for ; Wed, 31 May 2023 19:55:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A45A3C433EF; Wed, 31 May 2023 19:55:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685562926; bh=K6BiB4d4pwh5l5fEvqg5HdsW+2/SZ5ha4oA58FNbVQ0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=JuSCt7/41WoHCLlFavs2RXRxmldBL7Ykn9PLKEI5mTlSq8J8r3pTx9GA6RlHeXPHs Bs7j3d47LzA6lzpLmKw49dzEsf0GHytMnrsv6BBfUSM0ou+i6s3zAz7/bUEIKf+edU 9ETJeJF8nBvARAe8pp4O9agqKhDGNPCh3pBNUzDIkPWSWgKa8CdBsMHBH3BNV/fMWG v8iuohJNe6KusvYI9dmcvVVyTq7z+fjUFHwk+26RGP41wNFB2J7hcZRPiokWcBTYS2 JHgziIzlZDrcsqgATpaEjbzvteIxpIDZ7bWbH8O+yYHtPFGuqU1Td4rWl8EfQHGRHy vxeSinydRSACg== Date: Wed, 31 May 2023 22:54:54 +0300 From: Mike Rapoport To: Song Liu Cc: Kent Overstreet , linux-kernel@vger.kernel.org, bpf@vger.kernel.org, mcgrof@kernel.org, peterz@infradead.org, tglx@linutronix.de, x86@kernel.org Subject: Re: [PATCH 0/3] Type aware module allocator Message-ID: <20230531195454.GB395338@kernel.org> References: <20230526051529.3387103-1-song@kernel.org> <20230529104530.GL4967@kernel.org> <20230531135120.GA395338@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 31, 2023 at 10:03:58AM -0700, Song Liu wrote: > On Wed, May 31, 2023 at 6:51 AM Mike Rapoport wrote: > > > > On Tue, May 30, 2023 at 03:37:24PM -0700, Song Liu wrote: > > > On Mon, May 29, 2023 at 3:45 AM Mike Rapoport wrote: > > > > > > > > On Sat, May 27, 2023 at 10:58:37PM -0700, Song Liu wrote: > > > > > On Sat, May 27, 2023 at 12:04 AM Kent Overstreet > > > > > wrote: > > > > > > > > > > > > I think this needs to back to the drawing board and we need something > > > > > > simpler just targeted at executable memory; architecture specific > > > > > > options should definitely _not_ be part of the exposed interface. > > > > > > > > > > I don't think we are exposing architecture specific options to users. > > > > > Some layer need to handle arch specifics. If the new allocator is > > > > > built on top of module_alloc, module_alloc is handling that. If the new > > > > > allocator is to replace module_alloc, it needs to handle arch specifics. > > > > > > > > I'm for creating a new allocator that will replace module_alloc(). This > > > > will give us a clean abstraction that modules and all the rest will use and > > > > it will make easier to plug binpack or another allocator instead of > > > > vmalloc. > > > > > > > > Another point is with a new allocator we won't have weird dependencies on > > > > CONFIG_MODULE in e.g. bpf and kprobes. > > > > > > > > I'll have something ready to post as an RFC in a few days. > > > > > > I guess this RFC is similar to unmapped_alloc()? If it replaces > > > vmalloc, we can probably trim this set down a bit (remove > > > mod_alloc_params and vmalloc_params, etc.). > > > > No, it's not a new allocator. I'm trying to create an API for code > > allocations that can accommodate all the architectures and it won't be a > > part of modules code. The modules will use the new API just like every > > other subsystem that needs to allocate code. > > > > I've got a core part of it here: > > > > https://git.kernel.org/pub/scm/linux/kernel/git/rppt/linux.git/log/?h=jitalloc/v1 > > This branch looks like the same scope as this set (but with different > implementation). So it will still use vmalloc, right? Yes, it still uses vmalloc. The idea is to decouple code allocations from modules from one side and make it handle all the variants expected by the architectures based on a set of parameters each architecture provides. The first few commits essentially shuffle the code around and replace arch::module_alloc() with arch::jit_alloc_params. The commits on top enable some bits that are not available today, like ROX executable memory and DYNAMIC_FTRACE without modules for x86. > Thanks, > Song -- Sincerely yours, Mike.