AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: zhoucm1 <david1.zhou-5C7GfCeVMHo@public.gmane.org>
To: "Alex Deucher"
	<alexdeucher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	"Christian König"
	<deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
Cc: amd-gfx list <amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
Subject: Re: [PATCH] drm/amdgpu: fix amdgpu_ttm_bo_eviction_valuable
Date: Fri, 21 Apr 2017 16:37:41 +0800	[thread overview]
Message-ID: <58F9C4D5.7030804@amd.com> (raw)
In-Reply-To: <CADnq5_N2KHdP3vkiY4Cfg6dKEqk1kF8_17N6s9H_0E7yQNDciA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>



On 2017年04月20日 20:48, Alex Deucher wrote:
> On Thu, Apr 20, 2017 at 7:49 AM, Christian König
> <deathsimple@vodafone.de> wrote:
>> From: Christian König <christian.koenig@amd.com>
>>
>> BOs not mapped into the GART are always valuable for an eviction. Otherwise we
>> don't correctly swap them out on VRAM evictions during memory pressure.
>>
>> Signed-off-by: Christian König <christian.koenig@amd.com>
> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Although it doesn't fix my issue, it seems more reasonable compared 
previous, Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
>
>> ---
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 18 +++++++++++++-----
>>   1 file changed, 13 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>> index e5d460e..ab7317e 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>> @@ -1040,11 +1040,17 @@ uint64_t amdgpu_ttm_tt_pte_flags(struct amdgpu_device *adev, struct ttm_tt *ttm,
>>   static bool amdgpu_ttm_bo_eviction_valuable(struct ttm_buffer_object *bo,
>>                                              const struct ttm_place *place)
>>   {
>> -       if (bo->mem.mem_type == TTM_PL_VRAM &&
>> -           bo->mem.start == AMDGPU_BO_INVALID_OFFSET) {
>> -               unsigned long num_pages = bo->mem.num_pages;
>> -               struct drm_mm_node *node = bo->mem.mm_node;
>> +       unsigned long num_pages = bo->mem.num_pages;
>> +       struct drm_mm_node *node = bo->mem.mm_node;
>>
>> +       if (bo->mem.start != AMDGPU_BO_INVALID_OFFSET)
>> +               return ttm_bo_eviction_valuable(bo, place);
>> +
>> +       switch (bo->mem.mem_type) {
>> +       case TTM_PL_TT:
>> +               return true;
>> +
>> +       case TTM_PL_VRAM:
>>                  /* Check each drm MM node individually */
>>                  while (num_pages) {
>>                          if (place->fpfn < (node->start + node->size) &&
>> @@ -1054,8 +1060,10 @@ static bool amdgpu_ttm_bo_eviction_valuable(struct ttm_buffer_object *bo,
>>                          num_pages -= node->size;
>>                          ++node;
>>                  }
>> +               break;
>>
>> -               return false;
>> +       default:
>> +               break;
>>          }
>>
>>          return ttm_bo_eviction_valuable(bo, place);
>> --
>> 2.5.0
>>
>> _______________________________________________
>> amd-gfx mailing list
>> amd-gfx@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

      parent reply	other threads:[~2017-04-21  8:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-20 11:49 [PATCH] drm/amdgpu: fix amdgpu_ttm_bo_eviction_valuable Christian König
     [not found] ` <1492688977-1757-1-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-04-20 12:48   ` Alex Deucher
     [not found]     ` <CADnq5_N2KHdP3vkiY4Cfg6dKEqk1kF8_17N6s9H_0E7yQNDciA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-04-21  8:37       ` zhoucm1 [this message]

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=58F9C4D5.7030804@amd.com \
    --to=david1.zhou-5c7gfcevmho@public.gmane.org \
    --cc=alexdeucher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org \
    /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