All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Danilo Krummrich" <dakr@kernel.org>
To: "Daniel Almeida" <daniel.almeida@collabora.com>
Cc: <lorenzo.stoakes@oracle.com>, <vbabka@suse.cz>,
	<Liam.Howlett@oracle.com>, <urezki@gmail.com>, <ojeda@kernel.org>,
	<alex.gaynor@gmail.com>, <boqun.feng@gmail.com>,
	<gary@garyguo.net>, <bjorn3_gh@protonmail.com>,
	<lossin@kernel.org>, <a.hindborg@kernel.org>,
	<aliceryhl@google.com>, <tmgross@umich.edu>,
	<abdiel.janulgue@gmail.com>, <acourbot@nvidia.com>,
	<rust-for-linux@vger.kernel.org>
Subject: Re: [PATCH v4 4/7] rust: page: define trait AsPageIter
Date: Tue, 19 Aug 2025 15:16:21 +0200	[thread overview]
Message-ID: <DC6FL400ZFFQ.2EJOFHXXHB9QD@kernel.org> (raw)
In-Reply-To: <36948F0D-03A7-47B9-A1B7-50C0146C9A55@collabora.com>

On Tue Aug 19, 2025 at 3:08 PM CEST, Daniel Almeida wrote:
>> On 14 Aug 2025, at 06:33, Danilo Krummrich <dakr@kernel.org> wrote:
>> +/// [`BorrowedPage`] items, such as [`VmallocPageIter`](kernel::alloc::allocator::VmallocPageIter).
>> +pub trait AsPageIter {
>> +    /// The [`Iterator`] type, e.g. [`VmallocPageIter`](kernel::alloc::allocator::VmallocPageIter).
>> +    type Iter<'a>: Iterator<Item = BorrowedPage<'a>>
>> +    where
>> +        Self: 'a;
>> +
>> +    /// Returns an [`Iterator`] of [`BorrowedPage`] items over all pages owned by `self`.
>> +    fn page_iter(&mut self) -> Self::Iter<'_>;
>
> Does it make sense to break this into page_iter() and page_iter_mut()?
> Alternatively, should this take &self instead?

The Iterator relies on the underlying data structure not being altered. For
instance, a VVec giving out a VmallocPageIter must not be re-allocated while the
VmallocPageIter exists.

  reply	other threads:[~2025-08-19 13:16 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-14  9:33 [PATCH v4 0/7] BorrowedPage, AsPageIter and VmallocPageIter Danilo Krummrich
2025-08-14  9:33 ` [PATCH v4 1/7] rust: page: implement BorrowedPage Danilo Krummrich
2025-08-19 12:42   ` Daniel Almeida
2025-08-14  9:33 ` [PATCH v4 2/7] rust: alloc: vmalloc: implement Vmalloc::to_page() Danilo Krummrich
2025-08-19 12:46   ` Daniel Almeida
2025-08-14  9:33 ` [PATCH v4 3/7] rust: alloc: implement VmallocPageIter Danilo Krummrich
2025-08-18 12:02   ` Alexandre Courbot
2025-08-19 11:48   ` Alice Ryhl
2025-08-19 12:02     ` Danilo Krummrich
2025-08-19 12:58   ` Daniel Almeida
2025-08-14  9:33 ` [PATCH v4 4/7] rust: page: define trait AsPageIter Danilo Krummrich
2025-08-18 12:06   ` Alexandre Courbot
2025-08-18 12:07     ` Danilo Krummrich
2025-08-18 12:14       ` Alexandre Courbot
2025-08-18 12:18         ` Danilo Krummrich
2025-08-19 11:49   ` Alice Ryhl
2025-08-19 13:08   ` Daniel Almeida
2025-08-19 13:16     ` Danilo Krummrich [this message]
2025-08-14  9:33 ` [PATCH v4 5/7] rust: alloc: kbox: implement AsPageIter for VBox Danilo Krummrich
2025-08-18 12:07   ` Alexandre Courbot
2025-08-19 11:50   ` Alice Ryhl
2025-08-19 12:06     ` Danilo Krummrich
2025-08-14  9:33 ` [PATCH v4 6/7] rust: alloc: layout: implement ArrayLayout::size() Danilo Krummrich
2025-08-14  9:33 ` [PATCH v4 7/7] rust: alloc: kvec: implement AsPageIter for VVec Danilo Krummrich
2025-08-18 12:09   ` Alexandre Courbot
2025-08-19 11:51   ` Alice Ryhl
2025-08-19 13:11   ` Daniel Almeida
2025-08-18 12:11 ` [PATCH v4 0/7] BorrowedPage, AsPageIter and VmallocPageIter Alexandre Courbot

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=DC6FL400ZFFQ.2EJOFHXXHB9QD@kernel.org \
    --to=dakr@kernel.org \
    --cc=Liam.Howlett@oracle.com \
    --cc=a.hindborg@kernel.org \
    --cc=abdiel.janulgue@gmail.com \
    --cc=acourbot@nvidia.com \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=daniel.almeida@collabora.com \
    --cc=gary@garyguo.net \
    --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=urezki@gmail.com \
    --cc=vbabka@suse.cz \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.