Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp573480lql; Mon, 11 Mar 2024 10:42:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV0rc3njZOpTEMBzdlFkIffROwRjjuupmb0Q+IcKbV11004/ZexHaDlfYexcbC/Ir1OhH02QG6poFqP6GDmZRiGWkKVU4SZsD7JDDQgRw== X-Google-Smtp-Source: AGHT+IHubrg4ZZsYrfEtrN/ftYxODgShGI7BbVydKTNOBRtWT2hHPMxG1eoOz4u9OcH1P+SRYsZg X-Received: by 2002:a05:6402:5c3:b0:566:28ae:55d4 with SMTP id n3-20020a05640205c300b0056628ae55d4mr5065618edx.39.1710178941677; Mon, 11 Mar 2024 10:42:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710178941; cv=pass; d=google.com; s=arc-20160816; b=VyllLeMVNKFLed2bmWrkP3jP0fGp2owoTOTl6dk8UWnLMarCxCrNekBKhMvhSN9Z7a n2qCvG3tJRJpNCH8qJo5hGxX/h3QPPfvK6SzNANPw0GBrNm/5xep74vaOZb4vi4+fQj1 lE2YSLY87UPKXPGixNp7QKspVIDO9LegL7xveGcpVZxTuGWKDjCLDn34ggjdPX+M+DBi L+fYgmiJOgbdyOVqd/MNtzUbDUUk+7Wcthu94yRpabOC/ppc2oqZ8VJ8RL7yDxgONd7I HOBM9gsx8gwNrD/0tOLXiCnA8X6fF8Bs83y5/rJi6ExWOBk/6uYYliEZ9OVXkSHgzFVO WsSg== 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=ORGdsl5UIR478ZEBG6URHeYsrx2/4RddGZKZpjoNWPk=; fh=nBIU09dkdw1pFNvOl0hziI6raxaJ3qXyfxUzWt0uves=; b=vcpJnqkFRaKosjNHDmTDqjhzrzBtvcLToP8OwBRRIbTf+J58lS2qfFVDvIjf0VAOQf 3AwNKoNnnRwgi5jeErpTjqUjU0bzNI0o6dSHPtTsdnNd5PbUKfp4jqrf3yVQ+Bohsv3K eM9+6hkUEPuHro+9WhqGu46XllV5szoE32Gc9ld/DwxVYmM9qCh0p8Em8Se5KfHlfS/J ycsy4kmJpqoH2lG4d0xpL8MJnq8VltJuMaTAU3t+E3cuIZztiV0AGyiHVAr6uMukH17N XUTv603QQZ0jDYqacUcpRl5Zz0t0CH20Ewr7125IdkgrXoFkZjJIaQ1kVnaYe0zlCler 6wpw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@proton.me header.s=protonmail header.b=M19iv89K; 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-99316-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-99316-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=proton.me Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id q20-20020a50c354000000b005673b8a79c9si2796880edb.394.2024.03.11.10.42.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Mar 2024 10:42:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-99316-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@proton.me header.s=protonmail header.b=M19iv89K; 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-99316-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-99316-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 0DC1E1F23758 for ; Mon, 11 Mar 2024 17:42:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4F40453E08; Mon, 11 Mar 2024 17:42:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=proton.me header.i=@proton.me header.b="M19iv89K" Received: from mail-4322.protonmail.ch (mail-4322.protonmail.ch [185.70.43.22]) (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 B8703537EE for ; Mon, 11 Mar 2024 17:41:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.70.43.22 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710178919; cv=none; b=jMktNkH8GtJWW4f5uSp/Gn4gB5rfBbxC7X5OqsfufaqkRqqeyXoX/RPk+9XMHkESpqigEMHI5Z05Quy+7fUiXIe4byWBp4uuB2Taz8+Nk8IyZQF73sEXO7EijABdZYmZfUw5IRER0Iqy/0YjE6Zk60J+FOuQLNfHvxp2uWiHHzM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710178919; c=relaxed/simple; bh=ORGdsl5UIR478ZEBG6URHeYsrx2/4RddGZKZpjoNWPk=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=WEaKVUoGq5WsE3YWK67My49WTeWMkYvvc6wfsTfC2pLRM2+omgIfpXRb4uIcRjDSqjV4yzbWFbkhbJCnTEvFukTzJCzFjBUhNtIaVHI0Ehc2jXIkpWz0x9GqwSqCoumwaH+AL+CNHwSoJwT+mARdYNkANnSbu0rn0Not8S483qs= 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=M19iv89K; arc=none smtp.client-ip=185.70.43.22 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=1710178914; x=1710438114; bh=ORGdsl5UIR478ZEBG6URHeYsrx2/4RddGZKZpjoNWPk=; 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=M19iv89KHOgi8WvCcBSJgQ+iQ6dwQZtOEBTFnyjbR/b2Q1uQ+qJWtHVdEJaWw+zC6 9G6/BZTq/6+yHuu28GUw+Lbjv75GA8+/v/q2GP8gg7NfLlqDL34DI3cjkpln1EcQor ZJs2dkre3oC4lXNahHUHLLnN8cxw1kLkNMfvkhVod8jF9xHl1goJLxK/tOjaESgzui Ux+1klC/q6um7mnvcCCGwf1fLWnsVNRxtUtdy9ZhM2T8xq8Gm3sLry7SO0ZaTFrcDq 0QPNcnc6Cz+OLW5SBx4QRfm9uHKLX7o2/PliDOPZelQPeIiixkGR7ATrH3cFzGdBSx 4mqZeGZojuDiA== Date: Mon, 11 Mar 2024 17:41:32 +0000 To: Alice Ryhl , Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?utf-8?Q?Bj=C3=B6rn_Roy_Baron?= , Andreas Hindborg From: Benno Lossin Cc: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 2/2] rust: sync: add `Arc::into_unique_or_drop` Message-ID: In-Reply-To: <20240311-arc-for-list-v3-2-cba1883c62eb@google.com> References: <20240311-arc-for-list-v3-0-cba1883c62eb@google.com> <20240311-arc-for-list-v3-2-cba1883c62eb@google.com> Feedback-ID: 71780778:user:proton 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 3/11/24 17:08, Alice Ryhl wrote: > Decrement the refcount of an `Arc`, but handle the case where it hits > zero by taking ownership of the now-unique `Arc`, instead of destroying > and deallocating it. >=20 > This is a dependency of the linked list that Rust Binder uses. The > linked list uses this method as part of its `ListArc` abstraction. >=20 > Signed-off-by: Alice Ryhl Reviewed-by: Benno Lossin