Skip to content

Commit f56352b

Browse files
mbrost05jfvogel
authored andcommitted
drm/xe: Retry BO allocation
[ Upstream commit 1d724a2f1b2c3f0cba4975784a808482e0631adf ] TTM doesn't support fair eviction via WW locking, this mitigated in by using retry loops in exec and preempt rebind worker. Extend this retry loop to BO allocation. Once TTM supports fair eviction this patch can be reverted. v4: - Keep line break (Stuart) Signed-off-by: Matthew Brost <[email protected]> Reviewed-by: Gwan-gyeong Mun <[email protected]> Reviewed-by: Stuart Summers <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Sasha Levin <[email protected]> (cherry picked from commit 4943c0bae1248fa69fba0872ebb6012d805f4c26) Signed-off-by: Jack Vogel <[email protected]>
1 parent cee9daa commit f56352b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/gpu/drm/xe/xe_bo.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1975,6 +1975,7 @@ int xe_gem_create_ioctl(struct drm_device *dev, void *data,
19751975
struct xe_file *xef = to_xe_file(file);
19761976
struct drm_xe_gem_create *args = data;
19771977
struct xe_vm *vm = NULL;
1978+
ktime_t end = 0;
19781979
struct xe_bo *bo;
19791980
unsigned int bo_flags;
19801981
u32 handle;
@@ -2047,6 +2048,10 @@ int xe_gem_create_ioctl(struct drm_device *dev, void *data,
20472048
vm = xe_vm_lookup(xef, args->vm_id);
20482049
if (XE_IOCTL_DBG(xe, !vm))
20492050
return -ENOENT;
2051+
}
2052+
2053+
retry:
2054+
if (vm) {
20502055
err = xe_vm_lock(vm, true);
20512056
if (err)
20522057
goto out_vm;
@@ -2060,6 +2065,8 @@ int xe_gem_create_ioctl(struct drm_device *dev, void *data,
20602065

20612066
if (IS_ERR(bo)) {
20622067
err = PTR_ERR(bo);
2068+
if (xe_vm_validate_should_retry(NULL, err, &end))
2069+
goto retry;
20632070
goto out_vm;
20642071
}
20652072

0 commit comments

Comments
 (0)