Message ID | 20231018160922.1018962-1-ojeda@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp4949950vqb; Wed, 18 Oct 2023 10:24:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFa/Lnt+dlsw4ZbqzJt4X4s8ZXL1+QCt7Ox9KlDMPD59+Mjx+9hLV1ZD4cd/u7UvXZoRNs9 X-Received: by 2002:a05:6a21:7891:b0:17b:5d5e:966 with SMTP id bf17-20020a056a21789100b0017b5d5e0966mr2233471pzc.14.1697649890285; Wed, 18 Oct 2023 10:24:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697649890; cv=none; d=google.com; s=arc-20160816; b=nV1rlefiF6w0o4KoATf7FirdGRst1NnivIPMmy6gogB4kwSBBwT9BPcCjgQ0jXEAvh BzW5JyEZRRv469vbJbX6Z8DgRYVfnqK7q8DRYenVpURaqzhSJIpO298sxCjuhxhd7c2R J5iN+QdBrPF+Xv6FqL2R9C9T+bpJKNerPrEQBes6LLMk+4zXtLq9SlpkaKrtNGexYZof CtHVjwDaa6ZyoN1L71+qfba0HolexzkGCYnlJ55/WdBJdmxc4DMgmxyGw8ds5X44fBKM ejmbrbzMSN/lDSH6QOqmE344vYW0wsoZYaStrr0sz/4eMo5Ox77MZJzpeqLRM4LB5aWZ Wn/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=VmEoCZhwFzef6ZX9mLoRT7tGNySAOSAkKOhHBms7U1c=; fh=z4m6wK0Tcg2AA8ntSG9JB0wEQG99j4WARRKuqDOXdqA=; b=qQa7/dHGstYSs6uY1iov1GzBD3QNynKM9C8P7NXst1vdxU9KK7o1rlAe7QZr6BF6rZ q+PVMqTd2bcssW84jyPJiU8UqbogXISVU8KJA/rWs57Dzys0xv5lZiYOWsoiZ3ngm93x N4J52tR/wHREW6z33xNGFCR8uGmGJ1a6q8u7HSi9iYEcTZnSfva2HO3aJHdiqErre97B c5ZkWs3ZlT0QUesZd3PEmpgseAXb1Ir1YULkywKOtqwxAG0kQVEUC4hQNxW36Gs/A5kR m1Rge18e2ic1MOdDdLzOskIUQNeteWI8P8MzBu52FaCrFGO71xcEAzEGf46LkLfxltB+ HZng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Z9CbGLM/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id q30-20020a638c5e000000b005ab45ee3e7esi2491109pgn.299.2023.10.18.10.24.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 10:24:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Z9CbGLM/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 0DB73802850F; Wed, 18 Oct 2023 10:24:48 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232412AbjJRRYX (ORCPT <rfc822;zwp10758@gmail.com> + 24 others); Wed, 18 Oct 2023 13:24:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232890AbjJRQJ5 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 18 Oct 2023 12:09:57 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7A76123 for <linux-kernel@vger.kernel.org>; Wed, 18 Oct 2023 09:09:40 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 919F0C433C8; Wed, 18 Oct 2023 16:09:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697645380; bh=NyxodQYdJN0bXaAwMa3qhqruplmUOckpXetLVK/mv+U=; h=From:To:Cc:Subject:Date:From; b=Z9CbGLM/xDgsJI+RiGEhkR5IrBIVA64HzatG1ofgD+AuTv2gqNlE0kqg16r/Trjml jQq0sGq/kL99bDSxXBM35tr6NoPr1/Jt3YLOjN2L/aA2Gnp80EWF1myFxMg52P83Ie +I0Emft9mPi98sXvu9/3n2bqwAZUBWtj7kXwZjACj5NzS52Aa8hIGiwf4UI1FC/61Y 0dNmxtR4mJgxZdpraU0Eionu9ocgLYTv50XxFxgGyjJjpEpPj6R/HF2RkeSjfojMHJ wYQvgZagwrQctELg/zCV0Rgr3bGqjo2NKELiph0xLGwSLZB45wwm7yJRS2g1R/cst0 Bw5sKw0UekQgQ== From: Miguel Ojeda <ojeda@kernel.org> To: Jonathan Corbet <corbet@lwn.net>, Miguel Ojeda <ojeda@kernel.org>, Wedson Almeida Filho <wedsonaf@gmail.com>, Alex Gaynor <alex.gaynor@gmail.com> Cc: Boqun Feng <boqun.feng@gmail.com>, Gary Guo <gary@garyguo.net>, =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= <bjorn3_gh@protonmail.com>, Benno Lossin <benno.lossin@proton.me>, Andreas Hindborg <a.hindborg@samsung.com>, Alice Ryhl <aliceryhl@google.com>, Andrew Lunn <andrew@lunn.ch>, linux-doc@vger.kernel.org, rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, patches@lists.linux.dev Subject: [PATCH] docs: rust: add "The Rust experiment" section Date: Wed, 18 Oct 2023 18:09:22 +0200 Message-ID: <20231018160922.1018962-1-ojeda@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 18 Oct 2023 10:24:48 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780111354989622597 X-GMAIL-MSGID: 1780114930908478709 |
Series |
docs: rust: add "The Rust experiment" section
|
|
Commit Message
Miguel Ojeda
Oct. 18, 2023, 4:09 p.m. UTC
Clarify that the Rust experiment is still going on to avoid
confusion for both kernel maintainers and end users.
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
---
Andrew: I did not add a `Suggested-by` just in case, but please let me know
if you want it, of course.
Documentation/rust/index.rst | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
base-commit: 94f6f0550c625fab1f373bb86a6669b45e9748b3
--
2.42.0
Comments
On Wed, Oct 18, 2023 at 6:41 PM Miguel Ojeda <miguel.ojeda.sandonis@gmail.com> wrote: > > We can add a note to the Kconfig symbol too -- would that be OK with you? Or do you mean you think the Quick Start guide would be a better place given that is perhaps more likely to be read by end users that want to just compile the kernel? If so, I am happy to move it there. Cheers, Miguel
On Wed, Oct 18, 2023 at 06:41:10PM +0200, Miguel Ojeda wrote: > On Wed, Oct 18, 2023 at 6:27 PM Andrew Lunn <andrew@lunn.ch> wrote: > > > > It very unlikely end users read this document. > > We can add a note to the Kconfig symbol too -- would that be OK with you? > > > And that statement is > > not limited to end users, it is true for everybody. > > Agreed, but that bit is meant to emphasize that end users do not have > a reason to use it at all (unlike kernel developers etc. from the > previous paragraph) > > > What we should be saying is that Rust for the Linux kernel in general > > is not ready for production use. Developing drivers in Rust is > > currently for experimentation only. Given the experimental nature of > > the work, there is some risk Rust will never be ready for production > > use. > > The risk is that Rust gets dropped from the kernel because it is not > used enough, not so much that there is a fundamental problem to solve > in order to reach production. I've talked to a small number of netdev developers, not many, but some. The general impression i get is that it is unclear what experimental actually means, and they have no idea what makes it not production ready. The two are also not necessarily mutually exclusive. To me, it appears Rust is not production ready because: You need to disable module versioning. You need to disable structure layout randomisation On X86, you need to disable X86_KERNEL_IBT and RETHUNK, both of which are part of the mitigation for speculative execution vulnerabilities So no vendor is going to release a kernel with these disabled. Networking also tends to be architecture independent, so production features need to run on X86, ARM, ARM64, and to a lesser extent MIPS, RISC-V, etc. I know this is documented, but it does not appear to be that well known within the networking community. Networking people also tend to be interested in endianness, does the code work on big endian as well as little endian? Big endian is dying out, but its not gone yet. However, with only x86 supported in mainline today, it does not seem possible to test big endian. I assume the rust type system will actually deal with this to a large extent? But are developers writing abstractions which are sound with respect to endianness? I think it would be good to describe the experiment a bit. With a multi year experiment, you often have short term goals and long term goals. What are these goals? What is the Rust for linux community trying to prove in the next few kernel cycles? What do you consider to be 4 or more cycles away? What do you consider not so important now because its not needed for your short term goals? That might also help developers understand when it will transition to production ready, but still be experimental. And you obviously need a disclaimer, Rust for Linux is a community, developers are free to scratch their own itch, so things might happen in a different order. And information like this might help get people involved, helping solve some of the limitations, spur research into different goals etc. Andrew
On 10/18/23 11:09, Miguel Ojeda wrote: > Clarify that the Rust experiment is still going on to avoid > confusion for both kernel maintainers and end users. > > Signed-off-by: Miguel Ojeda <ojeda@kernel.org> > --- > Andrew: I did not add a `Suggested-by` just in case, but please let me know > if you want it, of course. > > Documentation/rust/index.rst | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) > > diff --git a/Documentation/rust/index.rst b/Documentation/rust/index.rst > index e599be2cec9b..aaed36af15ce 100644 > --- a/Documentation/rust/index.rst > +++ b/Documentation/rust/index.rst > @@ -6,6 +6,23 @@ Rust > Documentation related to Rust within the kernel. To start using Rust > in the kernel, please read the quick-start.rst guide. > > + > +The Rust experiment > +------------------- > + > +The Rust support was merged in v6.1 into mainline in order to help in > +determining whether Rust as a language was suitable for the kernel, i.e. worth > +the tradeoffs. > + > +Currently, the Rust support is primarily intended for kernel developers and > +maintainers interested in the Rust support, so that they can start working on > +abstractions and drivers, as well as helping the development of infrastructure > +and tools. > + > +In particular, if you are an end user, please note that there are no in-tree > +drivers/modules suitable or intended for production use yet. > + Personally, I would rephrase this to: "Please note that, as an end user, there are currently no in-tree drivers or modules suitable or intended for production use." Also, I believe this should go here and not in Quick Start. The average end user, to whom this sentence seems to refer, typically begins his/her learning journey from the index page of our website. I think this will be helpful. Reviewed-by: Carlos Bilbao <carlos.bilbao@amd.com> > + > .. only:: rustdoc and html > > You can also browse `rustdoc documentation <rustdoc/kernel/index.html>`_. > > base-commit: 94f6f0550c625fab1f373bb86a6669b45e9748b3 > -- > 2.42.0 > Thanks, Carlos
On 10/20/23 10:00, Andrew Lunn wrote: > On Wed, Oct 18, 2023 at 06:41:10PM +0200, Miguel Ojeda wrote: >> On Wed, Oct 18, 2023 at 6:27 PM Andrew Lunn <andrew@lunn.ch> wrote: >>> >>> It very unlikely end users read this document. >> >> We can add a note to the Kconfig symbol too -- would that be OK with you? >> >>> And that statement is >>> not limited to end users, it is true for everybody. >> >> Agreed, but that bit is meant to emphasize that end users do not have >> a reason to use it at all (unlike kernel developers etc. from the >> previous paragraph) >> >>> What we should be saying is that Rust for the Linux kernel in general >>> is not ready for production use. Developing drivers in Rust is >>> currently for experimentation only. Given the experimental nature of >>> the work, there is some risk Rust will never be ready for production >>> use. >> >> The risk is that Rust gets dropped from the kernel because it is not >> used enough, not so much that there is a fundamental problem to solve >> in order to reach production. > > I've talked to a small number of netdev developers, not many, but > some. The general impression i get is that it is unclear what > experimental actually means, and they have no idea what makes it not > production ready. The two are also not necessarily mutually exclusive. > > To me, it appears Rust is not production ready because: > > You need to disable module versioning. > You need to disable structure layout randomisation > > On X86, you need to disable X86_KERNEL_IBT and RETHUNK, both of which > are part of the mitigation for speculative execution vulnerabilities > > So no vendor is going to release a kernel with these disabled. > > Networking also tends to be architecture independent, so production > features need to run on X86, ARM, ARM64, and to a lesser extent MIPS, > RISC-V, etc. I know this is documented, but it does not appear to be > that well known within the networking community. > > Networking people also tend to be interested in endianness, does the > code work on big endian as well as little endian? Big endian is dying > out, but its not gone yet. However, with only x86 supported in > mainline today, it does not seem possible to test big endian. I assume > the rust type system will actually deal with this to a large extent? > But are developers writing abstractions which are sound with respect > to endianness? > > I think it would be good to describe the experiment a bit. With a > multi year experiment, you often have short term goals and long term > goals. What are these goals? What is the Rust for linux community > trying to prove in the next few kernel cycles? What do you consider to > be 4 or more cycles away? What do you consider not so important now > because its not needed for your short term goals? That might also help > developers understand when it will transition to production ready, but > still be experimental. > > And you obviously need a disclaimer, Rust for Linux is a community, > developers are free to scratch their own itch, so things might happen > in a different order. And information like this might help get people > involved, helping solve some of the limitations, spur research into > different goals etc. > Points such as: - Clarifying the definition of 'experimental' and why Rust is not yet considered production-ready. - Providing insights into the short-term and long-term goals of the project. - Addressing concerns related to endianness. are indeed important aspects to consider, and documenting them would help. But that's not what this commit is about, and the index page is the last place to comment on such evolving topics. > Andrew > Thanks, Carlos
On Fri, Oct 20, 2023 at 5:00 PM Andrew Lunn <andrew@lunn.ch> wrote: > > I've talked to a small number of netdev developers, not many, but > some. Thanks Andrew, this is valuable information (also for the upcoming talk in netdevconf). We have been putting some of the meta-information you mention in our webpage instead, because it is easier to update (it is our `P:` field). We will do our best to keep expanding it in the future. Cheers, Miguel
On Mon, Oct 23, 2023 at 4:34 PM Carlos Bilbao <carlos.bilbao@amd.com> wrote: > > Personally, I would rephrase this to: > > "Please note that, as an end user, there are currently no in-tree drivers > or modules suitable or intended for production use." Yeah, I think the "yet" -> "currently" change helps, so I took it. I haven't changed the "if" to "as" because some readers are not really end users but kernel developers/maintainers, so I think it could be a bit confusing. > I think this will be helpful. > > Reviewed-by: Carlos Bilbao <carlos.bilbao@amd.com> Thanks! I have changed the paragraph to this, can I still use your `Reviewed-by`? If you are an end user, please note that there are currently no in-tree drivers/modules suitable or intended for production use, and that the Rust support is still in development/experimental, especially for certain kernel configurations. Cheers, Miguel
On 10/24/23 04:16, Miguel Ojeda wrote: > On Mon, Oct 23, 2023 at 4:34 PM Carlos Bilbao <carlos.bilbao@amd.com> wrote: >> >> Personally, I would rephrase this to: >> >> "Please note that, as an end user, there are currently no in-tree drivers >> or modules suitable or intended for production use." > > Yeah, I think the "yet" -> "currently" change helps, so I took it. I > haven't changed the "if" to "as" because some readers are not really > end users but kernel developers/maintainers, so I think it could be a > bit confusing. > >> I think this will be helpful. >> >> Reviewed-by: Carlos Bilbao <carlos.bilbao@amd.com> > > Thanks! I have changed the paragraph to this, can I still use your > `Reviewed-by`? Yes, that's perfect. > > If you are an end user, please note that there are currently no in-tree > drivers/modules suitable or intended for production use, and that the Rust > support is still in development/experimental, especially for certain kernel > configurations. > > Cheers, > Miguel Thanks, Carlos
On Wed, Oct 18, 2023 at 6:09 PM Miguel Ojeda <ojeda@kernel.org> wrote: > > Clarify that the Rust experiment is still going on to avoid > confusion for both kernel maintainers and end users. > > Signed-off-by: Miguel Ojeda <ojeda@kernel.org> Applied to `rust-next`, with the new paragraph -- thanks everyone! Cheers, Miguel
diff --git a/Documentation/rust/index.rst b/Documentation/rust/index.rst index e599be2cec9b..aaed36af15ce 100644 --- a/Documentation/rust/index.rst +++ b/Documentation/rust/index.rst @@ -6,6 +6,23 @@ Rust Documentation related to Rust within the kernel. To start using Rust in the kernel, please read the quick-start.rst guide. + +The Rust experiment +------------------- + +The Rust support was merged in v6.1 into mainline in order to help in +determining whether Rust as a language was suitable for the kernel, i.e. worth +the tradeoffs. + +Currently, the Rust support is primarily intended for kernel developers and +maintainers interested in the Rust support, so that they can start working on +abstractions and drivers, as well as helping the development of infrastructure +and tools. + +In particular, if you are an end user, please note that there are no in-tree +drivers/modules suitable or intended for production use yet. + + .. only:: rustdoc and html You can also browse `rustdoc documentation <rustdoc/kernel/index.html>`_.