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 12EEEC4332F for ; Sun, 13 Nov 2022 10:35:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5E6BE6B0071; Sun, 13 Nov 2022 05:35:13 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 597466B0072; Sun, 13 Nov 2022 05:35:13 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 45EDC6B0073; Sun, 13 Nov 2022 05:35:13 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 3256C6B0071 for ; Sun, 13 Nov 2022 05:35:13 -0500 (EST) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 0233B140181 for ; Sun, 13 Nov 2022 10:35:12 +0000 (UTC) X-FDA: 80128061706.02.D0DC824 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf02.hostedemail.com (Postfix) with ESMTP id 7DB1A80006 for ; Sun, 13 Nov 2022 10:35:12 +0000 (UTC) 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 ams.source.kernel.org (Postfix) with ESMTPS id D4038B80B0F; Sun, 13 Nov 2022 10:35:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 31849C433C1; Sun, 13 Nov 2022 10:35:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668335709; bh=ufCkQX6a3GW5pk9FkMMBMqawDJUa85eoEfD8vzO4vMw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=UjXeV1BC+cd+vWP5utBBqi51Hzk+ERy/zQ4o/9f3kKQTTxZ8p1RZOLxmxA7JRALKz L0t967TetfUDH04eKd7I/0nYZMkHkZ5zbpQb4umDT0bOmywxho2bmJapfhFM5aEKuv Qx6PIA5Lwoxfg6w2UtkN8TNskIQjYB+dDntT/jxJPiAaGb4vNI2jKcCBdIfgVoZMF+ DETWge3vu42K7zVmOxfjsjVEPgpAfsN3k3SIE3hYO4CTh/z3QkLPIjIz6/A+B+OTH8 Rtzy3ztHaRUSLFb+h6MnSu5tLeDNI3faBZEY9CDFyE6j7pu4CIuppR7iYZIJhPdjsc DsXvrGdID2xLA== Date: Sun, 13 Nov 2022 12:34:54 +0200 From: Mike Rapoport To: "Edgecombe, Rick P" Cc: "peterz@infradead.org" , "bpf@vger.kernel.org" , "linux-mm@kvack.org" , "song@kernel.org" , "hch@lst.de" , "x86@kernel.org" , "akpm@linux-foundation.org" , "mcgrof@kernel.org" , "Lu, Aaron" Subject: Re: [PATCH bpf-next v2 0/5] execmem_alloc for BPF programs Message-ID: References: <20221107223921.3451913-1-song@kernel.org> <9e59a4e8b6f071cf380b9843cdf1e9160f798255.camel@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1668335712; a=rsa-sha256; cv=none; b=g/bahWoDjdXLR8ViE6nS1f40xPPcQ76SfLY2WTIjqzgVhFovmw1+BrJERzd3igEYy6nh0K r2vS8YjbBx1K9+Lq2+MbnPkpnia3A13ZdePtxB1HmsVEpD2akg0735/QGhOsF0URi2HEr5 ML7J0PZKfF1PnzB/4rv0F/mnp8R3vB4= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=UjXeV1BC; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf02.hostedemail.com: domain of rppt@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=rppt@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1668335712; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ADpIuoyAV7ZpsXhqV3fgOoPpVc8iixLOsE2xFEYz4do=; b=L4VTptjZpCjC3hh1KkwrOMinEIrbG9aWEWEBuo227tmQvYpurrYEvLIFfwuVtATSJbMtWC 8T+RJc7MeqieX2umhQCArm6asDpmDraTdHde33IZbk0Vi4FEE+r+Lcr9VtKWwFEn7JgBy8 WkI5xzpDKucQwjUorcrBBW9YtVR5oTw= X-Rspamd-Queue-Id: 7DB1A80006 X-Rspam-User: Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=UjXeV1BC; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf02.hostedemail.com: domain of rppt@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=rppt@kernel.org X-Rspamd-Server: rspam06 X-Stat-Signature: gjeu1o5gyocxfxycfer1wj4yqn3wngcs X-HE-Tag: 1668335712-825637 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 Wed, Nov 09, 2022 at 05:04:25PM +0000, Edgecombe, Rick P wrote: > On Wed, 2022-11-09 at 13:17 +0200, Mike Rapoport wrote: > > On Tue, Nov 08, 2022 at 04:51:12PM +0000, Edgecombe, Rick P wrote: > > > How the caching of large pages in vmalloc can be made useful for use > > cases like secretmem and PKS? > > This part is easy I think. If we had an unmapped page allocator it > could just feed this. The unmapped page allocator could be used by anything that needs non-default permissions in the direct map and knows how to map the pages elsewhere. E.g it would have been a oneliner to switch x86::module_alloc() to use unmapped allocations. But ... > Do you have any idea when you might pick up that stuff again? ... unfortunately I don't see it happening anytime soon. > To answer my own question, I think a good first step would be to make > the interface also work for non-text_poke() so it could really be cross > arch, then use it for everything except modules. The benefit to the > other arch's at that point is centralized handling of loading text. My concern is that the proposed execmem_alloc() cannot be used for centralized handling of loading text. I'm not familiar enough with modules/ftrace/kprobes/BPF to clearly identify the potential caveats, but my gut feeling is that the proposed execmem_alloc() won't be an improvement but rather a hindrance for moving to centralized handling of loading text. It feels to me that a lot of ground work is needed to get to the point where we can use centralized handling of loading text. -- Sincerely yours, Mike.