linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Robin Murphy <robin.murphy@arm.com>
To: Alice Ryhl <aliceryhl@google.com>
Cc: "Miguel Ojeda" <ojeda@kernel.org>,
	"Will Deacon" <will@kernel.org>,
	"Daniel Almeida" <daniel.almeida@collabora.com>,
	"Boris Brezillon" <boris.brezillon@collabora.com>,
	"Boqun Feng" <boqun.feng@gmail.com>,
	"Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <lossin@kernel.org>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Danilo Krummrich" <dakr@kernel.org>,
	"Joerg Roedel" <joro@8bytes.org>,
	"Lorenzo Stoakes" <lorenzo.stoakes@oracle.com>,
	"Liam R. Howlett" <Liam.Howlett@oracle.com>,
	"Asahi Lina" <lina+kernel@asahilina.net>,
	linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org,
	iommu@lists.linux.dev, linux-mm@kvack.org
Subject: Re: [PATCH v3] io: add io_pgtable abstraction
Date: Mon, 1 Dec 2025 13:55:34 +0000	[thread overview]
Message-ID: <cfce9ad9-c518-44c7-a602-8ce7c3fffb2b@arm.com> (raw)
In-Reply-To: <aS1m4DawouC1utSj@google.com>

On 2025-12-01 9:58 am, Alice Ryhl wrote:
[...]
>>> We need a different signature if it's possible to have mapped != 0 when
>>> returning an error.
>>
>> Aha, thanks for clarifying - indeed this is not the common "value or error"
>> case, it is two (almost) orthogonal return values. However if we're not
>> permitting callers to try to do anything clever with -EEXIST then it might
>> make sense to just embed the inevitable cleanup-on-failure boilerplate here
>> anyway (even if we still leave retry-on-partial-success to the caller).
> 
> Is the only possible error -EEXIST? I could encode that in the API if
> that is the case.

No, I was just calling out -EEXIST as the only error where I imagine a 
caller *might* want to continue without cleaning up a partial mapping, 
if for instance they were playing clever tricks like a background 
mapping of a large buffer while already allowing other threads to 
eagerly demand-page bits of it, so the "main" mapping thread just 
adjusts and restarts to skip over already-present pages. Other errors 
are still possible, but generally represent terminal failure conditions 
at the caller's level too - in practice things like -EINVAL and -ENOMEM 
are likely to happen before any mappings can be made, but io-pgtable 
doesn't guarantee any particular behaviour here, so a well-behaved 
caller should still generally handle cleaning up after an error (at 
least if they intend to keep trying to use the pagetable beyond that point).

Cheers,
Robin.


  reply	other threads:[~2025-12-01 13:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-12 10:15 Alice Ryhl
2025-11-12 12:57 ` Daniel Almeida
2025-11-17 16:34   ` Alice Ryhl
2025-11-19  8:59     ` Boris Brezillon
2025-11-19 10:53   ` Boris Brezillon
2025-11-19 10:56 ` Boris Brezillon
2025-11-28 11:56 ` Robin Murphy
2025-11-28 12:27   ` Alice Ryhl
2025-11-28 16:47     ` Robin Murphy
2025-12-01  9:58       ` Alice Ryhl
2025-12-01 13:55         ` Robin Murphy [this message]
2025-11-28 18:02 ` Jason Gunthorpe

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=cfce9ad9-c518-44c7-a602-8ce7c3fffb2b@arm.com \
    --to=robin.murphy@arm.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=boris.brezillon@collabora.com \
    --cc=dakr@kernel.org \
    --cc=daniel.almeida@collabora.com \
    --cc=gary@garyguo.net \
    --cc=iommu@lists.linux.dev \
    --cc=joro@8bytes.org \
    --cc=lina+kernel@asahilina.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 \
    --cc=will@kernel.org \
    /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