Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp6442402rwr; Tue, 9 May 2023 15:35:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7f11zsgZU15w6ss6exnPyM2pfCMtp5y+SKHuH5Etz3yyEIOq2uGRoShy6KSJA+7IAWlIDe X-Received: by 2002:a05:6a21:9982:b0:ff:f9fc:52a0 with SMTP id ve2-20020a056a21998200b000fff9fc52a0mr13562685pzb.4.1683671748269; Tue, 09 May 2023 15:35:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683671748; cv=none; d=google.com; s=arc-20160816; b=cfNq0uuJCFAFcG4ItgtHY9Ri0lfJ/cHd/AxQtMShgQtvFaJMQIAaOyyKZRqDvI2HiZ iEhZ7SGQUZg6saXm2v1wtLGycyXNeYRQ9q+cOV30q/eyfpWPdmqxHpNa0sVglKyuA8On YssNeZrk+uvuo6CbmYJY4fj4CSR65rOoeHoch9X1mMkeP0ppQ1LMLDSMzkkIfu4tastu BCuytiNb4zu6HR1J0JTbtsMDBc5f1kS4mXXYJq4DHMMFg3K+IuhmsjJwQ5isoEBjnvnf fn9uCJ/DwHmpSd1KGi0k0MM55X8z4sFReZv3JxqrxHpb0nozUyK8Cy349vDwPC6oEjW5 OWRw== 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:dkim-signature:date; bh=1n3YMxW+Zb7xSLAr/eeZIRD4PtBRt8sxu+5EqSQhpSY=; b=HqxJabOr5XGbhZoI97QkXj/RZdIEiwFLm4rQ8p1IzbctUmuERiZDhja8Fse6bW4KOY rO7Tj5OZ28LmWxXfa5wr3H1rqLI9yhIjqhEnCEjdkW/XDn3nu5w0hit9sQQqPpLfkxeM t+6qj0irUTEOKUxUIPKGeb+Nl/FZRlJgn2ByxAiJb+y9mKMtf9gejRqEoZchuCSp1oHU 74LCGFtKJgn+V2i5FZJxQWrHNALCkqw2DJPJcxsBQ6KY8ARs74ajIfY3oJ+ZDZKRqjYh g2MCTixsnfzoSuWsIINroG9LIMbbbcFoFCE0PrUO7SElG28sYejcInOsrpTgO54vj/P6 mzvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=DnM8qOme; 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=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v11-20020a637a0b000000b00524ecfa05d8si2704173pgc.15.2023.05.09.15.35.34; Tue, 09 May 2023 15:35:48 -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=@linux.dev header.s=key1 header.b=DnM8qOme; 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=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230096AbjEIVye (ORCPT + 99 others); Tue, 9 May 2023 17:54:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229664AbjEIVyd (ORCPT ); Tue, 9 May 2023 17:54:33 -0400 Received: from out-57.mta1.migadu.com (out-57.mta1.migadu.com [95.215.58.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 234D930CB for ; Tue, 9 May 2023 14:54:31 -0700 (PDT) Date: Tue, 9 May 2023 17:54:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1683669269; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=1n3YMxW+Zb7xSLAr/eeZIRD4PtBRt8sxu+5EqSQhpSY=; b=DnM8qOmeFjElK/7kmR9lrk8seVkOltc4T81yq9nzxwJ0tWrpzuZjphK0O0rFxUZuREoLjH 4BGrtcWLzxP0pNXP/Rrv20VFYXzZePCsv+ToELAp1vj4npjoYANBuaQ9qfSjDvpQsbPq+u I+IxdbTG3un3iPQvVU9g3Lw60JsigXg= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: "Darrick J. Wong" Cc: Lorenzo Stoakes , Christoph Hellwig , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-bcachefs@vger.kernel.org, Kent Overstreet , Andrew Morton , Uladzislau Rezki , linux-mm@kvack.org Subject: Re: [PATCH 07/32] mm: Bring back vmalloc_exec Message-ID: References: <20230509165657.1735798-1-kent.overstreet@linux.dev> <20230509165657.1735798-8-kent.overstreet@linux.dev> <20230509214319.GA858791@frogsfrogsfrogs> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230509214319.GA858791@frogsfrogsfrogs> X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Tue, May 09, 2023 at 02:43:19PM -0700, Darrick J. Wong wrote: > On Tue, May 09, 2023 at 02:12:41PM -0700, Lorenzo Stoakes wrote: > > On Tue, May 09, 2023 at 01:46:09PM -0700, Christoph Hellwig wrote: > > > On Tue, May 09, 2023 at 12:56:32PM -0400, Kent Overstreet wrote: > > > > From: Kent Overstreet > > > > > > > > This is needed for bcachefs, which dynamically generates per-btree node > > > > unpack functions. > > > > > > No, we will never add back a way for random code allocating executable > > > memory in kernel space. > > > > Yeah I think I glossed over this aspect a bit as it looks ostensibly like simply > > reinstating a helper function because the code is now used in more than one > > place (at lsf/mm so a little distracted :) > > > > But it being exported is a problem. Perhaps there's another way of acheving the > > same aim without having to do so? > > I already trolled Kent with this on IRC, but for the parts of bcachefs > that want better assembly code than whatever gcc generates from the C > source, could you compile code to BPF and then let the BPF JIT engines > turn that into machine code for you? It's an intriguing idea, but it'd be a _lot_ of work and this is old code that's never had a single bug - I'm not in a hurry to rewrite it. And there would still be the issue that we've still got lots of little unpack functions that go with other tables; we can't just burn a full page per unpack function, that would waste way too much memory, and if we put them together then we're stuck writing a whole nother allocator - nope, and then we're also mucking with the memory layout of the data structures used in the very hottest paths in the filesystem - I'm very wary of introducing performance regressions there. I think it'd be much more practical to find some way of making vmalloc_exec() more palatable. What are the exact concerns?