Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1775559pxu; Thu, 17 Dec 2020 19:35:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJzl1gqtAYylkFYFoJ+O4t/Zy7uB3cUIFYnMHQieA1A8M5FlRBoUvqaQyeWxDUZXRIVzzFY7 X-Received: by 2002:a17:906:d146:: with SMTP id br6mr2018430ejb.331.1608262522516; Thu, 17 Dec 2020 19:35:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608262522; cv=none; d=google.com; s=arc-20160816; b=mXNVCC8xxXXdVOktqQkE67W9JTIhCMqvdvkn5Ngp3rNoPpZiFMp2M7y9gdlLctCtj0 4OCWy2nSB2IHuD2aj3AVHS8RpcVmQdnZqagE8U1DhAyyJ4N+aYyv7Y+8bdFm+xyqBZjF yi3YCSv9kn6jN32PPE6BnD2Zfy7pHVRHQWD3V9W4/+PBAFcwISB1+gFiFSCHhksVxwj4 olkxiMs68qWvoZQ6ziUkANyXDQpQgIk4PhPdRwJQ0oFriGf5mOM/vDNowNobt1j04xnQ KNf+eA3rZyzvdzC8F6XnrVuRw2wcbqZCsic51U/fPnLKpSTCCJNYUxYSyGh4z7M+fzZt 9rIA== 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=ThANl8keVovxssa+E4sSSWUNAQHe9R0+iBJSgPR0CjQ=; b=ifyy4MuKeT+WGeBaNouKX4RBejW0jbVJZ5g8L9fg2hab4U+xZrgpJVxgEsyrMuQxPQ diX7umsOmzAlMHvWLZJroNIHBOAxCd/+XlGct0hr7gxpNjvNpiIL570vwHFDqtbZr4NJ mwxLZoESBe80BaNCKgT67sXze6qNoSWPykGrzZvGC0lhqkqYQ4pEaIPEPHDuHTHM5q4h FRnCVDiZl5M3Uqv0VD5OWLNsKSyUnzCP9yQrEsOh8nh7pSoaNHTn34cUOP8C2/j3dudq Wm4MtOKbly6/KyI6ozjkweN00soBbz1r0f6/DZcXsQ3ZjJo0F4/cmJF43G2HZfsp12Yd eagg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BGDeqVqg; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h15si4520655ejq.383.2020.12.17.19.35.00; Thu, 17 Dec 2020 19:35:22 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=BGDeqVqg; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732299AbgLRDc3 (ORCPT + 99 others); Thu, 17 Dec 2020 22:32:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727234AbgLRDc3 (ORCPT ); Thu, 17 Dec 2020 22:32:29 -0500 Received: from mail-yb1-xb31.google.com (mail-yb1-xb31.google.com [IPv6:2607:f8b0:4864:20::b31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F20FFC0617A7 for ; Thu, 17 Dec 2020 19:31:48 -0800 (PST) Received: by mail-yb1-xb31.google.com with SMTP id x2so688286ybt.11 for ; Thu, 17 Dec 2020 19:31:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ThANl8keVovxssa+E4sSSWUNAQHe9R0+iBJSgPR0CjQ=; b=BGDeqVqg2cLTQpuTxvKjP3gI1MA/xd0DtKQcKLx4FK+dti4am/s0al9JZXeObimQEH FpKJ8PVzPwDmAkpsOF4KLpYEeVi/VfTlHCXtbTDC6YmEOxGHklwOg5u5mdT2kC1fZ66y 1akom9kaRqC2uctz9K9+JGJiQOcJkKtDpCl4JnpX8GTPSy3wlyO7rQCeFR378LDnX/sF MWOSuXFxTUrcVP2SJt+c8RYU5gyFeOpQOL3tNiVFvj1oa41q+wJ2gc5Rapnn6YUuZxuF 3eC12VSmOgcOdX/zjESdnveGmA8U1gUB1+bQ2tWAGHoVMsjwozsLkJwhW8LZj2n/9QMz 9flg== 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=ThANl8keVovxssa+E4sSSWUNAQHe9R0+iBJSgPR0CjQ=; b=A1sjt0peXpPfQwGyQmRrhMtKt6QJKtkz2gBj5HMUUqDIaQGp52bFRuvKQQbo5J3tQw Xb3tKLiQyOZeZ8jqydCjHJAwq0Rz3EqKMCQjlaLl7FSou1rDY3XQjie/w9nTcjDhn8oU QeRXHUxrM2uudLdit52vM30+VKfeG/H0gPwiswR5KxHoMAavc9a9oX8+xkZf0Su68crM cW0RpZukaLTdZuhLdVrQWAzx5gb1BRX0EWyj7cM2shcAa593pIG+ybAvr7We/vGNtV6n a8b8ePdTsSnYTudM91Tpwsu/q64li5xBbGa+pdfbPA+rvInGAnPk3cME9JvKYc0a1imk EghA== X-Gm-Message-State: AOAM531hhX2KlmUFsl1rwR0Z8OQczbzEAF5K/219qhHA5WAVAU9fzDXY OBzNJbptmu54rUkIU8X5McEitQqyj+unTm+9m00= X-Received: by 2002:a25:284:: with SMTP id 126mr3402389ybc.22.1608262307575; Thu, 17 Dec 2020 19:31:47 -0800 (PST) MIME-Version: 1.0 References: <20200710062803.GA1071395@kroah.com> <20200710125022.alry7wkymalmv3ge@wittgenstein> <20200710225934.GA16881@localhost> <20200711210317.GA60425@localhost> <20200728204037.GC1012@bug> <20200729063417.GD286933@localhost> <20201217214506.GD28574@duo.ucw.cz> In-Reply-To: <20201217214506.GD28574@duo.ucw.cz> From: Miguel Ojeda Date: Fri, 18 Dec 2020 04:31:36 +0100 Message-ID: Subject: Re: Linux kernel in-tree Rust support To: Pavel Machek Cc: Josh Triplett , Linus Torvalds , Christian Brauner , Nick Desaulniers , Alex Gaynor , Greg KH , Geoffrey Thomas , jbaublitz@redhat.com, Masahiro Yamada , Steven Rostedt , LKML , clang-built-linux , Kees Cook Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 17, 2020 at 10:45 PM Pavel Machek wrote: > > Well.. not everyone has 32 cores in their notebook. It is true that complex Rust, like complex C++, does have high compilation times. But it all depends on how much one relies on certain language features. Straightforward Rust code is quick to compile. For reference, some quick stats :-) On a given machine, building v5.10 with a minimal config under -j3 takes 3 minutes. With Rust support enabled and 4 trivial Rust modules, it takes 50 seconds more. "A big increase!", you may indeed claim, but those 50 seconds are basically all spent on the shared Rust support. The actual Rust modules compile very quickly afterwards. For example, touching either `drivers/char/mem.c` or one of the trivial Rust modules takes the same time in that machine: 10 seconds. This is for a minimal config -- when you start dealing with `allmodconfig` builds, or when you start having a hundred Rust modules instead of 4, the upfront cost becomes very small per Rust module. > Okay. I did some refactoring recently and I really wished kernel was > in Rust (and not in C)... so lets see what happens. Indeed, I think it is definitely worth it. Cheers, Miguel