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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 37CF3C77B73 for ; Tue, 30 May 2023 22:49:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231641AbjE3Wt0 (ORCPT ); Tue, 30 May 2023 18:49:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233592AbjE3WtS (ORCPT ); Tue, 30 May 2023 18:49:18 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10D1C19C for ; Tue, 30 May 2023 15:49:06 -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 4D6ED62E3D for ; Tue, 30 May 2023 22:49:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B243FC43445; Tue, 30 May 2023 22:49:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685486945; bh=0IuCc4ZXrqDomHpXWfXNUBxYgu4rnYtwWDypsa5wpHU=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=ToGdzQYh7c7TbK+h9+ubtH9qr/elwlZQG/3NYRfX082sGoMBsCwx23XrscWImkWox 0H3+IA1U/mz/QipP+b7iDaz+bjF8tvdVSOtqy4gO1r6QLVQDpGrcV95+DyHGp8KCR+ g7FE4W91vlKlO4n59v/McfXuWiG71ZnV4kqdB0bDVHX4RU0JMtRJe2oJIejvFszrcB ysymo8H4CDRWrYY0H4O7bbz0PYQaJDwjz0LYpTwXLZLzBTubECx0b1qd1Go65KPzOe QFBWt4tMZACr6TZXIvGAEM4DUkfhTnMtrPIpk8hpsFb216y3P4eKfrcKowMz1HSAOQ 5jGbba+laAHOQ== Received: by mail-lf1-f51.google.com with SMTP id 2adb3069b0e04-4f3a873476bso5674739e87.1; Tue, 30 May 2023 15:49:05 -0700 (PDT) X-Gm-Message-State: AC+VfDwpoJGOdxTZ8XA8vlVzBQfijEJ9VNCptQXUCE6jrejVCzNpDoaQ h134rD0dAKXwn7A6qMP0dlOnBbBfKIh1jgzQeQQ= X-Google-Smtp-Source: ACHHUZ4bS0pN0vhbRQKYMialN1rGp+sHGugH3oihIijRD7zIcsyEyoMPZ5BwCJlvbUjzUrKdEXQxN6fKuKVldz1ZhpA= X-Received: by 2002:ac2:46d8:0:b0:4ea:fabb:4db1 with SMTP id p24-20020ac246d8000000b004eafabb4db1mr1442400lfo.1.1685486943732; Tue, 30 May 2023 15:49:03 -0700 (PDT) MIME-Version: 1.0 References: <20230526051529.3387103-1-song@kernel.org> In-Reply-To: From: Song Liu Date: Tue, 30 May 2023 15:48:51 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 0/3] Type aware module allocator To: Kent Overstreet Cc: linux-kernel@vger.kernel.org, bpf@vger.kernel.org, mcgrof@kernel.org, peterz@infradead.org, tglx@linutronix.de, x86@kernel.org, rppt@kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 29, 2023 at 11:25=E2=80=AFAM Kent Overstreet wrote: > > On Sat, May 27, 2023 at 10:58:37PM -0700, Song Liu wrote: > > 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= . > > Ok, I went back and read more thoroughly, I got this part wrong. The > actual interface is the mod_mem_type enum, not mod_alloc_params or > vmalloc_params. > > So this was my main complaint, but this actually looks ok now. > > It would be better to have those structs in a .c file, not the header > file - it looks like those are the public interface the way you have it. Thanks for this suggestion. It makes a lot of sense. But I am not quite sure how we can avoid putting it in the header yet. I will take a closer look. OTOH, if we plan to use Mike's new allocator to replace vmalloc, we probably don't need this part. > > > > The memory protection interface also needs to go, we've got a better > > > interface to model after (text_poke(), although that code needs work > > > too!). And the instruction fill features need a thorough justificatio= n > > > if they're to be included. > > > > I guess the first step to use text_poke() is to make it available on al= l > > archs? That doesn't seem easy to me. > > We just need a helper that either calls text_poke() or does the page > permission dance in a single place. AFAICT, we don't have a global text_poke() API yet. I can take a look into it (if it makes sense). > > If we do the same thing for other mod_mem_types, we could potentially > allow them to be shared on hugepages too. Yeah, that's part of the goal to extend the scope from executable to all types. Thanks, Song