Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp1969161lqb; Mon, 27 May 2024 03:50:35 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXfPMYqmGKLpCftASS5It46vkSxCgOrCey265BYkwVMnVZEgbSJc/ZbZZ6EdSdlqRKfM4hIUcLZk1WkY8boVsSuDBb3ybcbmaIXt+FNLQ== X-Google-Smtp-Source: AGHT+IFh56vDV62uLtRoIOUwRZE5wv3Ptw1bCi5crbaaTiMVe+e47UAuntBO6NIW+r/PtRAHyTcY X-Received: by 2002:a05:6871:796:b0:24f:e6a4:990c with SMTP id 586e51a60fabf-24fe6a4d0ecmr4225642fac.11.1716807034951; Mon, 27 May 2024 03:50:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716807034; cv=pass; d=google.com; s=arc-20160816; b=LMY4YWah41c6Ij4bsose+nHnMafnzuAygVfFHAYLCHApueVvhhhY3Llv+AvquCbS5I vX3rxhruwG6ZMlE5yOV2mH9qts12Orm9AobKxiIZpuZsOOoWWN/D8UPwtlVHuT3vYCIz GW22Gxq+3SdTotGh2gTU5qzSSCnbrnrZ3uUAMf6paux/EqmIGCsRljFKr+xl05RziCB/ AxLZVEBdl8momTTQ1l9meDjTmgpiR+CO2ibMorBmkI13vbta3HliDrg6quwkj/7fTiP5 zVvejAfzlEvVeZGilIgkA14jxa1+MX/6fvQAjajz3ThrH80+0WoFXYHZS0Iw1IWjbtEA +EuA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:feedback-id:references :in-reply-to:message-id:subject:cc:from:to:date:dkim-signature; bh=zDqqdgPcxNIOCNxfRj2Ird7GKrHKPSBXxIMDgjl4viU=; fh=1eN+strsLnX8cuvE+uTff7wY1KiEAf1jFO97IDCVf3U=; b=bCTzBK423ng6GrkNEPmBDC+7VEwBnhjciIfSwLd4+14VN9xxB7f7SCPTCOQsSt0CQd B3I3XAv7KHSfx8d1IuJ4EDANwT+fq7l0eF2NkN2OTGCPtwUTBwEMRGORNFY4IpcEMSkf NZsz6Grl2ieqwfnThhu6nhYFlUhXlI8roArs+6hjqX3cXmARDNLD4z014xpBxNMEQ+c0 EI7dVHpi0rtfUuxYev7BMTefwMchJXE4E+fU5OH5RC/vfqRXMeeLKtYl6KWX6t5vSpGh 7UDkcLhTW4EgV9Ow010bXRn4oSVXwtKwjOZ28y4yczuH3QwhYRq1F9PdJzsnrudTyBIB oIzg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@proton.me header.s=protonmail header.b="XzAgiHQ/"; arc=pass (i=1 spf=pass spfdomain=proton.me dkim=pass dkdomain=proton.me dmarc=pass fromdomain=proton.me); spf=pass (google.com: domain of linux-kernel+bounces-190445-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-190445-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=proton.me Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6822a3cbda5si6195640a12.732.2024.05.27.03.50.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 03:50:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-190445-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@proton.me header.s=protonmail header.b="XzAgiHQ/"; arc=pass (i=1 spf=pass spfdomain=proton.me dkim=pass dkdomain=proton.me dmarc=pass fromdomain=proton.me); spf=pass (google.com: domain of linux-kernel+bounces-190445-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-190445-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=proton.me 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 63A8D280E65 for ; Mon, 27 May 2024 10:50:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 00BA013B7A4; Mon, 27 May 2024 10:50:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=proton.me header.i=@proton.me header.b="XzAgiHQ/" Received: from mail-4316.protonmail.ch (mail-4316.protonmail.ch [185.70.43.16]) (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 AD63C26AFA; Mon, 27 May 2024 10:50:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.70.43.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716807027; cv=none; b=kmqUaPY1gQfr/eAzdzq6cobPkW6yfM1vwDbhZZGqRdQ0vZbzm+0DMawEWeIDpQouG8Jbminrv2eMHv8DFXworj2XZpx5Nu2g0l7tzpgJX2Q0xTw15S5CtJkBKG/YyWXGRHKvDEDPEMg3K9aouGveMOLRZLjPkfuPQoewRPk50lI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716807027; c=relaxed/simple; bh=PBIN0QawD2NPAG4XO+sttWPtgLsmF6K+be/5GyQwvLU=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=U7KHiE2n2lR68x5Ik5Okl0lswjog0FLh+ziBag+0yQ8bAg8UPqxRP4OBmsMBNHi5NB03crVX0xViGKbWSWEFZoK4Ra4g+Ftn46KfWon7k4MX40yZiuItcxVbA8oYe+IH19uiaQnUnZ5PwBqY9h+rUJ4wijioeTJvRnPC0JfP3so= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=proton.me; spf=pass smtp.mailfrom=proton.me; dkim=pass (2048-bit key) header.d=proton.me header.i=@proton.me header.b=XzAgiHQ/; arc=none smtp.client-ip=185.70.43.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=proton.me Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=proton.me DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail; t=1716807023; x=1717066223; bh=zDqqdgPcxNIOCNxfRj2Ird7GKrHKPSBXxIMDgjl4viU=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=XzAgiHQ/0IkeWD+FyKc6E7eVOAek3i2k0BdZS91/GcyDIufbOgeXWpNrbzPjFOVKm lB2os8ICoCD1RkngLrYOcKftflpTcZ8g9mPGQmTZ3yst2TnmTc4W2wuq37dX6khVE0 A9zeMgE9Cyl/pBl9LjROrs2rmp0WFcbTuaAjUIjSRcTFeH7arYbhU8Y1Y3umaxIVXl ROvOo29re/OH17r+PvFdTvFJqjuU20CYpac4nri7Au/KWxuJqiRdQFZHRYJXYcygch PpXQX/JjWYRWLjaxugTOW1/XDQxLQcIouA6v3Eco5RzqnCZm6gnr0dw1d313yo/rqN iVOyijt3J/Qdg== Date: Mon, 27 May 2024 10:50:17 +0000 To: Alice Ryhl , Miguel Ojeda , Andrew Morton From: Benno Lossin Cc: Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?utf-8?Q?Bj=C3=B6rn_Roy_Baron?= , Andreas Hindborg , Marco Elver , Kees Cook , Coly Li , Paolo Abeni , Pierre Gondois , Ingo Molnar , Jakub Kicinski , Wei Yang , Matthew Wilcox , linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org Subject: Re: [PATCH v2 9/9] rust: list: add ListArcField Message-ID: <4a713d0e-00d7-4735-b68b-fbf9edb2e282@proton.me> In-Reply-To: <20240506-linked-list-v2-9-7b910840c91f@google.com> References: <20240506-linked-list-v2-0-7b910840c91f@google.com> <20240506-linked-list-v2-9-7b910840c91f@google.com> Feedback-ID: 71780778:user:proton X-Pm-Message-ID: f93350be2b5ccdcc25cf38e360e978dad03999b7 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 06.05.24 11:53, Alice Ryhl wrote: > One way to explain what `ListArc` does is that it controls exclusive > access to the prev/next pointer field in a refcounted object. The > feature of having a special reference to a refcounted object with > exclusive access to specific fields is useful for other things, so > provide a general utility for that. >=20 > This is used by Rust Binder to keep track of which processes have a > reference to a given node. This involves an object for each process/node > pair, that is referenced by both the process and the node. For some > fields in this object, only the process's reference needs to access > them (and it needs mutable access), so Binder uses a ListArc to give the > process's reference exclusive access. >=20 > Signed-off-by: Alice Ryhl > --- > rust/kernel/list.rs | 3 ++ > rust/kernel/list/arc_field.rs | 96 +++++++++++++++++++++++++++++++++++++= ++++++ > 2 files changed, 99 insertions(+) Reviewed-by: Benno Lossin --- Cheers, Benno