mirror of
https://github.com/openbsd/src.git
synced 2026-06-18 07:13:36 +02:00
drm/ttm: Convert -EAGAIN from dmem_cgroup_try_charge to -ENOSPC
From Thomas Hellstrom 9a34b94832c374543ce553d4cec6eda6955397d1 in linux-6.18.y/6.18.33 591711b32681a04b57d00c2a404658f8419a081c in mainline linux
This commit is contained in:
@@ -739,7 +739,7 @@ static int ttm_bo_alloc_resource(struct ttm_buffer_object *bo,
|
||||
may_evict = (force_space && place->mem_type != TTM_PL_SYSTEM);
|
||||
ret = ttm_resource_alloc(bo, place, res, force_space ? &limit_pool : NULL);
|
||||
if (ret) {
|
||||
if (ret != -ENOSPC && ret != -EAGAIN) {
|
||||
if (ret != -ENOSPC) {
|
||||
dmem_cgroup_pool_state_put(limit_pool);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -384,8 +384,11 @@ int ttm_resource_alloc(struct ttm_buffer_object *bo,
|
||||
|
||||
if (man->cg) {
|
||||
ret = dmem_cgroup_try_charge(man->cg, bo->base.size, &pool, ret_limit_pool);
|
||||
if (ret)
|
||||
if (ret) {
|
||||
if (ret == -EAGAIN)
|
||||
ret = -ENOSPC;
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
ret = man->func->alloc(man, bo, place, res_ptr);
|
||||
|
||||
Reference in New Issue
Block a user