-
Notifications
You must be signed in to change notification settings - Fork 55.8k
Comparing changes
Open a pull request
base repository: torvalds/linux
base: master
head repository: Rust-for-Linux/linux
compare: rust-next
- 7 commits
- 13 files changed
- 5 contributors
Commits on May 11, 2025
-
rust: page: optimize rust symbol generation for Page
When build the kernel using the llvm-18.1.3-rust-1.85.0-x86_64 with ARCH=arm64, the following symbols are generated: $nm vmlinux | grep ' _R'.*Page | rustfilt ffff8000805b6f98 T <kernel::page::Page>::alloc_page ffff8000805b715c T <kernel::page::Page>::fill_zero_raw ffff8000805b720c T <kernel::page::Page>::copy_from_user_slice_raw ffff8000805b6fb4 T <kernel::page::Page>::read_raw ffff8000805b7088 T <kernel::page::Page>::write_raw ffff8000805b72fc T <kernel::page::Page as core::ops::drop::Drop>::drop These Rust symbols(alloc_page and drop) are trivial wrappers around the C functions alloc_pages and __free_pages. It doesn't make sense to go through a trivial wrapper for these functions, so mark them inline. Link: Rust-for-Linux#1145 Suggested-by: Alice Ryhl <[email protected]> Co-developed-by: Grace Deng <[email protected]> Signed-off-by: Grace Deng <[email protected]> Signed-off-by: Kunwu Chan <[email protected]> Reviewed-by: Alice Ryhl <[email protected]> Link: https://lore.kernel.org/r/[email protected] [ Removed spurious colon in title. - Miguel ] Signed-off-by: Miguel Ojeda <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 878620c - Browse repository at this point
Copy the full SHA 878620cView commit details -
docs: rust: explain that
///
vs.//
applies to private items tooSometimes kernel developers use `//` for documenting private items, since those do not get rendered at the moment. That is reasonable, but the intention behind `///` (and `//!`) vs. `//` is to convey the distinction between documentation and other kinds of comments, such as implementation details or TODOs. It also increases consistency with the public items and thus e.g. allows to change visibility of an item with less changes involved. It is not just useful for human readers, but also tooling. For instance, we may want to eventually generate documentation for private items (perhaps as a toggle in the HTML UI). On top of that, `rustdoc` lints as usual for those, too, so we may want to do it even if we do not use the result. Thus document this explicitly. Link: https://lore.kernel.org/rust-for-linux/CANiq72n_C7exSOMe5yf-7jKKnhSCv+a9QcD=OE2B_Q2UFBL3Xg@mail.gmail.com/ Link: Rust-for-Linux#1157 Reviewed-by: Alice Ryhl <[email protected]> Reviewed-by: Christian Schrefl <[email protected]> Reviewed-by: Viresh Kumar <[email protected]> Link: https://lore.kernel.org/r/[email protected] [ Fixed typo. - Miguel ] Signed-off-by: Miguel Ojeda <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 79d04e7 - Browse repository at this point
Copy the full SHA 79d04e7View commit details -
rust: static_assert: add optional message
Add an optional panic message to the `static_assert!` macro. The panic message doesn't support argument formatting, because the `assert!` macro only supports formatting in non-const contexts. Suggested-by: Miguel Ojeda <[email protected]> Link: Rust-for-Linux#1149 Signed-off-by: Altan Ozlu <[email protected]> Reviewed-by: Benno Lossin <[email protected]> Reviewed-by: Trevor Gross <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Miguel Ojeda <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 0fa5f8c - Browse repository at this point
Copy the full SHA 0fa5f8cView commit details -
rust: uaccess: take advantage of the prelude and
Result
's defaultsThe `kernel` prelude brings `Result` and the error codes; and the prelude itself is already available in the examples automatically. In addition, `Result` already defaults to `T = ()`. Thus simplify. Reviewed-by: Alice Ryhl <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Miguel Ojeda <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 7d8dee4 - Browse repository at this point
Copy the full SHA 7d8dee4View commit details -
rust: clarify the language unstable features in use
We track the details of which Rust features we use at our usual "live list" [1] (and its sub-lists), but in light of a discussion in the LWN article [2], it would help to clarify it in the source code. In particular, we are very close to rely only on stable Rust language-wise -- essentially only two language features remain (including the `kernel` crate). Thus add some details in both the feature list of the `kernel` crate as well as the list of allowed features. This does not over every single feature, and there are quite a few non-language features that we use too. To have the full picture, please refer to [1]. Link: Rust-for-Linux#2 [1] Link: https://lwn.net/Articles/1015409/ [2] Suggested-by: Andreas Hindborg <[email protected]> Reviewed-by: Benno Lossin <[email protected]> Link: https://lore.kernel.org/r/[email protected] [ Improved comments with suggestions from the list. - Miguel ] Signed-off-by: Miguel Ojeda <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for b9b701f - Browse repository at this point
Copy the full SHA b9b701fView commit details -
rust: convert raw URLs to Markdown autolinks in comments
Some comments in Rust files use raw URLs (http://example.com) rather than Markdown autolinks <URL>. This inconsistency makes the documentation less uniform and harder to maintain. This patch converts all remaining raw URLs in Rust code comments to use the Markdown autolink format, maintaining consistency with the rest of the codebase which already uses this style. Suggested-by: Miguel Ojeda <[email protected]> Link: Rust-for-Linux#1153 Signed-off-by: Xizhe Yin <[email protected]> Link: https://lore.kernel.org/r/[email protected] [ Used From form for Signed-off-by. Sorted tags. - Miguel ] Signed-off-by: Miguel Ojeda <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 86d990c - Browse repository at this point
Copy the full SHA 86d990cView commit details -
rust: replace rustdoc references to alloc::format
Replace alloc::format[1] in the pr_* and dev_* macros' doc comments with std::format[2] because they are identical but less likely to get confused with the kernel's alloc crate. And add a url link for the std::format! macro. Link: https://doc.rust-lang.org/alloc/macro.format.html [1] Link: https://doc.rust-lang.org/std/macro.format.html [2] Reviewed-by: Benno Lossin <[email protected]> Signed-off-by: Andrew Ballance <[email protected]> Link: https://lore.kernel.org/r/[email protected] [ Fixed typo and reworded slightly. - Miguel ] Signed-off-by: Miguel Ojeda <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for edc5e6e - Browse repository at this point
Copy the full SHA edc5e6eView commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff master...rust-next