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 049D8EB64DA for ; Mon, 19 Jun 2023 12:47:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7A0428D0005; Mon, 19 Jun 2023 08:47:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 751168D0001; Mon, 19 Jun 2023 08:47:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 63EDE8D0005; Mon, 19 Jun 2023 08:47:29 -0400 (EDT) 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 47BA98D0001 for ; Mon, 19 Jun 2023 08:47:29 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 13120AFDE0 for ; Mon, 19 Jun 2023 12:47:29 +0000 (UTC) X-FDA: 80919473418.10.E5A5821 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf21.hostedemail.com (Postfix) with ESMTP id 4E7431C0006 for ; Mon, 19 Jun 2023 12:47:26 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf21.hostedemail.com: domain of mark.rutland@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=mark.rutland@arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1687178846; 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; bh=kpQGNnaKZlwiNXq1Vwv56/CTB+GxnA6Dr0uvahahy+c=; b=7lhAcIHmyYTzRnPopAsjN1v91q697GBCWGo0Jt+2o7zB+3jsHbRcw3M5/Bfh+IsqBSWMdX YDn05STHWCnPRCbT9MaLCaF32CZg5/vSKydOISU2qBr4WkNDlnAY1t63fkRI7euBYMU5wY yjrVm5NiKAjSy5szvIrNDjaGbPhe3x4= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf21.hostedemail.com: domain of mark.rutland@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=mark.rutland@arm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1687178846; a=rsa-sha256; cv=none; b=qw0ZbNa+IzVDe5uN32O9q/VqNbg0icSqUXJQnkTltH9d+udw0ZWiUj3CjfbMwi+4OD1udq O4f7sdcJU+yBA/VQZaCvymXqm3BgQtlUSjoJthbMktZdts6d72LEBmPQFz47dTcfKmb5ML kTnFeLRMR19Mg4SrQlsrWea8aJsAsZk= Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E311112FC; Mon, 19 Jun 2023 05:48:08 -0700 (PDT) Received: from FVFF77S0Q05N.cambridge.arm.com (FVFF77S0Q05N.cambridge.arm.com [10.1.36.163]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8FF033F64C; Mon, 19 Jun 2023 05:47:23 -0700 (PDT) Date: Mon, 19 Jun 2023 13:47:18 +0100 From: Mark Rutland To: Kent Overstreet Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-bcachefs@vger.kernel.org, Kent Overstreet , Andrew Morton , Uladzislau Rezki , Christoph Hellwig , linux-mm@kvack.org, Kees Cook , Andy Lutomirski 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> <20230619104717.3jvy77y3quou46u3@moria.home.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230619104717.3jvy77y3quou46u3@moria.home.lan> X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 4E7431C0006 X-Stat-Signature: pcgsr7hfk6h4rkaqu5r5p91ww1mbw55w X-HE-Tag: 1687178846-979408 X-HE-Meta: U2FsdGVkX19wz63V9+GOfzTOeTw3PkdT2OxuHzLx5D8xBF95ArjN0kE13eA0NeWkLMh/d54+lL5T+0zB6RC53JLWMJ/JkaBIaub9Ask8YPBT0xI/WzYM88ErVF71/L59U+aiYEYXK2JJ2keGbBM7t+2hojgwnXtTNdZC8KVv3iQLRkjLXGgf+jJ2XrZVh3NDH3kPpbLsmdqlSvOs6CA3jbxcVPGb0BkHvenoMTufw9aeYIx1QUtDXBBpo3pjIiwzy1HCUAIwUMLjWDNEVDpL9KlI9led/wR3tNBIZftaPcQG3tYCFLXwui7tvVkIOFN8XZH/o1tpMPi2lNclpmayYWYL1Ff66SiriJ8js1qlw1uT96zP7sp8Auu2pSX+9W9f0LqMw1yTc1tVKbkfnwuQ3ZqU5JMUkwo7O8taCrftmeJoZS1/WcAYFkCyb5hlUyyXAr74uPm4Ld3dHH8xA+jCpvntRFuX4rkf1PoOQa0mnl1NGD8Ny2EvmefsN6wXFm+uCDraIFVGIZ6JFAXFfhytWHU5tZOcZrokfUZUl7if5nkAIp9S0R/CSqMeNncoRi38iDgzXY1KBBEzmeZLsz0Dx4XWD9E66FW+IQMrN8MJYs1jYW7Ia+w048vVg93t8BMGKOFFGlGDJF1DAhV0f+8zMMSJqi4Gtp7sv7x/pZfJuvNoL15bMBEcWEQPPQ1uzq3tEV35xAw47+4tGnOR8M6Nzk/3SZDwtgcDA8o8S8rhzJAS1uvUYUGuhLkEcyGQCub0cSacLmR6O0n0yh5tszvu/0anTYVkTksvzb3UQ1G2cNE41f4dKbzybwwOjTgWXjZlXN1YX3+t1Zpw1Vp1WFOFeXGAy+L6D524JQWjDVIsAFeoLz7tRVa2oVrlt+cRWUtFqgWa2BXlhtEXzv6t6NX6p6/KO164d3KAh9rsU5kcjCRM/YYgV86tmtDW1644lj1ww4LZVdrj/EdTNqC6psI JqzJ0Jqo 8PCj9hJva74mQx2rc2viSuiV8V590SyW+nTb8Ey1t+Xg1Jtw+pS94hnDiUTIDd2w9htFW77UmxmGrokpLbwFz9dSIpYEBlNQFYaR1SGc9rbQO41a7DP9ca1XKCSRgANCMOXFatkoDCkElMxfwwUZ32i2ncW2OM/UGzj1yIgBkKqQ5i4P+JbHPv6iSmUyH1QJVoExYAaZq9W3IfL/uB7vhqVF4gq50zWRw6G66HGhpKuOhyoEwHiu9CAFuLc4QCIbDXH8PKQRng4uXuF0C1JOMgLH7DhA8MRd3wkXXO9jfaa6qRdN0G2CbNe739hg5X4Ke7w6Sq62y3kY9ByRu0BFGMEdYfrC/nnNuRVQ6FJfVhcC3C2/jeICnd3jQzlQ0P0/33uPp73Ue7OWaakUb3uRbo7j4ONxBY6VTxxwl/VZHRQBBv1mPBVeibBSn4dWMZDKnMSHAlN8ipTYRpannygqHzgDtHBQLxPc4ZvzT9WLfKBGF8Wj3CZt8lvBYLbKUKsQFIK+x 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 Mon, Jun 19, 2023 at 06:47:17AM -0400, Kent Overstreet wrote: > On Mon, Jun 19, 2023 at 10:19:00AM +0100, Mark Rutland 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. > > > > Much like Kees and Andy, I have concerns with adding new code generators to the > > kernel. Even ignoring the actual code generation, there are a bunch of subtle > > ordering/maintenance/synchronization concerns across architectures, and we > > already have a fair amount of pain with the existing cases. > > Look, jits are just not that unusual. I'm not going to be responding to > vague concerns that don't have any actual engineering rational. Sorry, but I do have an engineering rationale here: I want to make sure that this actually works, on architectures that I care about, and will be maintanable long-term. We've had a bunch of problems with other JITs ranging from JIT-local "we got the encoding wrong" to major kernel infrastructure changes like tasks RCU rude synchronization. I'm trying to figure out whether any of those are likely to apply and/or whether we should be refactoring other infrastructure for use here (e.g. the factoring the acutal instruction generation from arch code, or perhaps reusing eBPF so this can be arch-neutral). I appreciate that's not clear from my initial mail, but please don't jump straight to assuming I'm adversarial here. > > Can you share more detail on how you want to use this? > > > > From a quick scan of your gitweb for the bcachefs-for-upstream branch I > > couldn't spot the relevant patches. > > I've already written extensively in this thread. Sorry, I hadn't seen that. For the benefit of others, the codegen is at: https://lore.kernel.org/lkml/ZFq7JhrhyrMTNfd%2F@moria.home.lan/ https://evilpiepirate.org/git/bcachefs.git/tree/fs/bcachefs/bkey.c#n727 ... and the rationale is at: https://lore.kernel.org/lkml/ZF6HHRDeUWLNtuL7@moria.home.lan/ One thing I note mmediately is that HAVE_BCACHEFS_COMPILED_UNPACK seems to be x86-only. If this is important, that'll need some rework to either be arch-neutral or allow for arch-specific implementations. Thanks, Mark.