Re: [PATCH] rust: page: mark Page::nid as inline

From: Gary Guo

Date: Fri May 29 2026 - 08:19:33 EST


On Fri May 29, 2026 at 9:53 AM BST, Nakamura Shuta wrote:
> When building the kernel, the following Rust symbol is generated:
>
> $ nm vmlinux | grep ' _R'.*Page | rustfilt
> <kernel::page::Page>::nid
>
> `Page::nid` is a trivial wrapper around the C function `page_to_nid`.
> It does not make sense to go through a trivial wrapper for this function,
> so mark it inline.
>
> This follows commit 878620c5a93a ("rust: page: optimize rust symbol
> generation for Page"), which did the same for `alloc_page` and `drop`.
>
> Link: https://github.com/Rust-for-Linux/linux/issues/1145
> Signed-off-by: Nakamura Shuta <nakamura.shuta@xxxxxxxxx>

Reviewed-by: Gary Guo <gary@xxxxxxxxxxx>

> ---
> rust/kernel/page.rs | 1 +
> 1 file changed, 1 insertion(+)