[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8c1b98e8-a1e4-4466-a9ca-72b9923bb2e2@proton.me>
Date: Wed, 10 Jan 2024 10:01:13 +0000
From: Benno Lossin <benno.lossin@...ton.me>
To: Alice Ryhl <aliceryhl@...gle.com>, Miguel Ojeda <ojeda@...nel.org>, Alex Gaynor <alex.gaynor@...il.com>, Wedson Almeida Filho <wedsonaf@...il.com>, Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>, Björn Roy Baron <bjorn3_gh@...tonmail.com>, Andreas Hindborg <a.hindborg@...sung.com>, Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>, Will Deacon <will@...nel.org>, Waiman Long <longman@...hat.com>, Tiago Lam <tiagolam@...il.com>, Thomas Gleixner <tglx@...utronix.de>
Cc: Martin Rodriguez Reboredo <yakoyoku@...il.com>, rust-for-linux@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 3/4] rust: sync: add `CondVar::wait_timeout`
On 08.01.24 15:49, Alice Ryhl wrote:
> Sleep on a condition variable with a timeout.
>
> This is used by Rust Binder for process freezing. There, we want to
> sleep until the freeze operation completes, but we want to be able to
> abort the process freezing if it doesn't complete within some timeout.
>
> Note that it is not enough to avoid jiffies by introducing a variant of
> `CondVar::wait_timeout` that takes the timeout in msecs because we need
> to be able to restart the sleep with the remaining sleep duration if it
> is interrupted, and if the API takes msecs rather than jiffies, then
> that would require a conversion roundtrip jiffies->msecs->jiffies that
> is best avoided.
>
> Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@...il.com>
> Reviewed-by: Tiago Lam <tiagolam@...il.com>
> Reviewed-by: Boqun Feng <boqun.feng@...il.com>
> Signed-off-by: Alice Ryhl <aliceryhl@...gle.com>
> ---
> rust/kernel/sync/condvar.rs | 60 ++++++++++++++++++++++++++++++++++++++++-----
> rust/kernel/sync/lock.rs | 4 +--
> rust/kernel/task.rs | 5 +++-
> 3 files changed, 60 insertions(+), 9 deletions(-)
Reviewed-by: Benno Lossin <benno.lossin@...ton.me>
--
Cheers,
Benno
Powered by blists - more mailing lists