Skip to content

hrtimer: Add hrtimer_forward_safe_from_callback()

FUJITA Tomonori lkml rust-for-linux 1 version Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 5 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/2hrtimer: Add hrtimer_forward_safe_from_callback()include/linux/hrtimer.h kernel/time/hrtimer.c+34 -01 reply
2/2rust: hrtimer: Use hrtimer_forward_safe_from_callback()rust/kernel/time/hrtimer.rs+18 -73 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchAndreas HindborgThomas Gleixner
1/2R-b
2/2R-b

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

Read the v1 thread

Cover letter [PATCH v1 0/2] hrtimer: Add hrtimer_forward_safe_from_callback()

From: FUJITA Tomonori <[email protected]>

Safe Rust code can arm a timer while its callback is running, so the Rust abstraction cannot offer hrtimer_forward() from the callback as a safe API.

Thomas suggested a helper that does the check and the update with the base lock held [1]. Patch 1 adds it. Patch 2 makes the Rust callback context use it.

The helper is not Rust specific. As Thomas noted, it can be used for i915_pmu too. null_blk can use it as well. I can send those conversions after the helper is merged.

[1] https://lore.kernel.org/all/877bk3ixp5.ffs@fw13/

FUJITA Tomonori (2):
hrtimer: Add hrtimer_forward_safe_from_callback()
rust: hrtimer: Use hrtimer_forward_safe_from_callback()

 include/linux/hrtimer.h     |  4 ++++
 kernel/time/hrtimer.c       | 30 ++++++++++++++++++++++++++++++
 rust/kernel/time/hrtimer.rs | 25 ++++++++++++++++++-------
 3 files changed, 52 insertions(+), 7 deletions(-)

base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4

Signature · 1 line
2.43.0