linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
To: Andreas Hindborg <a.hindborg@kernel.org>,
	Benno Lossin <lossin@kernel.org>
Cc: "Alice Ryhl" <aliceryhl@google.com>,
	"Lorenzo Stoakes" <lorenzo.stoakes@oracle.com>,
	"Liam R. Howlett" <Liam.Howlett@oracle.com>,
	"Miguel Ojeda" <ojeda@kernel.org>,
	"Boqun Feng" <boqun.feng@gmail.com>,
	"Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Danilo Krummrich" <dakr@kernel.org>,
	linux-mm@kvack.org, rust-for-linux@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] rust: page: add method to copy data between safe pages
Date: Wed, 18 Feb 2026 12:41:05 +0100	[thread overview]
Message-ID: <CANiq72=cf=p-ORX6BO8LPhFK06TRS-o6PiYHxcPQhLAkrdCgaA@mail.gmail.com> (raw)
In-Reply-To: <87v7fubdeg.fsf@kernel.org>

On Wed, Feb 18, 2026 at 10:37 AM Andreas Hindborg <a.hindborg@kernel.org> wrote:
>
> If we picked a style for documenting argument lists, perhaps we should
> add it to Documentation/rust/coding-guidelines.rst?

Sure, I will. (In general, I recommend following the overall style,
i.e. only 3 places in the kernel use such an argument list, vs. all
the others we have.)

> I disagree that the bullets should be swapped. The second bullet at the
> call site:
>
>   // - By type invariant and existence of shared reference, there are no other writes to
>   //   `src` during this call.
>
> Maps to the second bullet in the callee safety requirements:
>
>   /// * Callers must ensure that there are no concurrent writes to the source memory region.

Ah, I see what happens now -- that second bullet is not in mainline,
but I see you are referring to this one you introduce here:

  https://lore.kernel.org/rust-for-linux/20260213-page-volatile-io-v3-1-d60487b04d40@kernel.org/

Is that new bullet needed though? Don't we already exclude data races
when we state "valid for reads"?

  https://doc.rust-lang.org/std/ptr/index.html#safety

I asked Benno about this -- let me put him in the To: so that he is in the loop.

If "extra clarifications" are needed, then we could put them in the
safety standard (Benno already has a table there with the shorthands
etc.), rather than introducing redundancy in `# Safety` sections which
can be quite confusing.

Cheers,
Miguel


      reply	other threads:[~2026-02-18 11:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-15 20:03 [PATCH 0/2] rust: pages that cannot be racy Andreas Hindborg
2026-02-15 20:03 ` [PATCH 1/2] rust: page: add `SafePage` for race-free page access Andreas Hindborg
2026-02-16  8:52   ` Alice Ryhl
2026-02-15 20:03 ` [PATCH 2/2] rust: page: add method to copy data between safe pages Andreas Hindborg
2026-02-15 22:33   ` Miguel Ojeda
2026-02-15 23:40     ` Andreas Hindborg
2026-02-17 21:35       ` Miguel Ojeda
2026-02-18  9:37         ` Andreas Hindborg
2026-02-18 11:41           ` Miguel Ojeda [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CANiq72=cf=p-ORX6BO8LPhFK06TRS-o6PiYHxcPQhLAkrdCgaA@mail.gmail.com' \
    --to=miguel.ojeda.sandonis@gmail.com \
    --cc=Liam.Howlett@oracle.com \
    --cc=a.hindborg@kernel.org \
    --cc=aliceryhl@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=dakr@kernel.org \
    --cc=gary@garyguo.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=lossin@kernel.org \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tmgross@umich.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox