Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1993295lql; Wed, 13 Mar 2024 14:12:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWGdu0IYwmtyTbPOyZ9mHyaKeQy5kRg6vuQMDJC/5eXHttgc6zMp+HxgTfJGlJE1NzYITHB6pp5cym44YVnP2LW2LKln2syCfXz6218Vw== X-Google-Smtp-Source: AGHT+IEp2z8Z3JzkHtkasWkivZFEMQ2IzRDgJ136FKgj3nwrpVO39Rvc3bdsaI7q+5QWTnCBLCRO X-Received: by 2002:a17:903:40c3:b0:1dc:bb8e:d28f with SMTP id t3-20020a17090340c300b001dcbb8ed28fmr13625919pld.66.1710364366805; Wed, 13 Mar 2024 14:12:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710364366; cv=pass; d=google.com; s=arc-20160816; b=ObhH1FoLelbUKXiVhFMm0Yd7Q361b95mubNU3bthU4EJsTP/iinCBmWcXB65n93lg3 3+xs6mEwb70bqC4HnJS3DpEAMqDDCzsA8qG9o7Si7Hi0tCiz1ZzCVbv95lSJ27Thev++ DEBmWhExrQHY3g5ZqdRQjRNEa7XNszSHVxGAUtCt7udvGkKKZFkCbG6YCZwi2Dt4ij2s V2G7culMfWNJ/m48WhaC+H0fEi5ldxmOxeC8OPUPQbg/lyNeifA1sGPjdDahXISUt7w1 tvh38WozuwnrKrt9xAimPixMS404d2LyVjCjPCSHDd9MKD0AoQS1O79j9vCbmUM2oDY+ nZiQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:user-agent:references:in-reply-to:subject:cc:to :from:dkim-signature; bh=z0czGQahQJmLOhb1t7D6nFie7YcEp1Eo0BOuwVvzqhY=; fh=daR+4eNGNjgunoEfkYrkWqkqMnEvMkXglTWG/QATeV8=; b=zxO+Zbwmvk6RGWS73S0rkBR7T8q0x0K10A6TXqO0DVc2JVzs1MHI6vJvTRkMx2Q1j3 pXNsyj8YjcyuHKOCzXe/fS/liVOlxbMQwIu6pky3fK8ybyE9roW+b7nxxbsBgGzM+zi5 5NGmdwvvUrJ+fNEiiVZZCW9zpZFbn+bxQb4V++TBqN+RpRCAhHDBqH+FzlxI0udvzyR9 dREB3qM4AwtEj1munUD0siYt/VV5kvd0SN8iOigeOexJE0fAKj592P2STFOk7XEDJ/mc ozU/E2tzQ9N0vh2kw/NPBIM67FwZFc/CJwfsttCfAozMPBcSzwx638FnInvFjQp/rImy Xm9w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@metaspace-dk.20230601.gappssmtp.com header.s=20230601 header.b=L1pgeIkS; arc=pass (i=1 dkim=pass dkdomain=metaspace-dk.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-102396-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-102396-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id h10-20020a170902f70a00b001ddb642aa60si87616plo.542.2024.03.13.14.12.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 14:12:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-102396-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@metaspace-dk.20230601.gappssmtp.com header.s=20230601 header.b=L1pgeIkS; arc=pass (i=1 dkim=pass dkdomain=metaspace-dk.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-102396-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-102396-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id E4D7128F7F2 for ; Wed, 13 Mar 2024 19:19:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8D9625BACF; Wed, 13 Mar 2024 19:03:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=metaspace-dk.20230601.gappssmtp.com header.i=@metaspace-dk.20230601.gappssmtp.com header.b="L1pgeIkS" Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8BE1B5B5C5 for ; Wed, 13 Mar 2024 19:03:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710356603; cv=none; b=rTVwn3xKDg66b27+Ob+7ZUrTauJgMNSM4Sr5ji/wp7jiEFILi09WX+eH8fKmY6QtBgTDf7zRvOcyR54f2s3jfEkULfJjq2PZFXjaCm02tM8CMmH6oFtM0644HM93I+tr98qsm7V5dzt4FNEx1NV7CrsOoeAcXqF1mU0yVxJGhKU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710356603; c=relaxed/simple; bh=SX+fEPlUzQH+SDjF+fg9M0nYR4xU4g4PvaNbAOfrrho=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=eQUclu7hSfzv6EH58739meB5Li6GkilKIWgaNF0emaYHMLexolDDL+M7DBVe2Hd8q8hlQNc9lyMW6agsyvF+6SX7nMfOZsD/dJp4UcNwCO+FFZqMH/sa8d4fkUC9dtgJ4FdA2zCj1FNSn+JDxTMVKtx7bSQM3Ensvlpzcjk8OEc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=metaspace.dk; spf=none smtp.mailfrom=metaspace.dk; dkim=pass (2048-bit key) header.d=metaspace-dk.20230601.gappssmtp.com header.i=@metaspace-dk.20230601.gappssmtp.com header.b=L1pgeIkS; arc=none smtp.client-ip=209.85.208.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=metaspace.dk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=metaspace.dk Received: by mail-ed1-f53.google.com with SMTP id 4fb4d7f45d1cf-568107a9ff2so195099a12.3 for ; Wed, 13 Mar 2024 12:03:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=metaspace-dk.20230601.gappssmtp.com; s=20230601; t=1710356599; x=1710961399; darn=vger.kernel.org; h=mime-version:message-id:date:user-agent:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=z0czGQahQJmLOhb1t7D6nFie7YcEp1Eo0BOuwVvzqhY=; b=L1pgeIkSkB6oidxQZW6w0VEPRoHmSjDrbfQchntBbcZuaO7ElZW3FyTCpKsEtQY9OH pU8d6ZfECLovqMLuWahuE32Lu33FenkpsBQ/AUteZf4j3h+QNcqdyG2qksNxIWVKKvdX 2ebRMxIzu8A2J3SLZ0O6/zXHuiF14s1TpFxx1GgAQAgXcWKesCFP6LDJaejcR35nGFeq cGa7D/742K6iQHhk3J4qxSbLS54rPCBo92G3TsuVWKXeG977KRORTj6ZqmAh3kWEUqIO HUIBInQVaiz3OvocMvgRGG8g/iSsq6fwfEf87L9CPEZ7hbz+dv2VaC/3LQ1Yb5Q8LCRi 4aFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710356599; x=1710961399; h=mime-version:message-id:date:user-agent:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=z0czGQahQJmLOhb1t7D6nFie7YcEp1Eo0BOuwVvzqhY=; b=Y7k/kcHesdryARRSIJTbYKVpX3itB32l1GLAXUDtq7jiteQggX0XaYMop1tVifCglq U/iWd/468TGByHbz07UnLEbueTIW2ILicECSaxvemf/qZxI/xtn6TlOF5TIjbVIHKebI EJJQyCRZluPJquzFFuoAmdYeldzD9AYDvZgEymoFRSPak7Yg7Cw8xQhQONdYMNnQuc2q z95rdxE+fE3PRiJJt4qp0cu8PyxnEgUgkSI2dfQnhwvprkUMT8vgUrHzt53QWN4SnO5A 5sEAnf5zqgsmU6GbF85nQBXBU+s+vFh5GpaW3XQZqfOC4nEmh3RZB2dd7TfEUvfdtjr9 fHkw== X-Forwarded-Encrypted: i=1; AJvYcCXZuCA3PS4Lt11GH1br+4Ljt7uDcMXXeqNK7HmJVfJIFosWnZyqY87T1o713IPSzibfXa5ylHG72fQOEyFXZXbD/yve118X8DTWgWGJ X-Gm-Message-State: AOJu0YyAPNgu33Jmzlzg5OOMG7LaWm7VF2+8SmdpuEnYRJKJUUgAEfFt vZ6gDlnQwYueVw+bdaV6yncBK0WAWsrcj9rtsisqb7Rpj9E528DmRZylmVnYVck= X-Received: by 2002:a17:906:1308:b0:a46:60c6:98c9 with SMTP id w8-20020a170906130800b00a4660c698c9mr1283936ejb.68.1710356599394; Wed, 13 Mar 2024 12:03:19 -0700 (PDT) Received: from localhost ([79.142.230.34]) by smtp.gmail.com with ESMTPSA id r1-20020a170906364100b00a4320e22b31sm5163914ejb.19.2024.03.13.12.03.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 12:03:19 -0700 (PDT) From: Andreas Hindborg To: Boqun Feng Cc: Bart Van Assche , Jens Axboe , Christoph Hellwig , Keith Busch , Damien Le Moal , Hannes Reinecke , "linux-block@vger.kernel.org" , Andreas Hindborg , Niklas Cassel , Greg KH , Matthew Wilcox , Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Gary Guo , =?utf-8?Q?Bj=C3=B6rn?= Roy Baron , Benno Lossin , Alice Ryhl , Chaitanya Kulkarni , Luis Chamberlain , Yexuan Yang <1182282462@bupt.edu.cn>, Sergio =?utf-8?Q?Gonz=C3=A1lez?= Collado , Joel Granados , "Pankaj Raghav (Samsung)" , Daniel Gomez , open list , "rust-for-linux@vger.kernel.org" , "lsf-pc@lists.linux-foundation.org" , "gost.dev@samsung.com" Subject: Re: [RFC PATCH 0/5] Rust block device driver API and null block driver In-Reply-To: (Boqun Feng's message of "Wed, 13 Mar 2024 11:22:27 -0700") References: <20240313110515.70088-1-nmi@metaspace.dk> <855a006d-5afc-4f70-90a9-ec94c0414d4f@acm.org> User-Agent: mu4e 1.12.0; emacs 29.2 Date: Wed, 13 Mar 2024 20:03:07 +0100 Message-ID: <87r0get0no.fsf@metaspace.dk> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Boqun Feng writes: > On Wed, Mar 13, 2024 at 11:02:23AM -0700, Bart Van Assche wrote: >> On 3/13/24 04:05, Andreas Hindborg wrote: >> > This is the second version of the Rust block device driver API and the Rust null >> > block driver. The context and motivation can be seen in cover letter of the RFC >> > v1 [1]. If more context is required, a talk about this effort was recorded at >> > LPC [2]. I hope to be able to discuss this series at LSF this year [3]. >> >> Memory safety may land in C++ in the near future (see also >> https://herbsutter.com/2024/03/). If memory-safe C++ or memory-safe C >> would be adopted in the kernel, it would allow writing memory-safe >> drivers without having to add complicated bindings between existing C > > I honestly doubt it, memory-safe is not free, basically you will still > want unsafe part for the performance reason (or interacting with > hardware), and provide a safe API for driver development. I don't think > that part will be gone with a memory-safe C++. So the complication still > exists. But I'm happy to be proved wrong ;-) I think it is great that people are starting to realize that bringing memory safety to other systems languages is a good idea. But from one person blogging about it to things being ready for production is a long journey. Language designers have to design ways to express the new semantics, standards committees has to agree, compiler engineers have to build and test their compilers. Probably we need a few cycles of this to get things right. At any rate, it is going to take a while. Second, as Boqun is saying, interfacing the unsafe C part of the kernel with memory safe C++ is going to require the same complicated abstraction logic as the safe Rust APIs are bringing. The complexity in bringing Rust to the kernel is not coming from interfacing a foreign language. It stems from the inherent difficulty in designing memory safe wrappers around unsafe C APIs. Best regards, Andreas