diff options
author | Christian König <christian.koenig@amd.com> | 2020-11-02 13:01:53 +0100 |
---|---|---|
committer | Christian König <christian.koenig@amd.com> | 2020-11-04 11:22:46 +0100 |
commit | 586052b0a6062e2fa98189d7f24d8cb9ccf4258b (patch) | |
tree | f5a670bbb0fe611e3b8aeebfb8efc7292e37adc7 /include/drm | |
parent | d74252bb8f0e38194e7457f7b4e5a8a33514bc24 (diff) | |
download | linux-586052b0a6062e2fa98189d7f24d8cb9ccf4258b.tar.gz linux-586052b0a6062e2fa98189d7f24d8cb9ccf4258b.tar.bz2 linux-586052b0a6062e2fa98189d7f24d8cb9ccf4258b.zip |
drm/ttm: rework no_retry handling v2
During eviction we do want to trigger the OOM killer.
Only while doing new allocations we should try to avoid that and
return -ENOMEM to the application.
v2: rename the flag to gfp_retry_mayfail.
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/398685/
Diffstat (limited to 'include/drm')
-rw-r--r-- | include/drm/ttm/ttm_bo_api.h | 2 | ||||
-rw-r--r-- | include/drm/ttm/ttm_bo_driver.h | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h index 37102e45e496..4637357ba856 100644 --- a/include/drm/ttm/ttm_bo_api.h +++ b/include/drm/ttm/ttm_bo_api.h @@ -195,6 +195,7 @@ struct ttm_bo_kmap_obj { * * @interruptible: Sleep interruptible if sleeping. * @no_wait_gpu: Return immediately if the GPU is busy. + * @gfp_retry_mayfail: Set the __GFP_RETRY_MAYFAIL when allocation pages. * @resv: Reservation object to allow reserved evictions with. * @flags: Including the following flags * @@ -204,6 +205,7 @@ struct ttm_bo_kmap_obj { struct ttm_operation_ctx { bool interruptible; bool no_wait_gpu; + bool gfp_retry_mayfail; struct dma_resv *resv; uint64_t bytes_moved; uint32_t flags; diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h index e9f683fa72dc..da8208f43378 100644 --- a/include/drm/ttm/ttm_bo_driver.h +++ b/include/drm/ttm/ttm_bo_driver.h @@ -276,7 +276,6 @@ extern struct ttm_bo_global { * @dev_mapping: A pointer to the struct address_space representing the * device address space. * @wq: Work queue structure for the delayed delete workqueue. - * @no_retry: Don't retry allocation if it fails * */ @@ -314,8 +313,6 @@ struct ttm_bo_device { */ struct delayed_work wq; - - bool no_retry; }; static inline struct ttm_resource_manager *ttm_manager_type(struct ttm_bo_device *bdev, |