From: "Gary Guo" <gary@garyguo.net>
To: "Danilo Krummrich" <dakr@kernel.org>, <boqun@kernel.org>,
<gary@garyguo.net>, <aliceryhl@google.com>, <lyude@redhat.com>,
<daniel.almeida@collabora.com>, <work@onurozkan.dev>,
<ojeda@kernel.org>, <bjorn3_gh@protonmail.com>,
<lossin@kernel.org>, <a.hindborg@kernel.org>, <tmgross@umich.edu>,
<tamird@kernel.org>, <acourbot@nvidia.com>,
<viro@zeniv.linux.org.uk>, <brauner@kernel.org>, <jack@suse.cz>
Cc: <linux-kernel@vger.kernel.org>, <rust-for-linux@vger.kernel.org>,
<linux-fsdevel@vger.kernel.org>
Subject: Re: [PATCH v3 3/5] rust: sync: convert CondVar and PollCondVar to use WaitQueue
Date: Wed, 18 Nov 2026 10:49:45 +0000 [thread overview]
Message-ID: <DMYA19YYRRJO.2KQF9PAODA2DS@garyguo.net> (raw)
In-Reply-To: <20261117001507.1611984-4-dakr@kernel.org>
On Tue Nov 17, 2026 at 12:14 AM GMT, Danilo Krummrich wrote:
> CondVar currently wraps a raw wait_queue_head directly. Now that
> WaitQueue provides the same primitive, convert CondVar to use it
> instead. This removes duplicate init, pinning, Send/Sync, and wake-up
> code from CondVar.
>
> Keep the wait logic in CondVar since it needs to release and reacquire a
> lock guard around the sleep, which WaitQueue's condition-based
> wait_event() methods do not handle. Use wait_once_exclusive() to perform
> a single prepare_to_wait_exclusive / finish_wait cycle with a
> caller-provided schedule function to implement the lock-aware sleep.
>
> Adapt PollCondVar accordingly.
>
> Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Reviewed-by: Gary Guo <gary@garyguo.net>
> ---
> rust/kernel/sync/condvar.rs | 89 +++++++++++--------------------------
> rust/kernel/sync/poll.rs | 19 ++++----
> rust/kernel/sync/wait.rs | 2 -
> 3 files changed, 33 insertions(+), 77 deletions(-)
next prev parent reply other threads:[~2026-11-18 10:49 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-17 0:14 [PATCH v3 0/5] rust: sync: add WaitQueue infrastructure Danilo Krummrich
2026-11-17 0:14 ` [PATCH v3 1/5] rust: task: add safe schedule_timeout() wrapper Danilo Krummrich
2026-11-17 0:45 ` FUJITA Tomonori
2026-11-17 11:40 ` Gary Guo
2026-11-17 11:56 ` Danilo Krummrich
2026-11-17 12:02 ` Gary Guo
2026-11-17 13:14 ` Danilo Krummrich
2026-11-17 14:16 ` Alice Ryhl
2026-11-17 0:14 ` [PATCH v3 2/5] rust: sync: add WaitQueue infrastructure Danilo Krummrich
2026-11-17 11:59 ` Gary Guo
2026-11-17 14:16 ` Alice Ryhl
2026-11-17 0:14 ` [PATCH v3 3/5] rust: sync: convert CondVar and PollCondVar to use WaitQueue Danilo Krummrich
2026-11-17 14:16 ` Alice Ryhl
2026-11-18 10:49 ` Gary Guo [this message]
2026-11-17 0:14 ` [PATCH v3 4/5] rust: sync: condvar: use task::schedule_timeout() Danilo Krummrich
2026-11-17 14:16 ` Alice Ryhl
2026-11-17 22:06 ` FUJITA Tomonori
2026-11-17 0:14 ` [PATCH v3 5/5] rust: sync: condvar: add non-exclusive freezable waiting Danilo Krummrich
2026-11-17 14:16 ` Alice Ryhl
2026-11-18 10:49 ` Gary Guo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DMYA19YYRRJO.2KQF9PAODA2DS@garyguo.net \
--to=gary@garyguo.net \
--cc=a.hindborg@kernel.org \
--cc=acourbot@nvidia.com \
--cc=aliceryhl@google.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun@kernel.org \
--cc=brauner@kernel.org \
--cc=dakr@kernel.org \
--cc=daniel.almeida@collabora.com \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=lyude@redhat.com \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=tamird@kernel.org \
--cc=tmgross@umich.edu \
--cc=viro@zeniv.linux.org.uk \
--cc=work@onurozkan.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.