[PATCH 2/2] drm/ttm: remove no_retry flag

Christian König ckoenig.leichtzumerken at gmail.com
Mon Oct 5 14:37:38 UTC 2020


Am 02.10.20 um 14:31 schrieb Daniel Vetter:
> On Fri, Oct 2, 2020 at 1:31 PM Christian König
> <ckoenig.leichtzumerken at gmail.com> wrote:
>> Amdgpu was the only user of this.
>>
>> Signed-off-by: Christian König <christian.koenig at amd.com>
> Uh this smells like a fishy band-aid. And the original commit
> introducing this also doesn't sched any light on why this should
> happen, and why it's specific to the amdgpu driver. Do you have some
> more memories here?

Nope, I briefly remember that we had a customer which ran into the OOM 
killer and instead wanted to get -ENOMEM.

But I honestly don't remember why we have it approached like that.

Christian.

>
> I guess no retry makes sense for a "do you still have memory?" query,
> but once we've commit to having that memory, I'm not seeing why we
> should not try to find it? Might also tie into the lack of active
> shrinking for ttm objects in the system domain.
> -Daniel
>
>> ---
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 6 +++---
>>   drivers/gpu/drm/ttm/ttm_tt.c            | 3 ---
>>   include/drm/ttm/ttm_device.h            | 2 --
>>   3 files changed, 3 insertions(+), 8 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>> index c5f2b4971ef7..0a4233985870 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>> @@ -1298,6 +1298,9 @@ static struct ttm_tt *amdgpu_ttm_tt_create(struct ttm_buffer_object *bo,
>>          }
>>          gtt->gobj = &bo->base;
>>
>> +       /* We opt to avoid OOM on system pages allocations */
>> +       page_flags |= TTM_PAGE_FLAG_NO_RETRY;
>> +
>>          if (dma_addressing_limited(adev->dev))
>>                  page_flags |= TTM_PAGE_FLAG_DMA32;
>>
>> @@ -1895,9 +1898,6 @@ int amdgpu_ttm_init(struct amdgpu_device *adev)
>>          }
>>          adev->mman.initialized = true;
>>
>> -       /* We opt to avoid OOM on system pages allocations */
>> -       adev->mman.bdev.no_retry = true;
>> -
>>          /* Initialize VRAM pool with all of VRAM divided into pages */
>>          r = amdgpu_vram_mgr_init(adev);
>>          if (r) {
>> diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c
>> index e2b1e6c53a04..98514abaa939 100644
>> --- a/drivers/gpu/drm/ttm/ttm_tt.c
>> +++ b/drivers/gpu/drm/ttm/ttm_tt.c
>> @@ -52,9 +52,6 @@ int ttm_tt_create(struct ttm_buffer_object *bo, bool zero_alloc)
>>          if (bo->ttm)
>>                  return 0;
>>
>> -       if (bdev->no_retry)
>> -               page_flags |= TTM_PAGE_FLAG_NO_RETRY;
>> -
>>          switch (bo->type) {
>>          case ttm_bo_type_device:
>>                  if (zero_alloc)
>> diff --git a/include/drm/ttm/ttm_device.h b/include/drm/ttm/ttm_device.h
>> index bfc6dd87f2d3..e0eba36c1309 100644
>> --- a/include/drm/ttm/ttm_device.h
>> +++ b/include/drm/ttm/ttm_device.h
>> @@ -326,8 +326,6 @@ struct ttm_device {
>>           */
>>
>>          struct delayed_work wq;
>> -
>> -       bool no_retry;
>>   };
>>
>>   static inline struct ttm_resource_manager *
>> --
>> 2.17.1
>>
>



More information about the dri-devel mailing list