Skip to content

Add Rust version of might_sleep()

Boqun Feng lkml rust-for-linux 2 versions – Applied

Status from this message: The following commit has been merged into the sched/core branch of tip:

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest2 patches 2 repliesApplied
  2. v32 patches 16 repliesSuperseded

Changes in v4 from the cover letter

* Changed the name of Kconfig per Miguel's feedback.
* Added comments on the unstable feature file_with_nul per Miguel's feedback.
* Added an example for file_from_location() per Miguel's feedback.
* Changed the return type from kernel::str::CStr to core::ffi::CStr to align with Tamir's effort [5].
* Applied the documentation change for might_sleep() from Tomo.

Patches in v4 Applied

#Subject and filesSizeRepliesApplied
1/2rust: Introduce file_from_location()init/Kconfig rust/kernel/lib.rs+46 -02 replies
2/2rust: task: Add Rust version of might_sleep()rust/helpers/task.c rust/kernel/task.rs+30 -00 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchAlice Ryhl
1/2
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 0/2] Add Rust version of might_sleep()

Hi,

This is a v4 of Tomo's previous version:

v3: https://lore.kernel.org/rust-for-linux/[email protected]/
v2: https://lore.kernel.org/rust-for-linux/[email protected]/

Given Ingo's feedback [1], and the ongoing work at Rust side [2] (thanks Alice!), I think it's better that we just start to use Location::file_with_nul() if available, otherwise use a "this is not supported" as file names for might_sleep() debug output, this should be sufficient since might_sleep() only uses the file names for debug output, and it will also trigger a stack trace when error, so some callsite information can be gather from there too.

Having might_sleep() will unblock the support of read_poll_timeout() [3], and then wait_gfw_boot_completion() [4] in nova. So hopefully this will allow use moving forward.

I will a PR to tip including this updated version if no one objects. Thanks.

Changes since v3:

* Changed the name of Kconfig per Miguel's feedback.
* Added comments on the unstable feature file_with_nul per Miguel's feedback.
* Added an example for file_from_location() per Miguel's feedback.
* Changed the return type from kernel::str::CStr to core::ffi::CStr to align with Tamir's effort [5].
* Applied the documentation change for might_sleep() from Tomo.

[1]: https://lore.kernel.org/rust-for-linux/[email protected]/
[2]: https://github.com/rust-lang/rust/issues/141727
[3]: https://lore.kernel.org/lkml/[email protected]/
[4]: https://lore.kernel.org/rust-for-linux/[email protected]/
[5]: https://lore.kernel.org/rust-for-linux/[email protected]/

Regards,
Boqun

Boqun Feng (1):
rust: Introduce file_from_location()

FUJITA Tomonori (1):
rust: task: Add Rust version of might_sleep()

 init/Kconfig        |  3 +++
 rust/helpers/task.c |  6 ++++++
 rust/kernel/lib.rs  | 43 +++++++++++++++++++++++++++++++++++++++++++
 rust/kernel/task.rs | 24 ++++++++++++++++++++++++
 4 files changed, 76 insertions(+)
Signature · 1 line
2.39.5 (Apple Git-154)