From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bedivere.hansenpartnership.com (bedivere.hansenpartnership.com [96.44.175.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3D85770 for ; Wed, 7 Jul 2021 07:52:27 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by bedivere.hansenpartnership.com (Postfix) with ESMTP id 8E2BC128067A; Wed, 7 Jul 2021 00:52:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=hansenpartnership.com; s=20151216; t=1625644346; bh=dekjwix0ZVo3+MomZgDtuqeJ7gB7V9RyN2lG8dmqHsg=; h=Message-ID:Subject:From:To:Date:In-Reply-To:References:From; b=DYhGARGu94Et2wkDpyrsOTNiWaJniwmTawvioraaqhm6cezrc4KUhVZIktcWdNrOS Vl/pEpZ2vBXOHmNE5vurcg5HgKtk9jFfPxbv2Rpwl4gY/oiqqksZ0M3zxwIjXQsQV6 2et0ZD8U/StQ+yn1ZFatc+W7Zob7S/SM7POpt6IM= Received: from bedivere.hansenpartnership.com ([127.0.0.1]) by localhost (bedivere.hansenpartnership.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2t6RLptXauiN; Wed, 7 Jul 2021 00:52:26 -0700 (PDT) Received: from [192.168.0.73] (cpc1-seac25-2-0-cust181.7-2.cable.virginm.net [82.8.18.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bedivere.hansenpartnership.com (Postfix) with ESMTPSA id A01D2128066E; Wed, 7 Jul 2021 00:52:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=hansenpartnership.com; s=20151216; t=1625644346; bh=dekjwix0ZVo3+MomZgDtuqeJ7gB7V9RyN2lG8dmqHsg=; h=Message-ID:Subject:From:To:Date:In-Reply-To:References:From; b=DYhGARGu94Et2wkDpyrsOTNiWaJniwmTawvioraaqhm6cezrc4KUhVZIktcWdNrOS Vl/pEpZ2vBXOHmNE5vurcg5HgKtk9jFfPxbv2Rpwl4gY/oiqqksZ0M3zxwIjXQsQV6 2et0ZD8U/StQ+yn1ZFatc+W7Zob7S/SM7POpt6IM= Message-ID: <20ad13eb229b15fd14d870832d43a1605ba5c24a.camel@HansenPartnership.com> Subject: Re: [TECH TOPIC] Rust for Linux From: James Bottomley To: Greg KH , Julia Lawall Cc: Laurent Pinchart , Linus Walleij , Roland Dreier , Miguel Ojeda , ksummit@lists.linux.dev Date: Wed, 07 Jul 2021 08:52:22 +0100 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.4 Precedence: bulk X-Mailing-List: ksummit@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 7bit On Wed, 2021-07-07 at 09:45 +0200, Greg KH wrote: > On Wed, Jul 07, 2021 at 09:27:32AM +0200, Julia Lawall wrote: [...] > > Where should the free have been? Will Rust help in this > > case? Will it result in a memory leak? > > This is going to be the "interesting" part of the rust work, where it > has to figure out how to map the reference counted objects that we > currently have in the driver model across to rust-controlled objects > and keep everything in sync properly. Rust has a reference counted pointer: Rc. However the problem is the rust memory model is via strict accounting, so once you start using refcounts, which need shared accounting, you can then get memory leaks and it's unclear if rust actually buys you anything over C for this use case. James