Received: by 2002:ab2:78c:0:b0:1ec:b906:25e5 with SMTP id h12csp255276lqe; Fri, 23 Feb 2024 03:36:16 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUnCxD69lsmm3ZyZUs972Wf7umFMGz4q2hglIumbfxsPmoW6k5Bv3u7FDnwVfk4KTsqFjCOQjYmccpEv+L0xvDF5ZP9J8tpCjQh0568tA== X-Google-Smtp-Source: AGHT+IH3goGYKvzG7qDCaD1CpOmAWwPVob7Y88X+af3srvjrohN/TK3odzP819xMXR11DQePmScv X-Received: by 2002:a05:6a20:728b:b0:1a0:d25b:aaac with SMTP id o11-20020a056a20728b00b001a0d25baaacmr1606342pzk.32.1708686408845; Fri, 23 Feb 2024 03:06:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708686408; cv=pass; d=google.com; s=arc-20160816; b=JnG2O98QTSyzfn1mxt/D5H0Ck8AjyJmJLbs5mONvPXDylD4jk5hLnx4IgyCAXQRG+5 JaXFfZteoGvTo3n70Xic7/6UPwRIUYfbHePvtzdyF0xkQj0logxnW7ICocG7gdaM7jVP osHMn63jga4Xx2r8NLdxjEgjj1J3SIW2Rk+ccB53qR2U+oXVFzJJAySr1UTjSG4pidKF R3phAp3HYswDzvm6To4hBYsSTFWjdOhHm6igqdp6jkzGE6f5brsp9GkEJPEi8wCUVRbm vx6XIKJEhxDD7FiCj65K8IBQeefa9csED6POVtC/3781XfuFbQ718Aia1w0onjvrl2oE yi1g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=GE+2ynBhau0YKFYIh74VjetPhnXxE9fhhkw20RQkbUE=; fh=m0PGArOfF1nhu9VrURgf/O1RL9p/k+zbB02Ndvoze3c=; b=OKj/Fi++0z3uOmolSRJBhg2E6mo3Vcp6X6uv86Mxfd2QjjaeSAfV/0pvAUNPw3w9W6 te7B5UW4exmzq9oifARCZ9vEI05YGVPwYDjd2uAoAtfTJxzsrDMqqPUH6GKFtL7DszoV FNVECqFDZ/67r+oBfM861UswZpEcf2tYvl1ScOnAhToGfjBk/aX1DE8OsWb9ZfHrBx8M chSIVX+b3hOvsIXPkBbXhothZORoD9aX35Gdm38seFsIYmJLfN6vjISomRZvgw6GlwYX uZUHXLux/7UELN6jR93Oeg5Z5W7dOmWADGlJ5+jU/vVt36nXhIeDM/kvo5QQ123vt3Va z8Rw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Mc8ZASG7; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-78175-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78175-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id bx27-20020a056a00429b00b006e39f3c2c59si1805152pfb.21.2024.02.23.03.06.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 03:06:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-78175-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Mc8ZASG7; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-78175-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78175-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 0FF1FB227CD for ; Fri, 23 Feb 2024 10:49:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 96E45633E9; Fri, 23 Feb 2024 10:49:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Mc8ZASG7" Received: from mail-ua1-f44.google.com (mail-ua1-f44.google.com [209.85.222.44]) (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 4358563111 for ; Fri, 23 Feb 2024 10:49:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708685369; cv=none; b=KOB7gVqtqmyUnTAN/qh+3QaD6KjrChC62NIDcC1UMZBEHLYHoQxph2ZQBWuYlKiGmI4bRuUsHszR+O5UnhdV3m88UWI/10XZqMByGKA2T3dKZbhcc81KELBuAz5rGm6Gbq3JKsMFPgW3OU/O+nP6z62IDBlNUaFKD7tpC7/CxdY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708685369; c=relaxed/simple; bh=xKmHqtYAcI8JTc51pSNY0Si56PBb13xYvaijXtKZ6IE=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=nVA3PcarC0B+Ppj3Q8h3+q9MxKEofoNclXHB20WZAynwPO53R01+IRe+b97FeK4EHxn0GsFKAEIzuuJZboTIcMGpg6Mc3AzJ1oHxXwS+04Mei6cghcXdb3Ro9ZowwlC3Sb9Q3tRPmfLggPmWkIupx6Gm0E3DYDYAgm06jKDcuFY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=Mc8ZASG7; arc=none smtp.client-ip=209.85.222.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-ua1-f44.google.com with SMTP id a1e0cc1a2514c-7d643a40a91so352119241.0 for ; Fri, 23 Feb 2024 02:49:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1708685367; x=1709290167; darn=vger.kernel.org; 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=GE+2ynBhau0YKFYIh74VjetPhnXxE9fhhkw20RQkbUE=; b=Mc8ZASG73TJLsAICDEowTcrPWK3tauWP9pPv32dNBcMqtIHxsJWmqAf6j0Uq/PGfrT BfHwRPSYprbjOcS0Dox18cP8x7shyDMH0nO67fKbDlqktO53x6qoxH/vn7DLJExLq38m fhX+1JmgEanNyrtjoOetKWtqfmh1Zrps+rUUimZzduINm5pw9wZ2NqlOwRrEK0tPPrNT WgnRb2OXmmlkyF2EcdPTf//AfGViU+/A3AAS4/vVnIaHfX9UKBACLvVuur9rxnxZhcXj b3L26FvROgDfuclRd1uuIUydDp/co9OGhCXaT7SNaYS9L1FJ6kmCpki/lVVhrwIgEo17 herg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708685367; x=1709290167; 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=GE+2ynBhau0YKFYIh74VjetPhnXxE9fhhkw20RQkbUE=; b=fjH7Ouo0JxK3TeiRXKv7ODmETggPeyR7xHxyudVArEx9UgqIpDCT+udV1whZ4fRvN1 12J/i2TfUfXhqY/VPFjLUjSGWRWIzrrN0CvgqsjkhTfKxJNbyLHcJnWtnTvYV8wRYQjp sKIPZNaO20Wl6sh9vQpAYsQ+y7KFJev2+oI4pSfwjyzDxxunSsNmczvDtb5MaxQ5QV5B 9YNb/84RVcMMyutTa9BeKe1vx1DzKgx529t6OlB1tRvMyxDba3k9fG8Nvdv/mJ4Ik6MO IpmmpetcanLdIP7kEDbTOBkaivJmDod+1rpuOnYAMK+qBzXri2mDA916zPmdYvNvvmG5 omBg== X-Forwarded-Encrypted: i=1; AJvYcCWCQKnXtG9yEjJaALSaWqERRw/9TXtKQf5CsOsbj8xc34cWbkTXqWVBgQQIG4xVapLKmoot2oa2RxguzgX8YiJvX/9Boz9AeXkWED1q X-Gm-Message-State: AOJu0Yz9wPqgpPr6K6UFXpgfFr89PByqLXDLwRvZ8L6NkklDvh2pDaEW xhUH4KOfvVHlGLAvouQbSex3hLR/vBhJF6l1i8qPemTAXioNnFdh/GeXvWUCiCNpF2uCjDOE0RI SFtCKDPOezDLqTV5JBr7gFa/bSU5BXMnDC+df X-Received: by 2002:a05:6102:3584:b0:470:575a:f4bd with SMTP id h4-20020a056102358400b00470575af4bdmr1645580vsu.28.1708685367012; Fri, 23 Feb 2024 02:49:27 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240222-rust-locks-get-mut-v3-1-d38a6f4bde3d@gmail.com> In-Reply-To: From: Alice Ryhl Date: Fri, 23 Feb 2024 11:49:15 +0100 Message-ID: Subject: Re: [PATCH v3] rust: locks: Add `get_mut` method to `Lock` To: Boqun Feng Cc: mathys35.gasnier@gmail.com, Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Gary Guo , =?UTF-8?Q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Feb 23, 2024 at 3:52=E2=80=AFAM Boqun Feng w= rote: > BTW, while we are at it, I think we should document the > "structural/non-structural pinning" design decisions somewhere, for > example in the struct definition: > > #[pin_data] > pub struct Lock { > ... > /// The data protected by the lock. > /// This field is non-structural pinned. > pub(crate) data: UnsafeCell, > } > > Thoughts? Or do we think "non-structural pinned" should be the default > case so no need to document it? I want to have a clear document for each > field to avoid the accidental "everyone forgets what's the decision > here" ;-) I would normally assume that "field is not marked #[pin]" implies that it's not structurally pinned. But it could still be worth to call out here. I prefer the wording "not structurally pinnned" over "non-structural pinned= ". Alice