|
|
Log in / Subscribe / Register

rust: page: Add support for existing struct page mappings

From:  Abdiel Janulgue <abdiel.janulgue-AT-gmail.com>
To:  rust-for-linux-AT-vger.kernel.org
Subject:  [PATCH v3 0/2] rust: page: Add support for existing struct page mappings
Date:  Tue, 19 Nov 2024 13:24:01 +0200
Message-ID:  <20241119112408.779243-1-abdiel.janulgue@gmail.com>
Cc:  Miguel Ojeda <ojeda-AT-kernel.org>, Alex Gaynor <alex.gaynor-AT-gmail.com>, Boqun Feng <boqun.feng-AT-gmail.com>, Gary Guo <gary-AT-garyguo.net>, Björn Roy Baron <bjorn3_gh-AT-protonmail.com>, Benno Lossin <benno.lossin-AT-proton.me>, Andreas Hindborg <a.hindborg-AT-kernel.org>, Alice Ryhl <aliceryhl-AT-google.com>, Trevor Gross <tmgross-AT-umich.edu>, Danilo Krummrich <dakr-AT-kernel.org>, Wedson Almeida Filho <wedsonaf-AT-gmail.com>, Valentin Obst <kernel-AT-valentinobst.de>, linux-kernel-AT-vger.kernel.org (open list), Andrew Morton <akpm-AT-linux-foundation.org>, linux-mm-AT-kvack.org (open list:MEMORY MANAGEMENT), airlied-AT-redhat.com, Abdiel Janulgue <abdiel.janulgue-AT-gmail.com>
Archive-link:  Article

This series aims to add support for pages that are not constructed by an
instance of the rust Page abstraction, for example those returned by
vmalloc_to_page() or virt_to_page().

Changes sinve v3:
- Use the struct page's reference count to decide when to free the
  allocation (Alice Ryhl, Boqun Feng).
- Make Page::page_slice_to_page handle virt_to_page cases as well
  (Danilo Krummrich).
- Link to v2: https://lore.kernel.org/lkml/20241022224832.1505432-1-abd...

Changes since v2:
- Use Owned and Ownable types for constructing Page as suggested in
  instad of using ptr::read().
- Link to v1: https://lore.kernel.org/rust-for-linux/20241007202752.309...

Abdiel Janulgue (2):
  rust: page: use the page's reference count to decide when to free the
    allocation
  rust: page: Extend support to existing struct page mappings

 rust/bindings/bindings_helper.h |   1 +
 rust/helpers/page.c             |  20 +++++
 rust/kernel/page.rs             | 135 ++++++++++++++++++++++++++++----
 3 files changed, 142 insertions(+), 14 deletions(-)


base-commit: b2603f8ac8217bc59f5c7f248ac248423b9b99cb
-- 
2.43.0




Copyright © 2024, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds