Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp6541390rwd; Mon, 19 Jun 2023 08:39:11 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6QuZBcBP8cCEQb0hiK/4t/kgTlAiBV1xCJAW1nEYxYVqX6toEPRtQeEmFGGf8zTGA9fmYE X-Received: by 2002:a05:6a20:158b:b0:10e:e813:46ed with SMTP id h11-20020a056a20158b00b0010ee81346edmr13424719pzj.43.1687189151670; Mon, 19 Jun 2023 08:39:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687189151; cv=none; d=google.com; s=arc-20160816; b=e48dLW5FxmY04XrJpEd3wWXFYZSqYIK4HOMJiKT28Gc9rt9slIpYyLNbEtBGjR6o9k GC3amSpExxNOfdtJ4+LdlMpSwRcEVrjMGT4ZmCOuXKNLeQotbl1xjuAytlZhegHD2JkZ I/9VNAMpQrZEnQJ8qt7FOr5lCsLBrlTWylkSv5+vh2S/Vqd3O7hwdpopQgvBnnVRGRF2 S8BmV60UTBEsLucMcGeLEKAbo1OIHwi8qAUORJdoBQNd2bkrERdZiZMRxyrd5WFQuM/w /zE4x8oCIWNKq35Xhxx/HI7xrP82UgNB3f9mgBaDDQN4Ia3AG8I84+4tQYRw4fRhtFmQ 1qiA== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Ey2Ld+q1smAj2ko2DpEpecEw8SxrV0ghQXT269XkgBo=; b=Bl/iLrfYFeUadX4xncOQIn0jJKxOuxi6CxRv35xW44MViOYA/l5FlB/HfFWk7liffq dUEFYUjicxyBVJGGIWU5j+dqfeCWaqQbdQZvhbcDs/mg3EY1rSxDi7oZX8Y8tm9aYBTF GJGvTjoazZElFkjMGT8R8Ekr3dIokkYqqXpY38r2ye1dqAjiEHV9pZsS0Dfiq6/p+4HS KAGW8eXv+l4VwWtUchBnyoVTXezVlBuxHdRXWBTJtjwlxDCJpUjQQZ6DKfw71J3GbvQS pZeMWIZyzDSPpKOV9622E7J5VdTI56q2EfeAJdx9soBlH6rlTZv/OtFndAImm8G+jes1 0SmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kRzjt2nD; 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 p22-20020a637f56000000b0053fb69a6397si570673pgn.587.2023.06.19.08.38.55; Mon, 19 Jun 2023 08:39:11 -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=kRzjt2nD; 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 S231670AbjFSPYU (ORCPT + 99 others); Mon, 19 Jun 2023 11:24:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231223AbjFSPYT (ORCPT ); Mon, 19 Jun 2023 11:24:19 -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 74615F9; Mon, 19 Jun 2023 08:24:18 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0793460D33; Mon, 19 Jun 2023 15:24:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8AA4DC433C8; Mon, 19 Jun 2023 15:24:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687188257; bh=N4a6+AKTlpfQu+hNLgDTvYGemlpqgXPewbtXySTT2Wk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=kRzjt2nDIAl4X26ojRiB8w8CJVn45eTmiPbIYkIvDYRBR/QR7IVpfAXYd9FpfNQDQ OvemWMKmfnlcr5GwcS7TCX2oTJmzf2fUUsDJHf2Oq+4RHGmHWKbk0CASnuDz6Gk1Ld 1e26ENdIJqn1qjqL2vy8CRe3zudh+ZqjAZ7btzz+Jja4UEKxYRLaqjs+hNR8TPWi48 sYyUqJtdsNHbcbOzxo9zMe/AaYlu9nZhYjfHu5NSh21mKAk+otvslcioi5dkhxeNTF EnxnECqDbcsPkYZvvYUeyjGiH7IzMmaAIOnWvmMc+HuAd2WDWUtK2BFwEfTtd03m+J SY9K1sARFWi7g== Date: Mon, 19 Jun 2023 18:23:34 +0300 From: Mike Rapoport To: Thomas Gleixner Cc: linux-kernel@vger.kernel.org, Andrew Morton , Catalin Marinas , Christophe Leroy , "David S. Miller" , Dinh Nguyen , Heiko Carstens , Helge Deller , Huacai Chen , Kent Overstreet , Luis Chamberlain , Mark Rutland , Michael Ellerman , Nadav Amit , "Naveen N. Rao" , Palmer Dabbelt , Puranjay Mohan , Rick Edgecombe , Russell King , Song Liu , Steven Rostedt , Thomas Bogendoerfer , Will Deacon , bpf@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-modules@vger.kernel.org, linux-parisc@vger.kernel.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, netdev@vger.kernel.org, sparclinux@vger.kernel.org, x86@kernel.org Subject: Re: [PATCH v2 06/12] mm/execmem: introduce execmem_data_alloc() Message-ID: <20230619152334.GC52412@kernel.org> References: <20230616085038.4121892-1-rppt@kernel.org> <20230616085038.4121892-7-rppt@kernel.org> <87jzw0qu3s.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87jzw0qu3s.ffs@tglx> X-Spam-Status: No, score=-4.4 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 Mon, Jun 19, 2023 at 12:32:55AM +0200, Thomas Gleixner wrote: > Mike! > > Sorry for being late on this ... > > On Fri, Jun 16 2023 at 11:50, Mike Rapoport wrote: > > The fact that my suggestions had a 'mod_' namespace prefix does not make > any of my points moot. The prefix does not matter. What matters is what we are trying to abstract. Your suggestion is based of the memory used by modules. I'm abstracting address spaces for different types of executable and related memory. They are similar, yes, but they are not the same. The TEXT, INIT_TEXT and *_DATA do not match to what we have from arch POV. They have modules with text, rw data, ro data and ro after init data and the memory for the generated code. The memory for modules and memory for other users have different restrictions for their placement, so using a single TEXT type for them is semantically wrong. BPF and kprobes do not necessarily must be at the same address range as modules and init text does not differ from normal text. > Song did an extremly good job in abstracting things out, but you decided > to ditch his ground work instead of building on it and keeping the good > parts. That's beyond sad. Actually not. The core idea to describe address range suitable for code allocations with a structure and have arch code initialize this structure at boot and be done with it is the same. But I don't think vmalloc parameters belong there, they should be completely encapsulated in the allocator. Having fallback range named explicitly is IMO clearer than an array of address spaces. I accept your point that the structures describing ranges for different types should be unified and I've got carried away with making the wrappers to convert that structure to parameters to the core allocation function. I've chosen to define ranges as fields in the containing structure rather than enum with types and an array because I strongly feel that the callers should not care about these parameters. These parameters are defined by architecture and the callers should not need to know how each and every arch defines restrictions suitable for modules, bpf or kprobes. That's also the reason to have different names for API calls, exactly to avoid having alloc(KPROBES,...), alloc(BPF, ...), alloc(MODULES, ...) an so on. All in all, if I filter all the ranting, this boils down to having a unified structure for all the address ranges and passing this structure from the wrappers to the core alloc as is rather that translating it to separate parameters, with which I agree. > Thanks, > > tglx -- Sincerely yours, Mike.