mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Laura Nao <laura.nao@collabora.com>
To: dakr@kernel.org
Cc: a.hindborg@kernel.org, acourbot@nvidia.com, airlied@gmail.com,
	aliceryhl@google.com, beata.michalska@arm.com,
	bjorn3_gh@protonmail.com, boqun@kernel.org,
	daniel.almeida@collabora.com, deborah.brouwer@collabora.com,
	dri-devel@lists.freedesktop.org, gary@garyguo.net,
	kernel@collabora.com, laura.nao@collabora.com,
	linux-kernel@vger.kernel.org, ojeda@kernel.org,
	rust-for-linux@vger.kernel.org, simona@ffwll.ch,
	tamird@kernel.org, tmgross@umich.edu, work@onurozkan.dev
Subject: Re: [PATCH 1/2] drm/tyr: add Wait type for GPU events
Date: Mon, 27 Jul 2026 11:04:50 +0200	[thread overview]
Message-ID: <20260727090450.16462-1-laura.nao@collabora.com> (raw)
In-Reply-To: <DK4CW8JXVL8M.2KKRMJVCD9AYO@kernel.org>

Hi Danilo,

On 7/21/26 17:32, Danilo Krummrich wrote:
> On Tue Jul 21, 2026 at 5:14 PM CEST, Laura Nao wrote:
>> +/// A convenience type to wait for GPU events.
>> +///
>> +/// Wraps a [`CondVar`] and [`Mutex`] pair. The mutex synchronizes predicate checks
>> +/// with wait/wake operations; the condvar provides the sleep/wake mechanism.
>> +#[pin_data]
>> +pub(crate) struct Wait {
>> +    /// The actual wait/signal mechanism.
>> +    #[pin]
>> +    cond: CondVar,
>> +    /// Synchronizes waiters with notifications.
>> +    #[pin]
>> +    lock: Mutex<()>,
>> +}
>
> This is backwards; if I get this right at a quick glance it is basically abusing
> CondVar to implement a WaitQueue abstraction in your driver.
>
> What you actually seem to look for is a proper WaitQueue abstraction, which
> could then also be used to simplify the implementation of CondVar.
>
> I'm already working on a WaitQueue abstraction, since I need it elsewhere. I can
> probably post something in a few days.
>
> (I didn't check your use-case but you may want to consider completions and
> simple waitqueue as well.)

I noticed the WaitQueue abstraction has now been sent on the ML [1]. 
I'll start reworking this series to work on top of that.

Thanks for the feedback/pointers!

Best,
Laura

[1] https://lore.kernel.org/rust-for-linux/20260726223613.1242940-1-dakr@kernel.org/

  reply	other threads:[~2026-07-27  9:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-21 15:14 [PATCH 0/2] drm/tyr: add Job IRQ handling and GPU event wait support Laura Nao
2026-07-21 15:14 ` [PATCH 1/2] drm/tyr: add Wait type for GPU events Laura Nao
2026-07-21 15:32   ` Danilo Krummrich
2026-07-27  9:04     ` Laura Nao [this message]
2026-07-21 15:14 ` [PATCH 2/2] drm/tyr: add Job IRQ handling Laura Nao

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=20260727090450.16462-1-laura.nao@collabora.com \
    --to=laura.nao@collabora.com \
    --cc=a.hindborg@kernel.org \
    --cc=acourbot@nvidia.com \
    --cc=airlied@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=beata.michalska@arm.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun@kernel.org \
    --cc=dakr@kernel.org \
    --cc=daniel.almeida@collabora.com \
    --cc=deborah.brouwer@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gary@garyguo.net \
    --cc=kernel@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=simona@ffwll.ch \
    --cc=tamird@kernel.org \
    --cc=tmgross@umich.edu \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®