[PATCH v4 0/2] rust: add a few helpers

From: Andreas Hindborg

Date: Fri Oct 30 2026 - 12:08:38 EST


This series adds a helper for obtaining information about the cpu count of
the system. It also moves the `NumaNode` struct from `alloc` to `numa`.

Signed-off-by: Andreas Hindborg <a.hindborg@xxxxxxxxxx>
---
Changes in v4:
- Dropped patch 1 of v3 (moved to separate series).
- Rebase on v7.3.
- Link to v3: https://msgid.link/20260929-cpu-helpers-v3-0-e968ce5ee613@xxxxxxxxxx

Changes in v3:
- Drop Alice tag on patch 2 due to restructuring.
- Use a relaxed load to read `nr_online_nodes` (Gary).
- Move `NumaNode` from the `alloc` module to the `numa` module in a
new patch (Alice).
- Rebase on v7.3-rc5.
- Link to v2: https://msgid.link/20260605-cpu-helpers-v2-0-0ad227f0d91b@xxxxxxxxxx

Changes in v2:
- Move helpers out of the crate root into the `cpu` and `numa`
modules (Miguel).
- Mark Rust wrappers `#[inline]` (Alice).
- Mark the `num_possible_cpus` C helper `__rust_helper` (Dirk).
- Mention the Rust null block driver as the consumer in commit
messages (Miguel).
- Link to v1: https://msgid.link/20260215-cpu-helpers-v1-0-fab13d817a5e@xxxxxxxxxx

---
Andreas Hindborg (2):
rust: add a wrapper for the `nr_online_nodes` C function
rust: alloc: move `NumaNode` to the `numa` module

rust/kernel/alloc.rs | 30 +++-----------------
rust/kernel/alloc/allocator.rs | 6 ++--
rust/kernel/alloc/kbox.rs | 4 +--
rust/kernel/alloc/kvec.rs | 4 +--
rust/kernel/lib.rs | 1 +
rust/kernel/numa.rs | 62 ++++++++++++++++++++++++++++++++++++++++++
6 files changed, 74 insertions(+), 33 deletions(-)
---
base-commit: c03c1a14507dfaf8b856c2608f9ac216021fc222
change-id: 20260215-cpu-helpers-08efb2572487

Best regards,
--
Andreas Hindborg <a.hindborg@xxxxxxxxxx>