Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp3205238pxy; Sun, 25 Apr 2021 17:32:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyK7dF5oAuS3ExluO0kDsirqh7kmBgPlc8XGptcrUkGPVk14yyzQ9yr2MYvOf+NVLUPmhL8 X-Received: by 2002:a17:90a:8c86:: with SMTP id b6mr19388243pjo.73.1619397145847; Sun, 25 Apr 2021 17:32:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619397145; cv=none; d=google.com; s=arc-20160816; b=hqhT/mtTeiTUhs0o+/AaZFFLHa0AXBmGN8zOreKrqf+lSje3MYHW3zIXex2c4cfB/h kG9FfDsL8wHhBTSR3T5fZWAJ0dXWU2yC+ehHzlPXL+6V7vAenQE8eXP/rlf7a9f/eVBh SwtEjD7r2gv53EpQeHry6pajKZAvhDbSIdcdU0RbLxDcbHn7ERwdUigxs2hjifFsa02f TLgTu2Mvh6s36KKaBIU/7CAryNejgSeGm05uIa9iOiUKqmUNef4o+TkuOASUJ7WEnmwK OsdPUweKuS4ZaEonsRji/r3qq+0jQ0dDTdOIbfFzDDB9FCYY6Z2cUxFbxf4Hos0QUJVl bntg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=xiJzJOLdknIj0RBYTk/1dN6htHjhW+TONZdztDGFbBU=; b=fB5Js+SF2mFor6yiHQ1reDDQhZsNRTJ8RUz1h6K7rOTbyfQaWjsMHifjsaX3LUkFMe WzOV209ha9d7AUjPh3QrdIk9pnU2IF0Zw85SXFXUq2+60PigpPlFNW3I9jJ897zEt/Y2 C594s8qJT5fGSCQSYEGqZswm6+UDcqfalf2AbmKao/LntRz+SufpN50clMB/ony/j6KE jh/I52W31vjVWBlt+T/vkulDbeCnWzzPiGfAt3w4l+Wil6Bgc4L/4VvZRsilNca3jfai rrjJhont4rFc4Hvvwtm1+yfE/++j2UyT6o9Qil4jwbDNGzlAaZwQdwhtw49h9rrpMwcL exNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Jdq7oZq6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s14si14607719plg.300.2021.04.25.17.32.13; Sun, 25 Apr 2021 17:32:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Jdq7oZq6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231482AbhDZAcW (ORCPT + 99 others); Sun, 25 Apr 2021 20:32:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231247AbhDZAcV (ORCPT ); Sun, 25 Apr 2021 20:32:21 -0400 Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [IPv6:2a00:1450:4864:20::233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0671FC06138B for ; Sun, 25 Apr 2021 17:31:38 -0700 (PDT) Received: by mail-lj1-x233.google.com with SMTP id a36so51192512ljq.8 for ; Sun, 25 Apr 2021 17:31:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xiJzJOLdknIj0RBYTk/1dN6htHjhW+TONZdztDGFbBU=; b=Jdq7oZq6fxDOqg46MRmtQhPd4SrRlEoVknjUuOCN8BcuzP0XNt6vzVqFCgtk1RQnDo aoNcId528WptBW8I/GRW0hTa2aXzAWWFwChG0KT+nxIMCls5G27DWJ1JE6OnT+o+2yLV aQqNBLsysaitWjvDbKKJq91G8PTL4sGca2FUlg4KbpmK5vpAvTqmOQ/bOFj6yLDG/9mg xjcfvDF0r9YdV+2/oWeKiDvthYWFkTUor+1dsPncf5EHnm3RR1SVKQAGE8Nxv0eVODnN kn5XxNw2deklLmJjDafIhLdW0X2KtTmQhB1X51MPIrl0AaDBNZ16CsRhDmLQ7Rh7W3o8 lesQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=xiJzJOLdknIj0RBYTk/1dN6htHjhW+TONZdztDGFbBU=; b=OBjw57PBk6av9ZpAMRXC59ldofcRtpwHwkk1trD0Q55FoLI1o7FTzil7tasa8gPksW 1Py4kO1YJ3EZk5Nm6w2iXHJSrqAosndFiHABNSJYSXLx7/kha9AvaXK8Jx6Wc5rClf8/ FpXzru/rx0+6gN+f8C5L7l2mN8PyXqvje2LITxU021Mu2viB6eZFDT30wJ7NeUaCuDTD S5+7SV0txjUFNoWg5df9bEzaY6KDwKaqIL6rqWshYt+PQKvhS0jBwi3nK6ikIDJyPBVp C0NP+MZtp0Jg65Tx3VAEn0jQc5kCHCDV3VRP0oR01fux4Rist4cI/thDkmYVGYMxQduC eCOQ== X-Gm-Message-State: AOAM530p8H2det+jxO5rVxJ6Ti6PyfyinuNP6jW51kXN1VpNivOCXsAY gpmzTh2RbmHYOV0IIfMilA5tgVaMvRPZ8EYvJj/rag== X-Received: by 2002:a2e:a54c:: with SMTP id e12mr11354812ljn.326.1619397097310; Sun, 25 Apr 2021 17:31:37 -0700 (PDT) MIME-Version: 1.0 References: <20210414184604.23473-1-ojeda@kernel.org> In-Reply-To: From: Linus Walleij Date: Mon, 26 Apr 2021 02:31:26 +0200 Message-ID: Subject: Re: [PATCH 00/13] [RFC] Rust support To: Miguel Ojeda Cc: Wedson Almeida Filho , Peter Zijlstra , Miguel Ojeda , Linus Torvalds , Greg Kroah-Hartman , rust-for-linux , linux-kbuild , Linux Doc Mailing List , linux-kernel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 22, 2021 at 11:29 PM Miguel Ojeda wrote: > > But as subsystem maintainer I'd like a clear picture of this wrapper > > overhead, what does it usually entail? A typical kernel API has > > vtable and a few variables, not much more than that. > > If you mean runtime-overhead, i.e. performance, it should be very > small or even zero. It should be possible to perform LTO across > languages too. > > If you mean source code overhead, or cognitive overhead, then it is > quite a bit, yes. Please see below. Yeah that is what I mean :) > I hear you! I do not think it will take decades for kernel developers > to get up to speed, but I agree that having some help/backup is a very > good idea in the beginning. > > Our hope is that, if Rust advantages prove themselves, then it will > the subsystem maintainers the ones that will want to create and > maintain the wrappers so that drivers in their tree are easier to > maintain and less prone to mistakes ;-) I am not really convinced that (leaf) drivers is where Rust will help most. As I mentioned in my mail to Wedson that I think things like network protocols that deal with abstract entities will have more "pure code" (not deal with machine registers, just RAM memory). File systems would be another example. I think the Rust proponents should be open to the fact that their work will eventually depend on themselves or someone else fixing a working compiler for the maintained architectures in the Linux kernel one way or the other, so they will be able to work with Rust project anywhere in the kernel. For example m68k is not going away. Avoiding this question of compiler support, just waiting and hoping that these old architectures will disappear is the wrong idea. The right idea is to recognize that LLVM and/or GCC Rust needs to support all these architectures so they can all use Rust. Someone needs to put in the effort. After all fixing that compiler support is an insignificant amount of work compared to what Rust in the core kernel will be. Yours, Linus Walleij