All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/amdgpu: disable the VRAM manager on special placements v2
@ 2016-11-04 11:00 Christian König
       [not found] ` <1478257213-1946-1-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Christian König @ 2016-11-04 11:00 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

From: Christian König <christian.koenig@amd.com>

This disables the VRAM manager when a special placement is requested, otherwise
we play ping/pong with the buffers on every command submission.

v2: only check lpfn

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
index 180eed7c..d710226 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
@@ -108,7 +108,7 @@ static int amdgpu_vram_mgr_new(struct ttm_mem_type_manager *man,
 		lpfn = man->size;
 
 	if (bo->flags & AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS ||
-	    amdgpu_vram_page_split == -1) {
+	    place->lpfn || amdgpu_vram_page_split == -1) {
 		pages_per_node = ~0ul;
 		num_nodes = 1;
 	} else {
-- 
2.5.0

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

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 2/2] drm/amdgpu: remove extra placement for AMDGPU_GEM_CREATE_NO_CPU_ACCESS
       [not found] ` <1478257213-1946-1-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
@ 2016-11-04 11:00   ` Christian König
       [not found]     ` <1478257213-1946-2-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
  2016-11-07  2:10   ` 答复: [PATCH 1/2] drm/amdgpu: disable the VRAM manager on special placements v2 Qu, Jim
  2016-11-08 13:09   ` Christian König
  2 siblings, 1 reply; 12+ messages in thread
From: Christian König @ 2016-11-04 11:00 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

From: Christian König <christian.koenig@amd.com>

This only has the effect of scanning the invisible range twice
since the topdown flag is given anyway.

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
index 6efa8d7..052c1b0 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
@@ -128,17 +128,6 @@ static void amdgpu_ttm_placement_init(struct amdgpu_device *adev,
 		if (flags & AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS)
 			lpfn = adev->mc.real_vram_size >> PAGE_SHIFT;
 
-		if (flags & AMDGPU_GEM_CREATE_NO_CPU_ACCESS &&
-		    !(flags & AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED) &&
-		    adev->mc.visible_vram_size < adev->mc.real_vram_size) {
-			places[c].fpfn = visible_pfn;
-			places[c].lpfn = lpfn;
-			places[c].flags = TTM_PL_FLAG_WC |
-				TTM_PL_FLAG_UNCACHED | TTM_PL_FLAG_VRAM |
-				TTM_PL_FLAG_TOPDOWN;
-			c++;
-		}
-
 		places[c].fpfn = 0;
 		places[c].lpfn = lpfn;
 		places[c].flags = TTM_PL_FLAG_WC | TTM_PL_FLAG_UNCACHED |
-- 
2.5.0

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

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* 答复: [PATCH 1/2] drm/amdgpu: disable the VRAM manager on special placements v2
       [not found] ` <1478257213-1946-1-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
  2016-11-04 11:00   ` [PATCH 2/2] drm/amdgpu: remove extra placement for AMDGPU_GEM_CREATE_NO_CPU_ACCESS Christian König
@ 2016-11-07  2:10   ` Qu, Jim
       [not found]     ` <BY2PR12MB0614AEAA868807A54E3DDAA999A70-K//h7OWB4q5SmL+xRiD5tgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
  2016-11-08 13:09   ` Christian König
  2 siblings, 1 reply; 12+ messages in thread
From: Qu, Jim @ 2016-11-07  2:10 UTC (permalink / raw)
  To: Christian König, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

HI Christian:

        if (bo->flags & AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS ||
-           amdgpu_vram_page_split == -1) {
+           place->lpfn || amdgpu_vram_page_split == -1) {
                pages_per_node = ~0ul;
                num_nodes = 1;
        } else {

Here , checking place->lpfn , is that mean if required place is located in visible vram, driver run none pages split code path?
if so, seem it comes back to the starting point. In extreme cases, allocate visible vram fail.

Thanks
JimQu

________________________________________
发件人: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> 代表 Christian König <deathsimple@vodafone.de>
发送时间: 2016年11月4日 19:00
收件人: amd-gfx@lists.freedesktop.org
主题: [PATCH 1/2] drm/amdgpu: disable the VRAM manager on special placements v2

From: Christian König <christian.koenig@amd.com>

This disables the VRAM manager when a special placement is requested, otherwise
we play ping/pong with the buffers on every command submission.

v2: only check lpfn

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
index 180eed7c..d710226 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
@@ -108,7 +108,7 @@ static int amdgpu_vram_mgr_new(struct ttm_mem_type_manager *man,
                lpfn = man->size;

        if (bo->flags & AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS ||
-           amdgpu_vram_page_split == -1) {
+           place->lpfn || amdgpu_vram_page_split == -1) {
                pages_per_node = ~0ul;
                num_nodes = 1;
        } else {
--
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

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/2] drm/amdgpu: remove extra placement for AMDGPU_GEM_CREATE_NO_CPU_ACCESS
       [not found]     ` <1478257213-1946-2-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
@ 2016-11-07  2:35       ` zhoucm1
       [not found]         ` <581FE877.8030503-5C7GfCeVMHo@public.gmane.org>
  2016-11-07  2:51       ` Michel Dänzer
  1 sibling, 1 reply; 12+ messages in thread
From: zhoucm1 @ 2016-11-07  2:35 UTC (permalink / raw)
  To: Christian König, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Hi Christian,
I have some time not to track code, I'm not sure if I miss anything.
In my mind, this change was added while doing performance optimization. 
If you don't encounter any problem, I'm suggesting not to change it, we 
have many regressions(bug and performance) recently.

Regards,
David Zhou

On 2016年11月04日 19:00, Christian König wrote:
> From: Christian König <christian.koenig@amd.com>
>
> This only has the effect of scanning the invisible range twice
> since the topdown flag is given anyway.
>
> Signed-off-by: Christian König <christian.koenig@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 11 -----------
>   1 file changed, 11 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> index 6efa8d7..052c1b0 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> @@ -128,17 +128,6 @@ static void amdgpu_ttm_placement_init(struct amdgpu_device *adev,
>   		if (flags & AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS)
>   			lpfn = adev->mc.real_vram_size >> PAGE_SHIFT;
>   
> -		if (flags & AMDGPU_GEM_CREATE_NO_CPU_ACCESS &&
> -		    !(flags & AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED) &&
> -		    adev->mc.visible_vram_size < adev->mc.real_vram_size) {
> -			places[c].fpfn = visible_pfn;
> -			places[c].lpfn = lpfn;
> -			places[c].flags = TTM_PL_FLAG_WC |
> -				TTM_PL_FLAG_UNCACHED | TTM_PL_FLAG_VRAM |
> -				TTM_PL_FLAG_TOPDOWN;
> -			c++;
> -		}
> -
>   		places[c].fpfn = 0;
>   		places[c].lpfn = lpfn;
>   		places[c].flags = TTM_PL_FLAG_WC | TTM_PL_FLAG_UNCACHED |

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/2] drm/amdgpu: remove extra placement for AMDGPU_GEM_CREATE_NO_CPU_ACCESS
       [not found]     ` <1478257213-1946-2-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
  2016-11-07  2:35       ` zhoucm1
@ 2016-11-07  2:51       ` Michel Dänzer
  1 sibling, 0 replies; 12+ messages in thread
From: Michel Dänzer @ 2016-11-07  2:51 UTC (permalink / raw)
  To: Christian König; +Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On 04/11/16 08:00 PM, Christian König wrote:
> From: Christian König <christian.koenig@amd.com>
> 
> This only has the effect of scanning the invisible range twice
> since the topdown flag is given anyway.
> 
> Signed-off-by: Christian König <christian.koenig@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 11 -----------
>  1 file changed, 11 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> index 6efa8d7..052c1b0 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> @@ -128,17 +128,6 @@ static void amdgpu_ttm_placement_init(struct amdgpu_device *adev,
>  		if (flags & AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS)
>  			lpfn = adev->mc.real_vram_size >> PAGE_SHIFT;
>  
> -		if (flags & AMDGPU_GEM_CREATE_NO_CPU_ACCESS &&
> -		    !(flags & AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED) &&
> -		    adev->mc.visible_vram_size < adev->mc.real_vram_size) {
> -			places[c].fpfn = visible_pfn;
> -			places[c].lpfn = lpfn;
> -			places[c].flags = TTM_PL_FLAG_WC |
> -				TTM_PL_FLAG_UNCACHED | TTM_PL_FLAG_VRAM |
> -				TTM_PL_FLAG_TOPDOWN;
> -			c++;
> -		}
> -
>  		places[c].fpfn = 0;
>  		places[c].lpfn = lpfn;
>  		places[c].flags = TTM_PL_FLAG_WC | TTM_PL_FLAG_UNCACHED |
> 

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: 答复: [PATCH 1/2] drm/amdgpu: disable the VRAM manager on special placements v2
       [not found]     ` <BY2PR12MB0614AEAA868807A54E3DDAA999A70-K//h7OWB4q5SmL+xRiD5tgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
@ 2016-11-07  8:12       ` Christian König
       [not found]         ` <c2cc7a0b-940a-a051-6d77-eb6fcd87fa4b-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Christian König @ 2016-11-07  8:12 UTC (permalink / raw)
  To: Qu, Jim, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

> Here , checking place->lpfn , is that mean if required place is located in visible vram, driver run none pages split code path?
Yes, exactly. CPU accessible allocations weren't meant to be split with 
the initial implementation.

For this we need to be able map scattered allocations into the CPU VM 
page tables first.

You kind of implemented this, but it would still cause a ping/pong of 
the BO inside the visible VRAM space.

We would need to move the handling of 
AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED from amdgpu_ttm_placement_init() 
down into the VRAM manager as well.

Regards,
Christian.

Am 07.11.2016 um 03:10 schrieb Qu, Jim:
> HI Christian:
>
>          if (bo->flags & AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS ||
> -           amdgpu_vram_page_split == -1) {
> +           place->lpfn || amdgpu_vram_page_split == -1) {
>                  pages_per_node = ~0ul;
>                  num_nodes = 1;
>          } else {
>
> Here , checking place->lpfn , is that mean if required place is located in visible vram, driver run none pages split code path?
> if so, seem it comes back to the starting point. In extreme cases, allocate visible vram fail.
>
> Thanks
> JimQu
>
> ________________________________________
> 发件人: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> 代表 Christian König <deathsimple@vodafone.de>
> 发送时间: 2016年11月4日 19:00
> 收件人: amd-gfx@lists.freedesktop.org
> 主题: [PATCH 1/2] drm/amdgpu: disable the VRAM manager on special placements v2
>
> From: Christian König <christian.koenig@amd.com>
>
> This disables the VRAM manager when a special placement is requested, otherwise
> we play ping/pong with the buffers on every command submission.
>
> v2: only check lpfn
>
> Signed-off-by: Christian König <christian.koenig@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
> index 180eed7c..d710226 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
> @@ -108,7 +108,7 @@ static int amdgpu_vram_mgr_new(struct ttm_mem_type_manager *man,
>                  lpfn = man->size;
>
>          if (bo->flags & AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS ||
> -           amdgpu_vram_page_split == -1) {
> +           place->lpfn || amdgpu_vram_page_split == -1) {
>                  pages_per_node = ~0ul;
>                  num_nodes = 1;
>          } else {
> --
> 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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/2] drm/amdgpu: remove extra placement for AMDGPU_GEM_CREATE_NO_CPU_ACCESS
       [not found]         ` <581FE877.8030503-5C7GfCeVMHo@public.gmane.org>
@ 2016-11-07  8:16           ` Christian König
  0 siblings, 0 replies; 12+ messages in thread
From: Christian König @ 2016-11-07  8:16 UTC (permalink / raw)
  To: zhoucm1, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Hi David,

well that additional placement range actually caused a performance problem.

It's only effect is that we check the invisible space twice, which can 
burn quite a bunch of CPU cycles during allocation.

Can you somehow easily check for performance regressions?

Regards,
Christian.

Am 07.11.2016 um 03:35 schrieb zhoucm1:
> Hi Christian,
> I have some time not to track code, I'm not sure if I miss anything.
> In my mind, this change was added while doing performance 
> optimization. If you don't encounter any problem, I'm suggesting not 
> to change it, we have many regressions(bug and performance) recently.
>
> Regards,
> David Zhou
>
> On 2016年11月04日 19:00, Christian König wrote:
>> From: Christian König <christian.koenig@amd.com>
>>
>> This only has the effect of scanning the invisible range twice
>> since the topdown flag is given anyway.
>>
>> Signed-off-by: Christian König <christian.koenig@amd.com>
>> ---
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 11 -----------
>>   1 file changed, 11 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c 
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
>> index 6efa8d7..052c1b0 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
>> @@ -128,17 +128,6 @@ static void amdgpu_ttm_placement_init(struct 
>> amdgpu_device *adev,
>>           if (flags & AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS)
>>               lpfn = adev->mc.real_vram_size >> PAGE_SHIFT;
>>   -        if (flags & AMDGPU_GEM_CREATE_NO_CPU_ACCESS &&
>> -            !(flags & AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED) &&
>> -            adev->mc.visible_vram_size < adev->mc.real_vram_size) {
>> -            places[c].fpfn = visible_pfn;
>> -            places[c].lpfn = lpfn;
>> -            places[c].flags = TTM_PL_FLAG_WC |
>> -                TTM_PL_FLAG_UNCACHED | TTM_PL_FLAG_VRAM |
>> -                TTM_PL_FLAG_TOPDOWN;
>> -            c++;
>> -        }
>> -
>>           places[c].fpfn = 0;
>>           places[c].lpfn = lpfn;
>>           places[c].flags = TTM_PL_FLAG_WC | TTM_PL_FLAG_UNCACHED |
>

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* 答复: 答复: [PATCH 1/2] drm/amdgpu: disable the VRAM manager on special placements v2
       [not found]         ` <c2cc7a0b-940a-a051-6d77-eb6fcd87fa4b-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
@ 2016-11-07  8:16           ` Qu, Jim
       [not found]             ` <BY2PR12MB061436E9DC06B7698F4E7C4399A70-K//h7OWB4q5SmL+xRiD5tgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Qu, Jim @ 2016-11-07  8:16 UTC (permalink / raw)
  To: Christian König, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Hi Christian:

Could the patch for mmap splited pages be applied to ttm? if so, I can sent out the patch.

Thanks
JimQu

________________________________________
发件人: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> 代表 Christian König <deathsimple@vodafone.de>
发送时间: 2016年11月7日 16:12
收件人: Qu, Jim; amd-gfx@lists.freedesktop.org
主题: Re: 答复: [PATCH 1/2] drm/amdgpu: disable the VRAM manager on special placements v2

> Here , checking place->lpfn , is that mean if required place is located in visible vram, driver run none pages split code path?
Yes, exactly. CPU accessible allocations weren't meant to be split with
the initial implementation.

For this we need to be able map scattered allocations into the CPU VM
page tables first.

You kind of implemented this, but it would still cause a ping/pong of
the BO inside the visible VRAM space.

We would need to move the handling of
AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED from amdgpu_ttm_placement_init()
down into the VRAM manager as well.

Regards,
Christian.

Am 07.11.2016 um 03:10 schrieb Qu, Jim:
> HI Christian:
>
>          if (bo->flags & AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS ||
> -           amdgpu_vram_page_split == -1) {
> +           place->lpfn || amdgpu_vram_page_split == -1) {
>                  pages_per_node = ~0ul;
>                  num_nodes = 1;
>          } else {
>
> Here , checking place->lpfn , is that mean if required place is located in visible vram, driver run none pages split code path?
> if so, seem it comes back to the starting point. In extreme cases, allocate visible vram fail.
>
> Thanks
> JimQu
>
> ________________________________________
> 发件人: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> 代表 Christian König <deathsimple@vodafone.de>
> 发送时间: 2016年11月4日 19:00
> 收件人: amd-gfx@lists.freedesktop.org
> 主题: [PATCH 1/2] drm/amdgpu: disable the VRAM manager on special placements v2
>
> From: Christian König <christian.koenig@amd.com>
>
> This disables the VRAM manager when a special placement is requested, otherwise
> we play ping/pong with the buffers on every command submission.
>
> v2: only check lpfn
>
> Signed-off-by: Christian König <christian.koenig@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
> index 180eed7c..d710226 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
> @@ -108,7 +108,7 @@ static int amdgpu_vram_mgr_new(struct ttm_mem_type_manager *man,
>                  lpfn = man->size;
>
>          if (bo->flags & AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS ||
> -           amdgpu_vram_page_split == -1) {
> +           place->lpfn || amdgpu_vram_page_split == -1) {
>                  pages_per_node = ~0ul;
>                  num_nodes = 1;
>          } else {
> --
> 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
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: 答复: 答复: [PATCH 1/2] drm/amdgpu: disable the VRAM manager on special placements v2
       [not found]             ` <BY2PR12MB061436E9DC06B7698F4E7C4399A70-K//h7OWB4q5SmL+xRiD5tgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
@ 2016-11-07  8:27               ` Christian König
  0 siblings, 0 replies; 12+ messages in thread
From: Christian König @ 2016-11-07  8:27 UTC (permalink / raw)
  To: Qu, Jim, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Yeah, please send that out.

Maybe just to me first, since we probably need to simplify and clean it 
up a bit, e.g. use a callback instead of duplicating much code etc...

But in general that sounded like a step into the right direction in out 
internal discussion.

We just need to change the placement as well to avoid this stupid moving 
around the buffer on every command submission.

Regards,
Christian.

Am 07.11.2016 um 09:16 schrieb Qu, Jim:
> Hi Christian:
>
> Could the patch for mmap splited pages be applied to ttm? if so, I can sent out the patch.
>
> Thanks
> JimQu
>
> ________________________________________
> 发件人: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> 代表 Christian König <deathsimple@vodafone.de>
> 发送时间: 2016年11月7日 16:12
> 收件人: Qu, Jim; amd-gfx@lists.freedesktop.org
> 主题: Re: 答复: [PATCH 1/2] drm/amdgpu: disable the VRAM manager on special placements v2
>
>> Here , checking place->lpfn , is that mean if required place is located in visible vram, driver run none pages split code path?
> Yes, exactly. CPU accessible allocations weren't meant to be split with
> the initial implementation.
>
> For this we need to be able map scattered allocations into the CPU VM
> page tables first.
>
> You kind of implemented this, but it would still cause a ping/pong of
> the BO inside the visible VRAM space.
>
> We would need to move the handling of
> AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED from amdgpu_ttm_placement_init()
> down into the VRAM manager as well.
>
> Regards,
> Christian.
>
> Am 07.11.2016 um 03:10 schrieb Qu, Jim:
>> HI Christian:
>>
>>           if (bo->flags & AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS ||
>> -           amdgpu_vram_page_split == -1) {
>> +           place->lpfn || amdgpu_vram_page_split == -1) {
>>                   pages_per_node = ~0ul;
>>                   num_nodes = 1;
>>           } else {
>>
>> Here , checking place->lpfn , is that mean if required place is located in visible vram, driver run none pages split code path?
>> if so, seem it comes back to the starting point. In extreme cases, allocate visible vram fail.
>>
>> Thanks
>> JimQu
>>
>> ________________________________________
>> 发件人: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> 代表 Christian König <deathsimple@vodafone.de>
>> 发送时间: 2016年11月4日 19:00
>> 收件人: amd-gfx@lists.freedesktop.org
>> 主题: [PATCH 1/2] drm/amdgpu: disable the VRAM manager on special placements v2
>>
>> From: Christian König <christian.koenig@amd.com>
>>
>> This disables the VRAM manager when a special placement is requested, otherwise
>> we play ping/pong with the buffers on every command submission.
>>
>> v2: only check lpfn
>>
>> Signed-off-by: Christian König <christian.koenig@amd.com>
>> ---
>>    drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 2 +-
>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
>> index 180eed7c..d710226 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
>> @@ -108,7 +108,7 @@ static int amdgpu_vram_mgr_new(struct ttm_mem_type_manager *man,
>>                   lpfn = man->size;
>>
>>           if (bo->flags & AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS ||
>> -           amdgpu_vram_page_split == -1) {
>> +           place->lpfn || amdgpu_vram_page_split == -1) {
>>                   pages_per_node = ~0ul;
>>                   num_nodes = 1;
>>           } else {
>> --
>> 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


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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/2] drm/amdgpu: disable the VRAM manager on special placements v2
       [not found] ` <1478257213-1946-1-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
  2016-11-04 11:00   ` [PATCH 2/2] drm/amdgpu: remove extra placement for AMDGPU_GEM_CREATE_NO_CPU_ACCESS Christian König
  2016-11-07  2:10   ` 答复: [PATCH 1/2] drm/amdgpu: disable the VRAM manager on special placements v2 Qu, Jim
@ 2016-11-08 13:09   ` Christian König
       [not found]     ` <508632be-2cfc-de34-4ad7-68fb518c9d68-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
  2 siblings, 1 reply; 12+ messages in thread
From: Christian König @ 2016-11-08 13:09 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Qu, Jim, Zhou, David(ChunMing)

Am 04.11.2016 um 12:00 schrieb Christian König:
> From: Christian König <christian.koenig@amd.com>
>
> This disables the VRAM manager when a special placement is requested, otherwise
> we play ping/pong with the buffers on every command submission.
>
> v2: only check lpfn
>
> Signed-off-by: Christian König <christian.koenig@amd.com>

Could anybody give a Reviewed-by for this? I think that is a rather 
important performance bug fix.

Regards,
Christian.

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
> index 180eed7c..d710226 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
> @@ -108,7 +108,7 @@ static int amdgpu_vram_mgr_new(struct ttm_mem_type_manager *man,
>   		lpfn = man->size;
>   
>   	if (bo->flags & AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS ||
> -	    amdgpu_vram_page_split == -1) {
> +	    place->lpfn || amdgpu_vram_page_split == -1) {
>   		pages_per_node = ~0ul;
>   		num_nodes = 1;
>   	} else {


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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE: [PATCH 1/2] drm/amdgpu: disable the VRAM manager on special placements v2
       [not found]     ` <508632be-2cfc-de34-4ad7-68fb518c9d68-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
@ 2016-11-08 13:51       ` Deucher, Alexander
  2016-11-09  2:49       ` 答复: " Qu, Jim
  1 sibling, 0 replies; 12+ messages in thread
From: Deucher, Alexander @ 2016-11-08 13:51 UTC (permalink / raw)
  To: 'Christian König',
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Qu, Jim, Zhou,
	David(ChunMing)

> -----Original Message-----
> From: amd-gfx [mailto:amd-gfx-bounces@lists.freedesktop.org] On Behalf
> Of Christian König
> Sent: Tuesday, November 08, 2016 8:10 AM
> To: amd-gfx@lists.freedesktop.org; Qu, Jim; Zhou, David(ChunMing)
> Subject: Re: [PATCH 1/2] drm/amdgpu: disable the VRAM manager on special
> placements v2
> 
> Am 04.11.2016 um 12:00 schrieb Christian König:
> > From: Christian König <christian.koenig@amd.com>
> >
> > This disables the VRAM manager when a special placement is requested,
> otherwise
> > we play ping/pong with the buffers on every command submission.
> >
> > v2: only check lpfn
> >
> > Signed-off-by: Christian König <christian.koenig@amd.com>
> 
> Could anybody give a Reviewed-by for this? I think that is a rather
> important performance bug fix.

I swear I replied to this.  Anyway, the series is:
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

> 
> Regards,
> Christian.
> 
> > ---
> >   drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
> > index 180eed7c..d710226 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
> > @@ -108,7 +108,7 @@ static int amdgpu_vram_mgr_new(struct
> ttm_mem_type_manager *man,
> >   		lpfn = man->size;
> >
> >   	if (bo->flags & AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS ||
> > -	    amdgpu_vram_page_split == -1) {
> > +	    place->lpfn || amdgpu_vram_page_split == -1) {
> >   		pages_per_node = ~0ul;
> >   		num_nodes = 1;
> >   	} else {
> 
> 
> _______________________________________________
> 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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* 答复: [PATCH 1/2] drm/amdgpu: disable the VRAM manager on special placements v2
       [not found]     ` <508632be-2cfc-de34-4ad7-68fb518c9d68-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
  2016-11-08 13:51       ` Deucher, Alexander
@ 2016-11-09  2:49       ` Qu, Jim
  1 sibling, 0 replies; 12+ messages in thread
From: Qu, Jim @ 2016-11-09  2:49 UTC (permalink / raw)
  To: Christian König, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	Zhou, David(ChunMing)

Reviewed-by: JimQu <Jim.Qu@amd.com>

Thanks
JimQu

________________________________________
发件人: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> 代表 Christian König <deathsimple@vodafone.de>
发送时间: 2016年11月8日 21:09
收件人: amd-gfx@lists.freedesktop.org; Qu, Jim; Zhou, David(ChunMing)
主题: Re: [PATCH 1/2] drm/amdgpu: disable the VRAM manager on special placements v2

Am 04.11.2016 um 12:00 schrieb Christian König:
> From: Christian König <christian.koenig@amd.com>
>
> This disables the VRAM manager when a special placement is requested, otherwise
> we play ping/pong with the buffers on every command submission.
>
> v2: only check lpfn
>
> Signed-off-by: Christian König <christian.koenig@amd.com>

Could anybody give a Reviewed-by for this? I think that is a rather
important performance bug fix.

Regards,
Christian.

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
> index 180eed7c..d710226 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
> @@ -108,7 +108,7 @@ static int amdgpu_vram_mgr_new(struct ttm_mem_type_manager *man,
>               lpfn = man->size;
>
>       if (bo->flags & AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS ||
> -         amdgpu_vram_page_split == -1) {
> +         place->lpfn || amdgpu_vram_page_split == -1) {
>               pages_per_node = ~0ul;
>               num_nodes = 1;
>       } else {


_______________________________________________
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

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2016-11-09  2:49 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-04 11:00 [PATCH 1/2] drm/amdgpu: disable the VRAM manager on special placements v2 Christian König
     [not found] ` <1478257213-1946-1-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2016-11-04 11:00   ` [PATCH 2/2] drm/amdgpu: remove extra placement for AMDGPU_GEM_CREATE_NO_CPU_ACCESS Christian König
     [not found]     ` <1478257213-1946-2-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2016-11-07  2:35       ` zhoucm1
     [not found]         ` <581FE877.8030503-5C7GfCeVMHo@public.gmane.org>
2016-11-07  8:16           ` Christian König
2016-11-07  2:51       ` Michel Dänzer
2016-11-07  2:10   ` 答复: [PATCH 1/2] drm/amdgpu: disable the VRAM manager on special placements v2 Qu, Jim
     [not found]     ` <BY2PR12MB0614AEAA868807A54E3DDAA999A70-K//h7OWB4q5SmL+xRiD5tgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2016-11-07  8:12       ` Christian König
     [not found]         ` <c2cc7a0b-940a-a051-6d77-eb6fcd87fa4b-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2016-11-07  8:16           ` 答复: " Qu, Jim
     [not found]             ` <BY2PR12MB061436E9DC06B7698F4E7C4399A70-K//h7OWB4q5SmL+xRiD5tgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2016-11-07  8:27               ` Christian König
2016-11-08 13:09   ` Christian König
     [not found]     ` <508632be-2cfc-de34-4ad7-68fb518c9d68-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2016-11-08 13:51       ` Deucher, Alexander
2016-11-09  2:49       ` 答复: " Qu, Jim

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.