From: Valentin Obst <kernel@valentinobst.de>
To: wedsonaf@gmail.com
Cc: a.hindborg@samsung.com, alex.gaynor@gmail.com,
aliceryhl@google.com, benno.lossin@proton.me,
bjorn3_gh@protonmail.com, boqun.feng@gmail.com, gary@garyguo.net,
linux-kernel@vger.kernel.org, ojeda@kernel.org,
rust-for-linux@vger.kernel.org, walmeida@microsoft.com
Subject: Re: [PATCH v2 0/5] In-place module initialisation
Date: Fri, 29 Mar 2024 13:10:33 +0100 [thread overview]
Message-ID: <20240329121033.401403-1-kernel@valentinobst.de> (raw)
In-Reply-To: <20240328195457.225001-1-wedsonaf@gmail.com>
> Introduce `InPlaceModule`, which allows modules to be initialised
> inplace, as opposed to the current state where modules must return an
> instance which is moved to its final memory location.
>
> This allows us to have modules whose state hold objects that must be
> initialised inplace like locks. It also allows us to implement
> registrations (e.g., driver registration) inplace and have them similar
> to their C counterparts where no new allocations are needed.
>
> This is built on top of the allocation APIs because the sample module is
> a modified version of rust_minimal, which would be incompatible with the
> allocation API series because it uses vectors.
>
> ---
>
> Changes in v2:
>
> - Rebased to latest rust-next
> - Split off adding `Send` requirement to `Module` into a separate patch
I think the idea in [1] was to have this patch being included in the
stable trees. I got little experience with stable trees but wouldn't the
easiest way be that you add:
Cc: stable@vger.kernel.org # 6.8.x: 715dd8950d4e rust: phy: implement `Send` for `Registration`
Cc: stable@vger.kernel.org
Fixes: 247b365dc8dc ("rust: add `kernel` crate")
in the sign-off section for this patch? (Or mark the first one for stable
inclusion as well, [2] has more information on that).
- Best Valentin
[1]: https://lore.kernel.org/rust-for-linux/20240327032337.188938-1-wedsonaf@gmail.com/T/#m4b4daf27038f920a0c6fafff453efb3c8da72067
[2]: https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html#option-1
> - Prefixed all `core` and `kernel` references with `::` in
> `module!` macro-generated code.
> - Calling `__pinned_init` with explicit full path.
> - Add `Mutex` to `rust_inplace` sample.
> - Added `Send` implementation for `Registration` in net/phy.
> - Link to v1: https://lore.kernel.org/rust-for-linux/20240327032337.188938-1-wedsonaf@gmail.com/T/#t
>
> ---
> Wedson Almeida Filho (5):
> rust: phy: implement `Send` for `Registration`
> rust: kernel: require `Send` for `Module` implementations
> rust: module: prefix all module paths with `::`
> rust: introduce `InPlaceModule`
> samples: rust: add in-place initialisation sample
>
> rust/kernel/lib.rs | 25 +++++++++++++++++++-
> rust/kernel/net/phy.rs | 4 ++++
> rust/macros/module.rs | 36 ++++++++++++-----------------
> samples/rust/Kconfig | 11 +++++++++
> samples/rust/Makefile | 1 +
> samples/rust/rust_inplace.rs | 44 ++++++++++++++++++++++++++++++++++++
> 6 files changed, 99 insertions(+), 22 deletions(-)
> create mode 100644 samples/rust/rust_inplace.rs
>
>
> base-commit: 453275c66aa4d87c73c5152140b3573ab2435bb7
> --
> 2.34.1
next prev parent reply other threads:[~2024-03-29 12:11 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-28 19:54 [PATCH v2 0/5] In-place module initialisation Wedson Almeida Filho
2024-03-28 19:54 ` [PATCH v2 1/5] rust: phy: implement `Send` for `Registration` Wedson Almeida Filho
2024-03-29 0:53 ` FUJITA Tomonori
2024-04-04 12:46 ` Alice Ryhl
2024-03-28 19:54 ` [PATCH v2 2/5] rust: kernel: require `Send` for `Module` implementations Wedson Almeida Filho
2024-03-30 11:58 ` Benno Lossin
2024-04-04 12:47 ` Alice Ryhl
2024-03-28 19:54 ` [PATCH v2 3/5] rust: module: prefix all module paths with `::` Wedson Almeida Filho
2024-03-30 11:46 ` Benno Lossin
2024-04-04 12:47 ` Alice Ryhl
2024-03-28 19:54 ` [PATCH v2 4/5] rust: introduce `InPlaceModule` Wedson Almeida Filho
2024-04-04 12:48 ` Alice Ryhl
2024-03-28 19:54 ` [PATCH v2 5/5] samples: rust: add in-place initialisation sample Wedson Almeida Filho
2024-03-30 11:49 ` Benno Lossin
2024-04-04 12:48 ` Alice Ryhl
2024-03-29 12:10 ` Valentin Obst [this message]
2024-03-29 13:03 ` [PATCH v2 0/5] In-place module initialisation Miguel Ojeda
2024-03-29 14:00 ` Valentin Obst
2024-03-29 14:26 ` Miguel Ojeda
2024-04-23 0:42 ` Miguel Ojeda
2024-06-14 0:39 ` Danilo Krummrich
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=20240329121033.401403-1-kernel@valentinobst.de \
--to=kernel@valentinobst.de \
--cc=a.hindborg@samsung.com \
--cc=alex.gaynor@gmail.com \
--cc=aliceryhl@google.com \
--cc=benno.lossin@proton.me \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun.feng@gmail.com \
--cc=gary@garyguo.net \
--cc=linux-kernel@vger.kernel.org \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=walmeida@microsoft.com \
--cc=wedsonaf@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).