Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp4770581rwl; Mon, 10 Apr 2023 17:01:03 -0700 (PDT) X-Google-Smtp-Source: AKy350YnTT5Xl1ODRkB92fNR+ZIUoPAU/yh6A/4vWOn2HKzWhvdGTk48EHtNgAn9/eHs5M2WvedW X-Received: by 2002:a17:902:d481:b0:19e:ab29:1ec2 with SMTP id c1-20020a170902d48100b0019eab291ec2mr16855545plg.65.1681171262701; Mon, 10 Apr 2023 17:01:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681171262; cv=none; d=google.com; s=arc-20160816; b=XPDsk/dCtyZmsHjjjK2mS41biy/+cqtbr/1NTcvGxwftbAvkbW9ridNtnm8mEshI2c dO6UbegxxqoFrzI94yaLfXynlyBEK9T7qbYFTxVor04o5bruC+nc/ffHtbmmZWWDZv3K UJPuG51SnQT3owWnHRnXjS9lK4creZ71SUOIRwbGPWLKQs9xFdLZXBKzz8r4R7VY8nr0 k3VKETUHO/gL0vX/Xivq+MBAzkjdmZtFXC0RbSg2qZz8K0WeZf1I6Fazx3dOvk0zSHDE XcHgKfb9mgbsiRKVMk6SZT/TCUbU55PRpW2ShNEd1J+aQbvRk58K/Cgp1sM7Y3zFZ42b lduA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=2wHFed80X0tDB7uZIMKZwq8AtXe8sVS2+RdD7BlqWJ0=; b=p3BWhLu3vBo8Jz2xhD0sCa8PfKDf/v9DqyB4+gfWl/FUthLrKiZ//62RbFj0ZODh/S Px6pRR1x+lW6QPi6T13F6Mk+mdpjubqhL29OQtHLKIvc8wNuTOoyIYaJ5l20oe50Rge1 xYTW8mvHwacoEWAHhH3iV0ZZ1A09Q5OmUypx0vooHy0hZvbLYSr27IypkzGQ3hHj6KaO UYNcrewSXpUaNPaxGDZQHLtnBkRmtj8HR8G413GCwoEKYsupeXHgcaSj6LznvgoaxJs8 thuZfy6ypx7jAI66JKgtZ+ImWXfhmtzaPpIit1ESoOirMmKIfy0QAKzaW8UIQiAOOJYG kDPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=NCUGnMiS; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b18-20020a170902d89200b001a0561c726dsi11821821plz.264.2023.04.10.17.00.49; Mon, 10 Apr 2023 17:01:02 -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=@gmail.com header.s=20210112 header.b=NCUGnMiS; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230087AbjDJXmB (ORCPT + 99 others); Mon, 10 Apr 2023 19:42:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229717AbjDJXmA (ORCPT ); Mon, 10 Apr 2023 19:42:00 -0400 Received: from mail-yb1-xb36.google.com (mail-yb1-xb36.google.com [IPv6:2607:f8b0:4864:20::b36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A00E01BC7; Mon, 10 Apr 2023 16:41:58 -0700 (PDT) Received: by mail-yb1-xb36.google.com with SMTP id z9so6304319ybs.9; Mon, 10 Apr 2023 16:41:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1681170118; x=1683762118; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=2wHFed80X0tDB7uZIMKZwq8AtXe8sVS2+RdD7BlqWJ0=; b=NCUGnMiSZ6pkOvrhy1awB8Mp0kC037Dn24U2kKhyGY5arhtIoF9JOwTtLLjDJ29ghK HYRyjAGHdHWiXtmvajuzgBLBiqilfiW793sO/A6iZ/X180NQHkynsurfdnKu05S3eDHm vr8oPf7qw2lSgtsiIyisxUEKfwMJTtOafdBFp8TpFUTqmjJvlPPnaGEaqSu9ntn+GgLk nsHbVPZbnZRciTdWSU5W3dObfxn5xnThdw3HGLL0iL0BynQ23ZltxCTxyOVRGcXLq5Nj aqIaU/8jC9dAl5X/0f99buX8CfzRYIFT9qUEIgYmUADWs4e8BILhiDprhpdZiCogWxyw BvFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681170118; x=1683762118; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2wHFed80X0tDB7uZIMKZwq8AtXe8sVS2+RdD7BlqWJ0=; b=79nF2l4ufsgDeuPOgJ5H+pCPIzPP5XEI8oOq9xPFqk3cwEfE8Uoz5rraMiLPWIShfp xzxs8pgLtPO6LPmSuNbWSw4PMq2OSW9AE9z65/C8z5zo18fhctyryR8jynJD1vP6sZfq yIbQYuH0AzQrRiz7KU+0isQWtv3E07bXKDKMULF/4ppWd6LLWB5BNL1vTMX2dFcZsHpV r6hua0PxRQUh9uk0T2kTKRF8uAugLYGsWKu8+kpgh8YLGgWVhqzhkGhjsymS5MKkeCNr DeJ+ts96iSEKQqZDbxd2PlXHW6J/K10X4WjDXYNdsFZX24josOpVsRtZSkvBFlIyXEyq fiLg== X-Gm-Message-State: AAQBX9cZ/xMK6hxM36uLf7S1Ef1UMYxWUOwIS8tPfUIt7ACshJQEEgGu fKUgdM1ouvhO2LXzW8ReuqRHAv3/Zj8zISOTOEQ= X-Received: by 2002:a25:e0d5:0:b0:b31:34ab:5ca0 with SMTP id x204-20020a25e0d5000000b00b3134ab5ca0mr4048180ybg.11.1681170117817; Mon, 10 Apr 2023 16:41:57 -0700 (PDT) MIME-Version: 1.0 References: <20230406215615.122099-1-daniel.almeida@collabora.com> <441a96cb-7dd1-0885-df64-933ebdb55e9e@selasky.org> <0ec4becd05c49e8f0bf214fbd62208ea67c2b4c3.camel@collabora.com> <6fc0a0c6-a7c9-5350-9b9e-1ea9dab568d0@selasky.org> In-Reply-To: <6fc0a0c6-a7c9-5350-9b9e-1ea9dab568d0@selasky.org> From: Miguel Ojeda Date: Tue, 11 Apr 2023 01:41:46 +0200 Message-ID: Subject: Re: [PATCH 0/6] Initial Rust V4L2 support To: Hans Petter Selasky Cc: Daniel Almeida , wedsonaf@gmail.com, ojeda@kernel.org, mchehab@kernel.org, hverkuil@xs4all.nl, rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, kernel@collabora.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, 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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 10, 2023 at 8:59=E2=80=AFPM Hans Petter Selasky wrote: > > Adding a dependency to build the Rust compiler even to build one or two > V4L2 device drivers, would mean a lot to my small hselasky/webcamd > project. It already has to fetch a copy of the Linux kernel, and now has > to bootstrap Rust from stage0 to stageN. I personally say no. It's like Do you mean you need to compile `rustc`? Could you please explain why? Could you use your distribution's, or fetch the standalone installers or cache your own toolchain? > XCode unfortunately. I download 100's of GBytes of upgrades to XCode, > and barely upload one millionth worth of code back to Apple. It's not > good. Software developers shouldn't have to download more stuff than > they upload? The Rust standalone installers are 2+ orders of magnitude lighter. > The definition of "bugs" may vary of course. I was thinking more like > stack exploits, missing validation of arrays and so on. The kernel definitely needs to avoid those. What do you mean? > I must admit I'm not a Rust guy and don't see the advantages of Rust > like you do. The advantages are fairly clear. The question has always been whether the cost is worth those benefits. > Why not move Linux-V4L2 drivers to user-space? In my opinion Rust is > much more easy to get going there than at the kernel level. That sounds like an orthogonal discussion. In any case, please note that you would need to install the same Rust toolchain to compile them in userspace. So, if you are concerned about the size of the toolchain (as you mention above), it would not really make a difference. > Rust is slow based on my observations building Firefox from sources. The > Rust compiler spends a significant amount of time per source file. It is slower than compiling C, but it also provides more features, so it seems fair for what we are getting in exchange. Cheers, Miguel