diff options
author | Rob Clark <robdclark@chromium.org> | 2024-09-13 13:23:01 -0700 |
---|---|---|
committer | Danilo Krummrich <dakr@kernel.org> | 2024-09-24 01:14:16 +0200 |
commit | 440d52b370b03b366fd26ace36bab20552116145 (patch) | |
tree | ad9d39f09784e8d1ba0145f953d965b45ebf1fbe /tools/perf/scripts/python/export-to-sqlite.py | |
parent | a3096328462b1e022c6294898c440708ea11509a (diff) | |
download | linux-440d52b370b03b366fd26ace36bab20552116145.tar.gz linux-440d52b370b03b366fd26ace36bab20552116145.tar.bz2 linux-440d52b370b03b366fd26ace36bab20552116145.zip |
drm/sched: Fix dynamic job-flow control race
Fixes a race condition reported here: https://github.com/AsahiLinux/linux/issues/309#issuecomment-2238968609
The whole premise of lockless access to a single-producer-single-
consumer queue is that there is just a single producer and single
consumer. That means we can't call drm_sched_can_queue() (which is
about queueing more work to the hw, not to the spsc queue) from
anywhere other than the consumer (wq).
This call in the producer is just an optimization to avoid scheduling
the consuming worker if it cannot yet queue more work to the hw. It
is safe to drop this optimization to avoid the race condition.
Suggested-by: Asahi Lina <lina@asahilina.net>
Fixes: a78422e9dff3 ("drm/sched: implement dynamic job-flow control")
Closes: https://github.com/AsahiLinux/linux/issues/309
Cc: stable@vger.kernel.org
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Danilo Krummrich <dakr@kernel.org>
Tested-by: Janne Grunau <j@jannau.net>
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240913202301.16772-1-robdclark@gmail.com
Diffstat (limited to 'tools/perf/scripts/python/export-to-sqlite.py')
0 files changed, 0 insertions, 0 deletions