Re: [PATCH] rust: xarray: optimize lock functions with inline attribute

From: Alice Ryhl
Date: Mon Aug 18 2025 - 04:04:42 EST


On Mon, Aug 18, 2025 at 3:27 AM <lingfuyi@xxxxxxx> wrote:
>
> From: lingfuyi <lingfuyi@xxxxxxxxxx>
>
> The XArray lock and try_lock functions are simple wrappers around
> the C functions xa_lock and xa_trylock. These Rust functions don't
> add significant logic beyond the unsafe FFI calls and safety guarantees.
>
> Mark them as inline to avoid unnecessary function call overhead in
> hot paths where XArray locking is frequent, such as in page cache
> operations and other kernel data structure management.
>
> This follows the same optimization pattern as other Rust kernel
> modules where simple C function wrappers are marked inline to
> improve performance.
>
> Signed-off-by: lingfuyi <lingfuyi@xxxxxxxxxx>

Thanks for the patch. Please see the Developer’s Certificate of Origin 1.1
https://docs.kernel.org/process/submitting-patches.html#developer-s-certificate-of-origin-1-1

You need to use a known identity such as your real name to submit
patches to the kernel. Anonymous contributions aren't possible.

Also please include a version number in the email subject when sending
a new version of a patch.

Alice