Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp4398420pxy; Tue, 27 Apr 2021 04:15:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz0QJmTLxdc1NafeswblrxwwwBUUjGmJRkaP2Md04mgi8+sHSBGUC5vJ/c19QUpq6sol4Ki X-Received: by 2002:a17:906:f8d9:: with SMTP id lh25mr4347901ejb.88.1619522115102; Tue, 27 Apr 2021 04:15:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619522115; cv=none; d=google.com; s=arc-20160816; b=EUCR9wErT6aBol6+TDpstf6Tf/dazshzb7fQ+bU0vSa7SdPdqcJqr37+PDU1oGCZYX DzRdaZYkVvriXioxX9B0pVD7F1OASNJQYGmpK5CiJgY/6xh7vNu6s8iY+rI1U7XIDch2 I0cSrhclPZ5FdDvYBgk2hDUClmqZvCzn+vS9o0MU0/W+xGjRfnlcSNWNue94FYKjz2B6 cFwth78cgC6g4DhN2TIMpAs2vSdtWxhfsqyeYEe177B/WXR9D0rM/q+jfstNecqfAoeB dW1JCZmw134Lk4DZjbTr0cQcKnn9mflli9U8sdYFP/ZoWrkc9nm6iNhDjhSUYlSd3j30 StYQ== 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=+6WzqLyiZKhKSJY8jYMrMfFwc4Ih1W7DjlWwozGabCA=; b=zR13dYPWGFIOe1AQeoy3II8QGA3Fvz7IPRlBnNO1UBaGOAvxC5QhBsbJ1vcJ0yG6pY mqGiqdfXJQA3lfTiG7DWXI0E9Cx5NRymx6fSl63b9n2b/GSTlvpjArYwh5XO4/BntAyF FmKs7jU22csxkWtU7t5qWFWqICSgx+GvcpvPKpH7+/3GZ5bL0+14mz0oW8XwxlzPNTCO OId2DWrpz0jlftkhOId8qTeYNXe14mYubv7dYWQ/TSEIW3PLLD0PbhuG3L0wYduddSp6 DWdZQ6GhfwYCm++yliyKWQzSEipgDWWHyp0LvYTd0OpGOj4FadWRGsdHvTkSBOUfz2RH pTAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=q1CvhHPZ; 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 o10si2066466edc.254.2021.04.27.04.14.51; Tue, 27 Apr 2021 04:15:15 -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=q1CvhHPZ; 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 S235810AbhD0LOa (ORCPT + 99 others); Tue, 27 Apr 2021 07:14:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235097AbhD0LO2 (ORCPT ); Tue, 27 Apr 2021 07:14:28 -0400 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03C5AC06175F for ; Tue, 27 Apr 2021 04:13:44 -0700 (PDT) Received: by mail-lf1-x12e.google.com with SMTP id j4so53624204lfp.0 for ; Tue, 27 Apr 2021 04:13:44 -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=+6WzqLyiZKhKSJY8jYMrMfFwc4Ih1W7DjlWwozGabCA=; b=q1CvhHPZNPCzVXL+eN0+T90/rhrNDTEGeHe0B9InduoF98HXZ6LvqT0k/KkdpQhaed EYTaQylYZdyTkkqgz1fD49HC52aY9k9EJf4jB0FqIG89QyCOUF9XRzT+M++d0Cnb39Rh cERREkzpk5nPIwbUX2eUYtB75RizCNOSQ896EJJ2dNqVDg747j3Nn5a68phBMPu2GTcd chMdUwv/6hDnvWVYJsH1UkfAW8BtT/e+NlHC9v7cVHhQXItZQ5eWD5KtWIDlXvjhIDDs mLcouHkC4aPS0K3xk7ziJjNRwL5appkAd96MP7kBEHe92sm0TzjbPiTYodF3zQleS9mF FJkQ== 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=+6WzqLyiZKhKSJY8jYMrMfFwc4Ih1W7DjlWwozGabCA=; b=g1Qa8uS3iC/OedvKu8Q8hlwO/K8FKZmND8fuz7CC0XPaQv1Kve7XmDqjZvzLzmzjI8 2PBBFB3GWYlTEq/JzH8Hjkb3LYlOh+dWiXhxq/5XLLRNkUL4/crGZrku+TMg4L9ymGJ8 qIp11J4yUFt7gpPxOMc/c8wbULrgUNfK1h5UQw9thM4ZAKIs7cyIIadIvw8Onw/LJbQP VqvAG0lR/XiU0PZ94cYlWpIPXHtKR/3RSsP7reYgkDs4Xb17MU0bS+uOtyy10cqOqHqM rUPLJIR+7b0bVPLgRmDuTz46wOkJe9bkERvbqrbzCosK3oUs/epA8KX6aNXzO2YOkqGl rNfA== X-Gm-Message-State: AOAM530LJ8Z6Ax04TicZYUHSGQRheDGAa5WP5lxox7t4qk+908+KUXhX dqaXkyqKhbYTzAZCzyvXYgR8OUKtGCiSC1O7R7PknA== X-Received: by 2002:a19:c218:: with SMTP id l24mr16789090lfc.529.1619522022816; Tue, 27 Apr 2021 04:13:42 -0700 (PDT) MIME-Version: 1.0 References: <20210414184604.23473-1-ojeda@kernel.org> In-Reply-To: From: Linus Walleij Date: Tue, 27 Apr 2021 13:13:31 +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 Mon, Apr 26, 2021 at 8:18 PM Miguel Ojeda wrote: > On Mon, Apr 26, 2021 at 2:31 AM Linus Walleij wrote: > > > > 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. > > The RFC does not avoid the question -- please note it explicitly > mentions the architecture/platform support issue and the current > dependency on LLVM, as well as the possible ways to solve it. OK true. Sorry for being sloppy. Actually my reply to Wedson brought up a new issue, which is the quality of learning resources and the lack of an equivalent to The C Programming Language book. > But even if we did not have the issue today, it seems like starting > with drivers and other "leaf" modules is a better approach. There are > several reasons: > > - If for reason reason we wanted to remove Rust from the kernel, > then it would be easier to do so if only "leaf" bits had been written. > > - We cannot compile the Rust support without nightly features yet, > so it does not seem wise to make it a hard requirement right away. > > - Kernel developers need time to learn a bit of Rust, thus writing > subsystems or core pieces of the kernel in Rust would mean less people > can understand them. > > Given that drivers are a big part of the new code introduced every > release, that they are "leaf" modules and that in some cases they are > only intended to be used with a given architecture, they seem like a > good starting point. I'm not sure I agree with this. I think a good starting point would be to either fix Rust support in GCC or implement some more important ISAs in LLVM, whichever is easiest. I don't mind having just *one* compiler but I mind having *a* compiler for every arch we support. The situation for LLVM is very well described in the Wikipedia entry for LLVM: "but most of this hardware is mostly obsolete, and LLVM developers decided the support and maintenance costs were no longer justified" - this is what I would call deprecationism (deletionism). I think this is a detrimental force for both compilers and kernels. It encourages developers of compilers and kernels to do the wrong thing: instead of rewriting their compiler and kernel infrastructure such that maintenance of older ISAs and architectures becomes a bliss they do what mathematicians do "let's assume a simpler version of the problem". And this results in a less versatile infrastructure and less adaptable code in the end. Which will affect how agile and adaptive the software is. And when something new comes along it hits you in the head. Portability to old systems and ISAs is a virtue in itself because of the effect it has on code quality, not necessarily for the support itself. Deprecationism is more the side effect of a certain business strategy to toss new technology out every quarter without having to care about aftermarket or postmarket too much. This irritates people to the extent that there is now even a project called "PostmarketOS" (Linux based). It is not sustainable to use an emotional argument, but that is really not my point, I care about code quality and diversity of ISAs and target systems improves code quality in my book. I might be an extremist, but I do need to state this point. Yours, Linus Walleij