From: "Danilo Krummrich" <dakr@kernel.org>
To: "Philipp Stanner" <phasta@mailbox.org>
Cc: phasta@kernel.org, "Matthew Brost" <matthew.brost@intel.com>,
"Christian König" <ckoenig.leichtzumerken@gmail.com>,
"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
"Maxime Ripard" <mripard@kernel.org>,
"Thomas Zimmermann" <tzimmermann@suse.de>,
"David Airlie" <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] drm/sched: Guard sched->ready with ACCESS_ONCE()
Date: Mon, 06 Jul 2026 13:38:32 +0200 [thread overview]
Message-ID: <DJRGJ2WRZJE0.3E2KH7DEC4LAA@kernel.org> (raw)
In-Reply-To: <2abbd54a7908f5ee82bcffb22bf0dccc05734bbe.camel@mailbox.org>
On Mon Jul 6, 2026 at 10:44 AM CEST, Philipp Stanner wrote:
> On Mon, 2026-06-29 at 14:09 +0200, Danilo Krummrich wrote:
>> > + WRITE_ONCE(sched->ready, false);
>>
>> Don't we need smp_store_release() here and
>>
>> > + return READ_ONCE(sched->ready);
>> smp_load_acquire() here?
>
> Maybe. Not sure what the precise access rules would be. To really get
> correctness, all counter-parties you found in amdgpu would have to
> remove their layering violations anyways, which is beyond my scope.
Fair enough, let's get it right in the core infrastructure then.
>> Also, what about drm_sched_init()? It also seems that this is accessed from
>> amdgpu without the drm_sched_wqueue_ready() helper about a million times. :)
>>
>> $ grep -Rin "sched\.ready" drivers/gpu/drm/amd | wc
>> $ 119 544 10320
>>
>> There may be false positives, but from a quick glance at least most of them seem
>> to actually come from the scheduler.
>
> Correct.
>
> Your ordering comment hints at me that you would rather see the ready-
> flag be left as is, if it can't be made right 100% (which it can't).
No, the change makes sense. Getting it right in the core infrastructure is the
right thing to do, even if you don't want to fix up amdgpu.
prev parent reply other threads:[~2026-07-06 11:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-29 10:40 [PATCH 1/2] drm/sched: Guard sched->ready with ACCESS_ONCE() Philipp Stanner
2026-06-29 10:40 ` [PATCH 2/2] drm/sched: Deprecate drm_sched_wqueue_ready() Philipp Stanner
2026-06-29 11:57 ` Danilo Krummrich
2026-06-29 10:52 ` [PATCH 1/2] drm/sched: Guard sched->ready with ACCESS_ONCE() sashiko-bot
2026-06-29 12:09 ` Danilo Krummrich
2026-07-06 8:44 ` Philipp Stanner
2026-07-06 11:38 ` Danilo Krummrich [this message]
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=DJRGJ2WRZJE0.3E2KH7DEC4LAA@kernel.org \
--to=dakr@kernel.org \
--cc=airlied@gmail.com \
--cc=ckoenig.leichtzumerken@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=matthew.brost@intel.com \
--cc=mripard@kernel.org \
--cc=phasta@kernel.org \
--cc=phasta@mailbox.org \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
/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.