Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp8177234rwd; Tue, 20 Jun 2023 11:12:26 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ45qK110tJl+G8S1JRMPApUSmVorKLygiZDnbJTAvEiQsCpnlCgTuiC5JygYuGwdUfBqvnz X-Received: by 2002:a17:90a:8a82:b0:25b:e0fb:1b22 with SMTP id x2-20020a17090a8a8200b0025be0fb1b22mr11889595pjn.33.1687284746485; Tue, 20 Jun 2023 11:12:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687284746; cv=none; d=google.com; s=arc-20160816; b=uqphd6fJB4LGRpsfiCoTsxALO3fEfGPciinaIpwzcrl1uIumC3y7GDMHyqlHYuYcXs shMGf9QWlooOWA1NreCtHXC1XEebbtRHF1YS0Jif6byM3On18Zezz/o1lfEy4oEz3sez Rh3FeJ8TqTSPLqRWV7fslpJFz05BkH3WjaI1QM8L7OIfa8LoVzfze7scPegTz0SHYt5o THUFO4aEkfH/9bMAL1A4vhgdkgJ7I74FUDHyqrl4O78xMm3t2RNJIh/tBqKL6UcDu4DQ dhgSsegobblmsMPoKju1e4C16W2qBCzlAoL/hvQMt04qn2s+zwiWiJFTZMu8wC+N8FHu tBMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:date:references:in-reply-to :message-id:mime-version:user-agent:feedback-id:dkim-signature; bh=sqKIvdO7nVnlhCbqbh7S6lEAiP1IQFwOtiZgfs6HSR8=; b=icfVVcL/0P1W2E3v0x+f3SD7+AsfF3YOOc9cdDghL0mb89naHocOvE17mg3/obXM1O RlOB5PE8ziNJvoC7KACiyK1GpVg0JpdgHr76jVkNYfcZ4fULPS9IJ7LgPCwVF1/gI0uO 1ksI4p8PMJHT/RM60Omf0m01M8G1OtVp1skQY788uXvlTxcQ8A6SJYEqHFLM90u6eXuN tirZhxsHfXava1qGguwYTCRrqNU6rOcV9xXVQBc7fnqycF7616ru6nRR4hrpfGKu0yTL ETLC7vfwiQap+fzSvJS5QAvVAI/GqAphx/AsyM7ZGkKglWXVTiZV94o04XkQZOX4w8gz DVwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=s9339xQy; 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 bx8-20020a17090af48800b00250a6b87c76si2397837pjb.142.2023.06.20.11.12.11; Tue, 20 Jun 2023 11:12:26 -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=s9339xQy; 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 S229920AbjFTRm3 (ORCPT + 99 others); Tue, 20 Jun 2023 13:42:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229538AbjFTRm1 (ORCPT ); Tue, 20 Jun 2023 13:42:27 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2B5F10F8; Tue, 20 Jun 2023 10:42:26 -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) server-digest SHA256) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8464061347; Tue, 20 Jun 2023 17:42:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 47344C433C0; Tue, 20 Jun 2023 17:42:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687282945; bh=HqPSWIaowE4nj5clj2k3JH4V3AbdDov4B8Rb4Patkfo=; h=In-Reply-To:References:Date:From:To:Cc:Subject:From; b=s9339xQyC0XBKYSx0zEQ4dFF/ahukeax3w/RKWqvx7TT7ZJ7GRStLt1BnylGu1Gam Fw4rsznAdu1fiSViLVt+OpO2XHctAYsz1uyYa/cqpHNsuHmtwpz4dxAE/R5Sc6gyF+ hZjVpSzhbWQQ/b+f7tOJ/usvDxSj09R99gxfklRToSZPVR3w466sG7kpO7cDKT0QAT SqA41wCiDuXRb1McOCqYoz+2IFjfv5x8AsKFF0Y6oQBLQh4oIXwN6tzhIvHEEi6a8I zAspRdgqXHatVMKHs6T8ISpg90hOsS5aIaqikisTvWksXpKhoeolozwTPp1t3VX49G 6EIsTI2sFKAEA== Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailauth.nyi.internal (Postfix) with ESMTP id 3A59727C0054; Tue, 20 Jun 2023 13:42:24 -0400 (EDT) Received: from imap48 ([10.202.2.98]) by compute3.internal (MEProxy); Tue, 20 Jun 2023 13:42:24 -0400 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrgeefhedgleehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedftehn ugihucfnuhhtohhmihhrshhkihdfuceolhhuthhosehkvghrnhgvlhdrohhrgheqnecugg ftrfgrthhtvghrnhepvdfhuedvtdfhudffhfekkefftefghfeltdelgeffteehueegjeff udehgfetiefhnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homheprghnugihodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdduudeiudek heeifedvqddvieefudeiiedtkedqlhhuthhopeepkhgvrhhnvghlrdhorhhgsehlihhnuh igrdhluhhtohdruhhs X-ME-Proxy: Feedback-ID: ieff94742:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id B26A831A0063; Tue, 20 Jun 2023 13:42:23 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-499-gf27bbf33e2-fm-20230619.001-gf27bbf33 Mime-Version: 1.0 Message-Id: <5ef2246b-9fe5-4206-acf0-0ce1f4469e6c@app.fastmail.com> In-Reply-To: <20230619191740.2qmlza3inwycljih@moria.home.lan> References: <20230509165657.1735798-1-kent.overstreet@linux.dev> <20230509165657.1735798-8-kent.overstreet@linux.dev> <20230619104717.3jvy77y3quou46u3@moria.home.lan> <20230619191740.2qmlza3inwycljih@moria.home.lan> Date: Tue, 20 Jun 2023 10:42:02 -0700 From: "Andy Lutomirski" To: "Kent Overstreet" , "Mark Rutland" Cc: "Linux Kernel Mailing List" , linux-fsdevel@vger.kernel.org, "linux-bcachefs@vger.kernel.org" , "Kent Overstreet" , "Andrew Morton" , "Uladzislau Rezki" , "hch@infradead.org" , linux-mm@kvack.org, "Kees Cook" , "the arch/x86 maintainers" Subject: Re: [PATCH 07/32] mm: Bring back vmalloc_exec Content-Type: text/plain X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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:17 PM, Kent Overstreet wrote: > On Mon, Jun 19, 2023 at 01:47:18PM +0100, Mark Rutland wrote: >> 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. > > I know you're not trying to be adversarial, but vague negative feedback > _is_ hostile, because productive technical discussions can't happen > without specifics and you're putting all the onus on the other person to > make that happen. I'm sorry, but this isn't how correct code gets written, and this isn't how at least x86 maintenance operates. Code is either correct, and comes with an explanation as to how it is correct, or it doesn't go in. Saying that something is like BPF is not an explanation as to how it's correct. Saying that someone has not come up with the chain of events that causes a mere violation of architecture rules to actual incorrect execution is not an explanation as to how something is correct. So, without intending any particular hostility: bcachefs's x86 JIT is: Nacked-by: Andy Lutomirski # for x86 This makes me sad, because I like bcachefs. But you can get it merged without worrying about my NAK by removing the x86 part. > > When you're raising an issue, try be specific - don't make people dig. > If you're unable to be specific, perhaps you're not the right person to > be raising the issue. > > I'm of course happy to answer questions that haven't already been asked. > > This code is pretty simple as JITs go. With the existing, vmalloc_exec() > based code, there aren't any fancy secondary mappings going on, so no > crazy cache coherency games, and no crazy syncronization issues to worry > about: the jit functions are protected by the per-btree-node locks. > > vmalloc_exec() isn't being upstreamed however, since people don't want > WX mappings. > > The infrastructure changes we need (and not just for bcachefs) are > - better executable memory allocation API, with support for sub-page > allocations: this is already being worked on, the prototype slab > allocator I posted is probably going to be the basis for part of this > > - an arch indepenendent version of text_poke(): we don't want user code > to be flipping page permissions to update text, text_poke() is the > proper API but it's x86 only. No one has volunteered for this yet. > text_poke() by itself is *not* the proper API, as discussed. It doesn't serialize adequately, even on x86. We have text_poke_sync() for that. --Andy