From: Matthew Brost <matthew.brost@intel.com>
To: <intel-xe@lists.freedesktop.org>
Cc: Sai Gowtham Ch <sai.gowtham.ch@intel.com>
Subject: [PATCH] drm/xe: Fix exec IOCTL long running exec queue ring full condition
Date: Thu, 4 Jan 2024 00:09:09 -0800 [thread overview]
Message-ID: <20240104080909.1271480-1-matthew.brost@intel.com> (raw)
The intent is to return -EWOULDBLOCK to the user if a long running exec
queue is full during the exec IOCTL. -EWOULDBLOCK aliases to -EAGAIN
which results in the exec IOCTL doing a retry loop. Fix this by ensuring
the retry loop is broken when returning -EWOULDBLOCK.
Fixes: 8ae8a2e8dd21 ("drm/xe: Long running job update")
Reported-by: Sai Gowtham Ch <sai.gowtham.ch@intel.com>
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
---
drivers/gpu/drm/xe/xe_exec.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_exec.c b/drivers/gpu/drm/xe/xe_exec.c
index d30c0d0689bc..c68e1bd15e6a 100644
--- a/drivers/gpu/drm/xe/xe_exec.c
+++ b/drivers/gpu/drm/xe/xe_exec.c
@@ -115,7 +115,7 @@ int xe_exec_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
struct xe_sched_job *job;
struct dma_fence *rebind_fence;
struct xe_vm *vm;
- bool write_locked;
+ bool write_locked, skip_eagain = false;
ktime_t end = 0;
int err = 0;
@@ -227,7 +227,8 @@ int xe_exec_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
}
if (xe_exec_queue_is_lr(q) && xe_exec_queue_ring_full(q)) {
- err = -EWOULDBLOCK;
+ err = -EWOULDBLOCK; /* Aliased to -EAGAIN */
+ skip_eagain = true;
goto err_exec;
}
@@ -337,7 +338,7 @@ int xe_exec_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
up_write(&vm->lock);
else
up_read(&vm->lock);
- if (err == -EAGAIN)
+ if (err == -EAGAIN && !skip_eagain)
goto retry;
err_syncs:
for (i = 0; i < num_syncs; i++)
--
2.34.1
next reply other threads:[~2024-01-04 8:08 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-04 8:09 Matthew Brost [this message]
2024-01-04 17:21 ` ✓ CI.Patch_applied: success for drm/xe: Fix exec IOCTL long running exec queue ring full condition Patchwork
2024-01-04 17:21 ` ✗ CI.checkpatch: warning " Patchwork
2024-01-04 17:22 ` ✓ CI.KUnit: success " Patchwork
2024-01-04 17:30 ` ✓ CI.Build: " Patchwork
2024-01-04 17:30 ` ✓ CI.Hooks: " Patchwork
2024-01-04 17:31 ` ✓ CI.checksparse: " Patchwork
2024-01-04 18:06 ` ✓ CI.BAT: " Patchwork
2024-01-04 21:55 ` [PATCH] " Welty, Brian
2024-01-05 3:32 ` Matthew Brost
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=20240104080909.1271480-1-matthew.brost@intel.com \
--to=matthew.brost@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=sai.gowtham.ch@intel.com \
/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