* [GIT PULL] Rust timekeeping for v6.17
@ 2025-07-07 7:46 Andreas Hindborg
2025-07-13 22:04 ` Miguel Ojeda
2025-07-17 0:02 ` Miguel Ojeda
0 siblings, 2 replies; 5+ messages in thread
From: Andreas Hindborg @ 2025-07-07 7:46 UTC (permalink / raw)
To: Miguel Ojeda
Cc: Boqun Feng, FUJITA Tomonori, Frederic Weisbecker, Lyude Paul,
Thomas Gleixner, Anna-Maria Behnsen, John Stultz, Stephen Boyd,
rust-for-linux@vger.kernel.org, rust-for-linux
Hi Miguel,
Please pull these changes for Rust timekeeping.
This batch of changes makes `Instant` generic over the clock source.
`HrTimer` also gets the generic treatment, allowing the API to type
check the time stamps passed to the API, to statically check whether a
relative or absolute time is required.
We also have a fix for 32-bit divisions on 64-bit architectures.
The commits have been in linux-next for at least a week.
The following changes since commit e04c78d86a9699d136910cfc0bdcf01087e3267e:
Linux 6.16-rc2 (2025-06-15 13:49:41 -0700)
are available in the Git repository at:
ssh://github.com/Rust-for-Linux/linux.git tags/rust-timekeeping-for-v6.17
for you to fetch changes up to d4b29ddf82a458935f1bd4909b8a7a13df9d3bdc:
rust: time: Add wrapper for fsleep() function (2025-06-30 13:22:05 +0200)
Best regards,
Andreas Hindborg
----------------------------------------------------------------
rust-timekeeping for v6.17
----------------------------------------------------------------
FUJITA Tomonori (10):
rust: time: Avoid 64-bit integer division on 32-bit architectures
rust: time: Replace ClockId enum with ClockSource trait
rust: time: Make Instant generic over ClockSource
rust: time: Add ktime_get() to ClockSource trait
rust: time: Replace HrTimerMode enum with trait-based mode types
rust: time: Add HrTimerExpires trait
rust: time: Make HasHrTimer generic over HrTimerMode
rust: time: Remove Ktime in hrtimer
rust: time: Seal the HrTimerMode trait
rust: time: Add wrapper for fsleep() function
rust/helpers/helpers.c | 1 +
rust/helpers/time.c | 35 +++++
rust/kernel/time.rs | 233 ++++++++++++++++++----------
rust/kernel/time/delay.rs | 49 ++++++
rust/kernel/time/hrtimer.rs | 302 ++++++++++++++++++++++++------------
rust/kernel/time/hrtimer/arc.rs | 8 +-
rust/kernel/time/hrtimer/pin.rs | 8 +-
rust/kernel/time/hrtimer/pin_mut.rs | 8 +-
rust/kernel/time/hrtimer/tbox.rs | 8 +-
9 files changed, 466 insertions(+), 186 deletions(-)
create mode 100644 rust/helpers/time.c
create mode 100644 rust/kernel/time/delay.rs
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [GIT PULL] Rust timekeeping for v6.17
2025-07-07 7:46 [GIT PULL] Rust timekeeping for v6.17 Andreas Hindborg
@ 2025-07-13 22:04 ` Miguel Ojeda
2025-07-15 7:57 ` Andreas Hindborg
2025-07-17 0:02 ` Miguel Ojeda
1 sibling, 1 reply; 5+ messages in thread
From: Miguel Ojeda @ 2025-07-13 22:04 UTC (permalink / raw)
To: Andreas Hindborg
Cc: Miguel Ojeda, Boqun Feng, FUJITA Tomonori, Frederic Weisbecker,
Lyude Paul, Thomas Gleixner, Anna-Maria Behnsen, John Stultz,
Stephen Boyd, rust-for-linux@vger.kernel.org
On Mon, Jul 7, 2025 at 9:47 AM Andreas Hindborg <a.hindborg@kernel.org> wrote:
>
> ----------------------------------------------------------------
> rust-timekeeping for v6.17
>
> ----------------------------------------------------------------
The description is empty -- could you please provide a bit of text?
No need to send a new PR, since I know you may be away from your usual
office these days -- I can copy it from email.
(Worst case, I will write something myself, but there is still time.)
Thanks!
Cheers,
Miguel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [GIT PULL] Rust timekeeping for v6.17
2025-07-13 22:04 ` Miguel Ojeda
@ 2025-07-15 7:57 ` Andreas Hindborg
2025-07-15 12:13 ` Miguel Ojeda
0 siblings, 1 reply; 5+ messages in thread
From: Andreas Hindborg @ 2025-07-15 7:57 UTC (permalink / raw)
To: Miguel Ojeda
Cc: Miguel Ojeda, Boqun Feng, FUJITA Tomonori, Frederic Weisbecker,
Lyude Paul, Thomas Gleixner, Anna-Maria Behnsen, John Stultz,
Stephen Boyd, rust-for-linux@vger.kernel.org
Hi Miguel,
"Miguel Ojeda" <miguel.ojeda.sandonis@gmail.com> writes:
> On Mon, Jul 7, 2025 at 9:47 AM Andreas Hindborg <a.hindborg@kernel.org> wrote:
>>
>> ----------------------------------------------------------------
>> rust-timekeeping for v6.17
>>
>> ----------------------------------------------------------------
>
> The description is empty -- could you please provide a bit of text?
>
> No need to send a new PR, since I know you may be away from your usual
> office these days -- I can copy it from email.
>
> (Worst case, I will write something myself, but there is still time.)
>
Sorry for the missing tag text. Let me know if you can use the following
bullets:
- Make `Instant` generic over clock source. This allows the compiler to
assert that arithmetic expressions involving the `Instant` use
`Instants` based on the same clock source.
- Make `HrTimer` generic over the timer mode. `HrTimer` timers take a
`Duration` or an `Instant` when setting the expiry time, depending on the
timer mode. With this change, the compiler can check the type matches the
timer mode.
- Add an abstraction for `fsleep`. `fsleep` is a flexible sleep function that
will select an appropriate sleep method depending on the requested sleep
time.
- Avoid 64-bit divisions on 32-bit hardware when calculating timestamps.
- Seal the `HrTimerMode` trait. This prevents users of the
`HrTimerMode` from implementing the trait on their own types.
Best regards,
Andreas Hindborg
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [GIT PULL] Rust timekeeping for v6.17
2025-07-15 7:57 ` Andreas Hindborg
@ 2025-07-15 12:13 ` Miguel Ojeda
0 siblings, 0 replies; 5+ messages in thread
From: Miguel Ojeda @ 2025-07-15 12:13 UTC (permalink / raw)
To: Andreas Hindborg
Cc: Miguel Ojeda, Boqun Feng, FUJITA Tomonori, Frederic Weisbecker,
Lyude Paul, Thomas Gleixner, Anna-Maria Behnsen, John Stultz,
Stephen Boyd, rust-for-linux@vger.kernel.org
On Tue, Jul 15, 2025 at 9:58 AM Andreas Hindborg <a.hindborg@kernel.org> wrote:
>
> Sorry for the missing tag text. Let me know if you can use the following
> bullets:
>
> - Make `Instant` generic over clock source. This allows the compiler to
> assert that arithmetic expressions involving the `Instant` use
> `Instants` based on the same clock source.
> - Make `HrTimer` generic over the timer mode. `HrTimer` timers take a
> `Duration` or an `Instant` when setting the expiry time, depending on the
> timer mode. With this change, the compiler can check the type matches the
> timer mode.
> - Add an abstraction for `fsleep`. `fsleep` is a flexible sleep function that
> will select an appropriate sleep method depending on the requested sleep
> time.
> - Avoid 64-bit divisions on 32-bit hardware when calculating timestamps.
> - Seal the `HrTimerMode` trait. This prevents users of the
> `HrTimerMode` from implementing the trait on their own types.
No worries at all, looks good, thanks!
Cheers,
Miguel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [GIT PULL] Rust timekeeping for v6.17
2025-07-07 7:46 [GIT PULL] Rust timekeeping for v6.17 Andreas Hindborg
2025-07-13 22:04 ` Miguel Ojeda
@ 2025-07-17 0:02 ` Miguel Ojeda
1 sibling, 0 replies; 5+ messages in thread
From: Miguel Ojeda @ 2025-07-17 0:02 UTC (permalink / raw)
To: Andreas Hindborg
Cc: Miguel Ojeda, Boqun Feng, FUJITA Tomonori, Frederic Weisbecker,
Lyude Paul, Thomas Gleixner, Anna-Maria Behnsen, John Stultz,
Stephen Boyd, rust-for-linux@vger.kernel.org
On Mon, Jul 7, 2025 at 9:47 AM Andreas Hindborg <a.hindborg@kernel.org> wrote:
>
> Please pull these changes for Rust timekeeping.
Merged into `rust-next` -- thank you!
(I applied the related fix on top.)
Cheers,
Miguel
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-07-17 0:03 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-07 7:46 [GIT PULL] Rust timekeeping for v6.17 Andreas Hindborg
2025-07-13 22:04 ` Miguel Ojeda
2025-07-15 7:57 ` Andreas Hindborg
2025-07-15 12:13 ` Miguel Ojeda
2025-07-17 0:02 ` Miguel Ojeda
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).