* [PATCH libdrm 1/2] libdrm: fix inefficient vamgr algorithm
@ 2018-01-12 5:45 Chunming Zhou
[not found] ` <20180112054554.19585-1-david1.zhou-5C7GfCeVMHo@public.gmane.org>
0 siblings, 1 reply; 12+ messages in thread
From: Chunming Zhou @ 2018-01-12 5:45 UTC (permalink / raw)
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Cc: Chunming Zhou, Hui.Deng-5C7GfCeVMHo
issue: UMD allocates top 4GB, but don't do anything, just reserve top 4GB space,
but the performance of VP13 drops from 162fps to 99fps.
root cause:
our va hole list of vamgr is too long by time going.
fix:
reusing old hole as much as possible can make the list shortest.
result:
performance recovers as non-list path, next patch will remove non-list code path.
Change-Id: I3f00ef193815d31a78d416b53c1511098b88da8f
Signed-off-by: Chunming Zhou <david1.zhou@amd.com>
---
amdgpu/amdgpu_vamgr.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/amdgpu/amdgpu_vamgr.c b/amdgpu/amdgpu_vamgr.c
index 6e0d7e37..66bb8ecd 100644
--- a/amdgpu/amdgpu_vamgr.c
+++ b/amdgpu/amdgpu_vamgr.c
@@ -94,9 +94,7 @@ amdgpu_vamgr_find_va(struct amdgpu_bo_va_mgr *mgr, uint64_t size,
return AMDGPU_INVALID_VA_ADDRESS;
pthread_mutex_lock(&mgr->bo_va_mutex);
- /* TODO: using more appropriate way to track the holes */
- /* first look for a hole */
- LIST_FOR_EACH_ENTRY_SAFE(hole, n, &mgr->va_holes, list) {
+ LIST_FOR_EACH_ENTRY_SAFE_REV(hole, n, &mgr->va_holes, list) {
if (base_required) {
if(hole->offset > base_required ||
(hole->offset + hole->size) < (base_required + size))
@@ -183,9 +181,7 @@ static uint64_t amdgpu_vamgr_find_va_in_range(struct amdgpu_bo_va_mgr *mgr, uint
size = ALIGN(size, mgr->va_alignment);
pthread_mutex_lock(&mgr->bo_va_mutex);
- /* TODO: using more appropriate way to track the holes */
- /* first look for a hole */
- LIST_FOR_EACH_ENTRY_SAFE(hole, n, &mgr->va_holes, list) {
+ LIST_FOR_EACH_ENTRY_SAFE_REV(hole, n, &mgr->va_holes, list) {
if (hole->offset > range_max ||
hole->offset + hole->size < range_min ||
(hole->offset > range_min && hole->offset + size > range_max) ||
--
2.14.1
_______________________________________________
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 libdrm 2/2] libdrm: clean up non list code path for vamgr
[not found] ` <20180112054554.19585-1-david1.zhou-5C7GfCeVMHo@public.gmane.org>
@ 2018-01-12 5:45 ` Chunming Zhou
[not found] ` <20180112054554.19585-2-david1.zhou-5C7GfCeVMHo@public.gmane.org>
0 siblings, 1 reply; 12+ messages in thread
From: Chunming Zhou @ 2018-01-12 5:45 UTC (permalink / raw)
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Cc: Chunming Zhou, Hui.Deng-5C7GfCeVMHo
Change-Id: I7ca19a1f6404356a6c69ab4af27c8e13454f0279
Signed-off-by: Chunming Zhou <david1.zhou@amd.com>
---
amdgpu/amdgpu_internal.h | 2 -
amdgpu/amdgpu_vamgr.c | 152 ++++++++++++++---------------------------------
2 files changed, 46 insertions(+), 108 deletions(-)
diff --git a/amdgpu/amdgpu_internal.h b/amdgpu/amdgpu_internal.h
index fd522f39..7484780b 100644
--- a/amdgpu/amdgpu_internal.h
+++ b/amdgpu/amdgpu_internal.h
@@ -53,8 +53,6 @@ struct amdgpu_bo_va_hole {
};
struct amdgpu_bo_va_mgr {
- /* the start virtual address */
- uint64_t va_offset;
uint64_t va_min;
uint64_t va_max;
struct list_head va_holes;
diff --git a/amdgpu/amdgpu_vamgr.c b/amdgpu/amdgpu_vamgr.c
index 66bb8ecd..b826ac81 100644
--- a/amdgpu/amdgpu_vamgr.c
+++ b/amdgpu/amdgpu_vamgr.c
@@ -61,13 +61,20 @@ int amdgpu_va_range_query(amdgpu_device_handle dev,
drm_private void amdgpu_vamgr_init(struct amdgpu_bo_va_mgr *mgr, uint64_t start,
uint64_t max, uint64_t alignment)
{
- mgr->va_offset = start;
+ struct amdgpu_bo_va_hole *n;
+
mgr->va_min = start;
mgr->va_max = max;
mgr->va_alignment = alignment;
list_inithead(&mgr->va_holes);
pthread_mutex_init(&mgr->bo_va_mutex, NULL);
+ pthread_mutex_lock(&mgr->bo_va_mutex);
+ n = calloc(1, sizeof(struct amdgpu_bo_va_hole));
+ n->size = mgr->va_max;
+ n->offset = mgr->va_min;
+ list_add(&n->list, &mgr->va_holes);
+ pthread_mutex_unlock(&mgr->bo_va_mutex);
}
drm_private void amdgpu_vamgr_deinit(struct amdgpu_bo_va_mgr *mgr)
@@ -136,35 +143,8 @@ amdgpu_vamgr_find_va(struct amdgpu_bo_va_mgr *mgr, uint64_t size,
}
}
- if (base_required) {
- if (base_required < mgr->va_offset) {
- pthread_mutex_unlock(&mgr->bo_va_mutex);
- return AMDGPU_INVALID_VA_ADDRESS;
- }
- offset = mgr->va_offset;
- waste = base_required - mgr->va_offset;
- } else {
- offset = mgr->va_offset;
- waste = offset % alignment;
- waste = waste ? alignment - waste : 0;
- }
-
- if (offset + waste + size > mgr->va_max) {
- pthread_mutex_unlock(&mgr->bo_va_mutex);
- return AMDGPU_INVALID_VA_ADDRESS;
- }
-
- if (waste) {
- n = calloc(1, sizeof(struct amdgpu_bo_va_hole));
- n->size = waste;
- n->offset = offset;
- list_add(&n->list, &mgr->va_holes);
- }
-
- offset += waste;
- mgr->va_offset += size + waste;
pthread_mutex_unlock(&mgr->bo_va_mutex);
- return offset;
+ return AMDGPU_INVALID_VA_ADDRESS;
}
static uint64_t amdgpu_vamgr_find_va_in_range(struct amdgpu_bo_va_mgr *mgr, uint64_t size,
@@ -232,41 +212,14 @@ static uint64_t amdgpu_vamgr_find_va_in_range(struct amdgpu_bo_va_mgr *mgr, uint
}
}
- if (mgr->va_offset > range_max) {
- pthread_mutex_unlock(&mgr->bo_va_mutex);
- return AMDGPU_INVALID_VA_ADDRESS;
- } else if (mgr->va_offset > range_min) {
- offset = mgr->va_offset;
- waste = offset % alignment;
- waste = waste ? alignment - waste : 0;
- if (offset + waste + size > range_max) {
- pthread_mutex_unlock(&mgr->bo_va_mutex);
- return AMDGPU_INVALID_VA_ADDRESS;
- }
- } else {
- offset = mgr->va_offset;
- waste = range_min % alignment;
- waste = waste ? alignment - waste : 0;
- waste += range_min - offset ;
- }
-
- if (waste) {
- n = calloc(1, sizeof(struct amdgpu_bo_va_hole));
- n->size = waste;
- n->offset = offset;
- list_add(&n->list, &mgr->va_holes);
- }
-
- offset += waste;
- mgr->va_offset = size + offset;
pthread_mutex_unlock(&mgr->bo_va_mutex);
- return offset;
+ return AMDGPU_INVALID_VA_ADDRESS;
}
drm_private void
amdgpu_vamgr_free_va(struct amdgpu_bo_va_mgr *mgr, uint64_t va, uint64_t size)
{
- struct amdgpu_bo_va_hole *hole;
+ struct amdgpu_bo_va_hole *hole, *next;
if (va == AMDGPU_INVALID_VA_ADDRESS)
return;
@@ -274,61 +227,48 @@ amdgpu_vamgr_free_va(struct amdgpu_bo_va_mgr *mgr, uint64_t va, uint64_t size)
size = ALIGN(size, mgr->va_alignment);
pthread_mutex_lock(&mgr->bo_va_mutex);
- if ((va + size) == mgr->va_offset) {
- mgr->va_offset = va;
- /* Delete uppermost hole if it reaches the new top */
- if (!LIST_IS_EMPTY(&mgr->va_holes)) {
- hole = container_of(mgr->va_holes.next, hole, list);
- if ((hole->offset + hole->size) == va) {
- mgr->va_offset = hole->offset;
- list_del(&hole->list);
- free(hole);
- }
- }
- } else {
- struct amdgpu_bo_va_hole *next;
- hole = container_of(&mgr->va_holes, hole, list);
- LIST_FOR_EACH_ENTRY(next, &mgr->va_holes, list) {
- if (next->offset < va)
- break;
- hole = next;
- }
+ hole = container_of(&mgr->va_holes, hole, list);
+ LIST_FOR_EACH_ENTRY(next, &mgr->va_holes, list) {
+ if (next->offset < va)
+ break;
+ hole = next;
+ }
- if (&hole->list != &mgr->va_holes) {
- /* Grow upper hole if it's adjacent */
- if (hole->offset == (va + size)) {
- hole->offset = va;
- hole->size += size;
- /* Merge lower hole if it's adjacent */
- if (next != hole
- && &next->list != &mgr->va_holes
- && (next->offset + next->size) == va) {
- next->size += hole->size;
- list_del(&hole->list);
- free(hole);
- }
- goto out;
+ if (&hole->list != &mgr->va_holes) {
+ /* Grow upper hole if it's adjacent */
+ if (hole->offset == (va + size)) {
+ hole->offset = va;
+ hole->size += size;
+ /* Merge lower hole if it's adjacent */
+ if (next != hole &&
+ &next->list != &mgr->va_holes &&
+ (next->offset + next->size) == va) {
+ next->size += hole->size;
+ list_del(&hole->list);
+ free(hole);
}
- }
-
- /* Grow lower hole if it's adjacent */
- if (next != hole && &next->list != &mgr->va_holes &&
- (next->offset + next->size) == va) {
- next->size += size;
goto out;
}
+ }
- /* FIXME on allocation failure we just lose virtual address space
- * maybe print a warning
- */
- next = calloc(1, sizeof(struct amdgpu_bo_va_hole));
- if (next) {
- next->size = size;
- next->offset = va;
- list_add(&next->list, &hole->list);
- }
+ /* Grow lower hole if it's adjacent */
+ if (next != hole && &next->list != &mgr->va_holes &&
+ (next->offset + next->size) == va) {
+ next->size += size;
+ goto out;
}
+
+ /* FIXME on allocation failure we just lose virtual address space
+ * maybe print a warning
+ */
+ next = calloc(1, sizeof(struct amdgpu_bo_va_hole));
+ if (next) {
+ next->size = size;
+ next->offset = va;
+ list_add(&next->list, &hole->list);
+ }
+
out:
pthread_mutex_unlock(&mgr->bo_va_mutex);
}
--
2.14.1
_______________________________________________
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 libdrm 2/2] libdrm: clean up non list code path for vamgr
[not found] ` <20180112054554.19585-2-david1.zhou-5C7GfCeVMHo@public.gmane.org>
@ 2018-01-12 8:04 ` Christian König
[not found] ` <563c031e-2e11-eb51-bdce-589da435c9a8-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-02-08 9:01 ` Michel Dänzer
1 sibling, 1 reply; 12+ messages in thread
From: Christian König @ 2018-01-12 8:04 UTC (permalink / raw)
To: Chunming Zhou, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Cc: Hui.Deng-5C7GfCeVMHo
Am 12.01.2018 um 06:45 schrieb Chunming Zhou:
> Change-Id: I7ca19a1f6404356a6c69ab4af27c8e13454f0279
> Signed-off-by: Chunming Zhou <david1.zhou@amd.com>
> ---
> amdgpu/amdgpu_internal.h | 2 -
> amdgpu/amdgpu_vamgr.c | 152 ++++++++++++++---------------------------------
> 2 files changed, 46 insertions(+), 108 deletions(-)
>
> diff --git a/amdgpu/amdgpu_internal.h b/amdgpu/amdgpu_internal.h
> index fd522f39..7484780b 100644
> --- a/amdgpu/amdgpu_internal.h
> +++ b/amdgpu/amdgpu_internal.h
> @@ -53,8 +53,6 @@ struct amdgpu_bo_va_hole {
> };
>
> struct amdgpu_bo_va_mgr {
> - /* the start virtual address */
> - uint64_t va_offset;
> uint64_t va_min;
> uint64_t va_max;
Is va_min and va_max actually still used after that series? If not I
would remove them as well.
Apart from that I would indeed add the warning when the calloc during
free fails.
With that fixed the series is Reviewed-by: Christian König
<christian.koenig@amd.com>.
Regards,
Christian.
> struct list_head va_holes;
> diff --git a/amdgpu/amdgpu_vamgr.c b/amdgpu/amdgpu_vamgr.c
> index 66bb8ecd..b826ac81 100644
> --- a/amdgpu/amdgpu_vamgr.c
> +++ b/amdgpu/amdgpu_vamgr.c
> @@ -61,13 +61,20 @@ int amdgpu_va_range_query(amdgpu_device_handle dev,
> drm_private void amdgpu_vamgr_init(struct amdgpu_bo_va_mgr *mgr, uint64_t start,
> uint64_t max, uint64_t alignment)
> {
> - mgr->va_offset = start;
> + struct amdgpu_bo_va_hole *n;
> +
> mgr->va_min = start;
> mgr->va_max = max;
> mgr->va_alignment = alignment;
>
> list_inithead(&mgr->va_holes);
> pthread_mutex_init(&mgr->bo_va_mutex, NULL);
> + pthread_mutex_lock(&mgr->bo_va_mutex);
> + n = calloc(1, sizeof(struct amdgpu_bo_va_hole));
> + n->size = mgr->va_max;
> + n->offset = mgr->va_min;
> + list_add(&n->list, &mgr->va_holes);
> + pthread_mutex_unlock(&mgr->bo_va_mutex);
> }
>
> drm_private void amdgpu_vamgr_deinit(struct amdgpu_bo_va_mgr *mgr)
> @@ -136,35 +143,8 @@ amdgpu_vamgr_find_va(struct amdgpu_bo_va_mgr *mgr, uint64_t size,
> }
> }
>
> - if (base_required) {
> - if (base_required < mgr->va_offset) {
> - pthread_mutex_unlock(&mgr->bo_va_mutex);
> - return AMDGPU_INVALID_VA_ADDRESS;
> - }
> - offset = mgr->va_offset;
> - waste = base_required - mgr->va_offset;
> - } else {
> - offset = mgr->va_offset;
> - waste = offset % alignment;
> - waste = waste ? alignment - waste : 0;
> - }
> -
> - if (offset + waste + size > mgr->va_max) {
> - pthread_mutex_unlock(&mgr->bo_va_mutex);
> - return AMDGPU_INVALID_VA_ADDRESS;
> - }
> -
> - if (waste) {
> - n = calloc(1, sizeof(struct amdgpu_bo_va_hole));
> - n->size = waste;
> - n->offset = offset;
> - list_add(&n->list, &mgr->va_holes);
> - }
> -
> - offset += waste;
> - mgr->va_offset += size + waste;
> pthread_mutex_unlock(&mgr->bo_va_mutex);
> - return offset;
> + return AMDGPU_INVALID_VA_ADDRESS;
> }
>
> static uint64_t amdgpu_vamgr_find_va_in_range(struct amdgpu_bo_va_mgr *mgr, uint64_t size,
> @@ -232,41 +212,14 @@ static uint64_t amdgpu_vamgr_find_va_in_range(struct amdgpu_bo_va_mgr *mgr, uint
> }
> }
>
> - if (mgr->va_offset > range_max) {
> - pthread_mutex_unlock(&mgr->bo_va_mutex);
> - return AMDGPU_INVALID_VA_ADDRESS;
> - } else if (mgr->va_offset > range_min) {
> - offset = mgr->va_offset;
> - waste = offset % alignment;
> - waste = waste ? alignment - waste : 0;
> - if (offset + waste + size > range_max) {
> - pthread_mutex_unlock(&mgr->bo_va_mutex);
> - return AMDGPU_INVALID_VA_ADDRESS;
> - }
> - } else {
> - offset = mgr->va_offset;
> - waste = range_min % alignment;
> - waste = waste ? alignment - waste : 0;
> - waste += range_min - offset ;
> - }
> -
> - if (waste) {
> - n = calloc(1, sizeof(struct amdgpu_bo_va_hole));
> - n->size = waste;
> - n->offset = offset;
> - list_add(&n->list, &mgr->va_holes);
> - }
> -
> - offset += waste;
> - mgr->va_offset = size + offset;
> pthread_mutex_unlock(&mgr->bo_va_mutex);
> - return offset;
> + return AMDGPU_INVALID_VA_ADDRESS;
> }
>
> drm_private void
> amdgpu_vamgr_free_va(struct amdgpu_bo_va_mgr *mgr, uint64_t va, uint64_t size)
> {
> - struct amdgpu_bo_va_hole *hole;
> + struct amdgpu_bo_va_hole *hole, *next;
>
> if (va == AMDGPU_INVALID_VA_ADDRESS)
> return;
> @@ -274,61 +227,48 @@ amdgpu_vamgr_free_va(struct amdgpu_bo_va_mgr *mgr, uint64_t va, uint64_t size)
> size = ALIGN(size, mgr->va_alignment);
>
> pthread_mutex_lock(&mgr->bo_va_mutex);
> - if ((va + size) == mgr->va_offset) {
> - mgr->va_offset = va;
> - /* Delete uppermost hole if it reaches the new top */
> - if (!LIST_IS_EMPTY(&mgr->va_holes)) {
> - hole = container_of(mgr->va_holes.next, hole, list);
> - if ((hole->offset + hole->size) == va) {
> - mgr->va_offset = hole->offset;
> - list_del(&hole->list);
> - free(hole);
> - }
> - }
> - } else {
> - struct amdgpu_bo_va_hole *next;
>
> - hole = container_of(&mgr->va_holes, hole, list);
> - LIST_FOR_EACH_ENTRY(next, &mgr->va_holes, list) {
> - if (next->offset < va)
> - break;
> - hole = next;
> - }
> + hole = container_of(&mgr->va_holes, hole, list);
> + LIST_FOR_EACH_ENTRY(next, &mgr->va_holes, list) {
> + if (next->offset < va)
> + break;
> + hole = next;
> + }
>
> - if (&hole->list != &mgr->va_holes) {
> - /* Grow upper hole if it's adjacent */
> - if (hole->offset == (va + size)) {
> - hole->offset = va;
> - hole->size += size;
> - /* Merge lower hole if it's adjacent */
> - if (next != hole
> - && &next->list != &mgr->va_holes
> - && (next->offset + next->size) == va) {
> - next->size += hole->size;
> - list_del(&hole->list);
> - free(hole);
> - }
> - goto out;
> + if (&hole->list != &mgr->va_holes) {
> + /* Grow upper hole if it's adjacent */
> + if (hole->offset == (va + size)) {
> + hole->offset = va;
> + hole->size += size;
> + /* Merge lower hole if it's adjacent */
> + if (next != hole &&
> + &next->list != &mgr->va_holes &&
> + (next->offset + next->size) == va) {
> + next->size += hole->size;
> + list_del(&hole->list);
> + free(hole);
> }
> - }
> -
> - /* Grow lower hole if it's adjacent */
> - if (next != hole && &next->list != &mgr->va_holes &&
> - (next->offset + next->size) == va) {
> - next->size += size;
> goto out;
> }
> + }
>
> - /* FIXME on allocation failure we just lose virtual address space
> - * maybe print a warning
> - */
> - next = calloc(1, sizeof(struct amdgpu_bo_va_hole));
> - if (next) {
> - next->size = size;
> - next->offset = va;
> - list_add(&next->list, &hole->list);
> - }
> + /* Grow lower hole if it's adjacent */
> + if (next != hole && &next->list != &mgr->va_holes &&
> + (next->offset + next->size) == va) {
> + next->size += size;
> + goto out;
> }
> +
> + /* FIXME on allocation failure we just lose virtual address space
> + * maybe print a warning
> + */
> + next = calloc(1, sizeof(struct amdgpu_bo_va_hole));
> + if (next) {
> + next->size = size;
> + next->offset = va;
> + list_add(&next->list, &hole->list);
> + }
> +
> out:
> pthread_mutex_unlock(&mgr->bo_va_mutex);
> }
_______________________________________________
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 libdrm 2/2] libdrm: clean up non list code path for vamgr
[not found] ` <563c031e-2e11-eb51-bdce-589da435c9a8-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2018-01-12 8:17 ` Chunming Zhou
0 siblings, 0 replies; 12+ messages in thread
From: Chunming Zhou @ 2018-01-12 8:17 UTC (permalink / raw)
To: christian.koenig-5C7GfCeVMHo, Chunming Zhou,
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Cc: Hui.Deng-5C7GfCeVMHo
On 2018年01月12日 16:04, Christian König wrote:
> Am 12.01.2018 um 06:45 schrieb Chunming Zhou:
>> Change-Id: I7ca19a1f6404356a6c69ab4af27c8e13454f0279
>> Signed-off-by: Chunming Zhou <david1.zhou@amd.com>
>> ---
>> amdgpu/amdgpu_internal.h | 2 -
>> amdgpu/amdgpu_vamgr.c | 152
>> ++++++++++++++---------------------------------
>> 2 files changed, 46 insertions(+), 108 deletions(-)
>>
>> diff --git a/amdgpu/amdgpu_internal.h b/amdgpu/amdgpu_internal.h
>> index fd522f39..7484780b 100644
>> --- a/amdgpu/amdgpu_internal.h
>> +++ b/amdgpu/amdgpu_internal.h
>> @@ -53,8 +53,6 @@ struct amdgpu_bo_va_hole {
>> };
>> struct amdgpu_bo_va_mgr {
>> - /* the start virtual address */
>> - uint64_t va_offset;
>> uint64_t va_min;
>> uint64_t va_max;
>
> Is va_min and va_max actually still used after that series?
Yes, still used for svm manager.
> If not I would remove them as well.
>
> Apart from that I would indeed add the warning when the calloc during
> free fails.
>
> With that fixed the series is Reviewed-by: Christian König
> <christian.koenig@amd.com>.
Thanks for review.
Regards,
David Zhou
>
> Regards,
> Christian.
>
>> struct list_head va_holes;
>> diff --git a/amdgpu/amdgpu_vamgr.c b/amdgpu/amdgpu_vamgr.c
>> index 66bb8ecd..b826ac81 100644
>> --- a/amdgpu/amdgpu_vamgr.c
>> +++ b/amdgpu/amdgpu_vamgr.c
>> @@ -61,13 +61,20 @@ int amdgpu_va_range_query(amdgpu_device_handle dev,
>> drm_private void amdgpu_vamgr_init(struct amdgpu_bo_va_mgr *mgr,
>> uint64_t start,
>> uint64_t max, uint64_t alignment)
>> {
>> - mgr->va_offset = start;
>> + struct amdgpu_bo_va_hole *n;
>> +
>> mgr->va_min = start;
>> mgr->va_max = max;
>> mgr->va_alignment = alignment;
>> list_inithead(&mgr->va_holes);
>> pthread_mutex_init(&mgr->bo_va_mutex, NULL);
>> + pthread_mutex_lock(&mgr->bo_va_mutex);
>> + n = calloc(1, sizeof(struct amdgpu_bo_va_hole));
>> + n->size = mgr->va_max;
>> + n->offset = mgr->va_min;
>> + list_add(&n->list, &mgr->va_holes);
>> + pthread_mutex_unlock(&mgr->bo_va_mutex);
>> }
>> drm_private void amdgpu_vamgr_deinit(struct amdgpu_bo_va_mgr *mgr)
>> @@ -136,35 +143,8 @@ amdgpu_vamgr_find_va(struct amdgpu_bo_va_mgr
>> *mgr, uint64_t size,
>> }
>> }
>> - if (base_required) {
>> - if (base_required < mgr->va_offset) {
>> - pthread_mutex_unlock(&mgr->bo_va_mutex);
>> - return AMDGPU_INVALID_VA_ADDRESS;
>> - }
>> - offset = mgr->va_offset;
>> - waste = base_required - mgr->va_offset;
>> - } else {
>> - offset = mgr->va_offset;
>> - waste = offset % alignment;
>> - waste = waste ? alignment - waste : 0;
>> - }
>> -
>> - if (offset + waste + size > mgr->va_max) {
>> - pthread_mutex_unlock(&mgr->bo_va_mutex);
>> - return AMDGPU_INVALID_VA_ADDRESS;
>> - }
>> -
>> - if (waste) {
>> - n = calloc(1, sizeof(struct amdgpu_bo_va_hole));
>> - n->size = waste;
>> - n->offset = offset;
>> - list_add(&n->list, &mgr->va_holes);
>> - }
>> -
>> - offset += waste;
>> - mgr->va_offset += size + waste;
>> pthread_mutex_unlock(&mgr->bo_va_mutex);
>> - return offset;
>> + return AMDGPU_INVALID_VA_ADDRESS;
>> }
>> static uint64_t amdgpu_vamgr_find_va_in_range(struct
>> amdgpu_bo_va_mgr *mgr, uint64_t size,
>> @@ -232,41 +212,14 @@ static uint64_t
>> amdgpu_vamgr_find_va_in_range(struct amdgpu_bo_va_mgr *mgr, uint
>> }
>> }
>> - if (mgr->va_offset > range_max) {
>> - pthread_mutex_unlock(&mgr->bo_va_mutex);
>> - return AMDGPU_INVALID_VA_ADDRESS;
>> - } else if (mgr->va_offset > range_min) {
>> - offset = mgr->va_offset;
>> - waste = offset % alignment;
>> - waste = waste ? alignment - waste : 0;
>> - if (offset + waste + size > range_max) {
>> - pthread_mutex_unlock(&mgr->bo_va_mutex);
>> - return AMDGPU_INVALID_VA_ADDRESS;
>> - }
>> - } else {
>> - offset = mgr->va_offset;
>> - waste = range_min % alignment;
>> - waste = waste ? alignment - waste : 0;
>> - waste += range_min - offset ;
>> - }
>> -
>> - if (waste) {
>> - n = calloc(1, sizeof(struct amdgpu_bo_va_hole));
>> - n->size = waste;
>> - n->offset = offset;
>> - list_add(&n->list, &mgr->va_holes);
>> - }
>> -
>> - offset += waste;
>> - mgr->va_offset = size + offset;
>> pthread_mutex_unlock(&mgr->bo_va_mutex);
>> - return offset;
>> + return AMDGPU_INVALID_VA_ADDRESS;
>> }
>> drm_private void
>> amdgpu_vamgr_free_va(struct amdgpu_bo_va_mgr *mgr, uint64_t va,
>> uint64_t size)
>> {
>> - struct amdgpu_bo_va_hole *hole;
>> + struct amdgpu_bo_va_hole *hole, *next;
>> if (va == AMDGPU_INVALID_VA_ADDRESS)
>> return;
>> @@ -274,61 +227,48 @@ amdgpu_vamgr_free_va(struct amdgpu_bo_va_mgr
>> *mgr, uint64_t va, uint64_t size)
>> size = ALIGN(size, mgr->va_alignment);
>> pthread_mutex_lock(&mgr->bo_va_mutex);
>> - if ((va + size) == mgr->va_offset) {
>> - mgr->va_offset = va;
>> - /* Delete uppermost hole if it reaches the new top */
>> - if (!LIST_IS_EMPTY(&mgr->va_holes)) {
>> - hole = container_of(mgr->va_holes.next, hole, list);
>> - if ((hole->offset + hole->size) == va) {
>> - mgr->va_offset = hole->offset;
>> - list_del(&hole->list);
>> - free(hole);
>> - }
>> - }
>> - } else {
>> - struct amdgpu_bo_va_hole *next;
>> - hole = container_of(&mgr->va_holes, hole, list);
>> - LIST_FOR_EACH_ENTRY(next, &mgr->va_holes, list) {
>> - if (next->offset < va)
>> - break;
>> - hole = next;
>> - }
>> + hole = container_of(&mgr->va_holes, hole, list);
>> + LIST_FOR_EACH_ENTRY(next, &mgr->va_holes, list) {
>> + if (next->offset < va)
>> + break;
>> + hole = next;
>> + }
>> - if (&hole->list != &mgr->va_holes) {
>> - /* Grow upper hole if it's adjacent */
>> - if (hole->offset == (va + size)) {
>> - hole->offset = va;
>> - hole->size += size;
>> - /* Merge lower hole if it's adjacent */
>> - if (next != hole
>> - && &next->list != &mgr->va_holes
>> - && (next->offset + next->size) == va) {
>> - next->size += hole->size;
>> - list_del(&hole->list);
>> - free(hole);
>> - }
>> - goto out;
>> + if (&hole->list != &mgr->va_holes) {
>> + /* Grow upper hole if it's adjacent */
>> + if (hole->offset == (va + size)) {
>> + hole->offset = va;
>> + hole->size += size;
>> + /* Merge lower hole if it's adjacent */
>> + if (next != hole &&
>> + &next->list != &mgr->va_holes &&
>> + (next->offset + next->size) == va) {
>> + next->size += hole->size;
>> + list_del(&hole->list);
>> + free(hole);
>> }
>> - }
>> -
>> - /* Grow lower hole if it's adjacent */
>> - if (next != hole && &next->list != &mgr->va_holes &&
>> - (next->offset + next->size) == va) {
>> - next->size += size;
>> goto out;
>> }
>> + }
>> - /* FIXME on allocation failure we just lose virtual
>> address space
>> - * maybe print a warning
>> - */
>> - next = calloc(1, sizeof(struct amdgpu_bo_va_hole));
>> - if (next) {
>> - next->size = size;
>> - next->offset = va;
>> - list_add(&next->list, &hole->list);
>> - }
>> + /* Grow lower hole if it's adjacent */
>> + if (next != hole && &next->list != &mgr->va_holes &&
>> + (next->offset + next->size) == va) {
>> + next->size += size;
>> + goto out;
>> }
>> +
>> + /* FIXME on allocation failure we just lose virtual address space
>> + * maybe print a warning
>> + */
>> + next = calloc(1, sizeof(struct amdgpu_bo_va_hole));
>> + if (next) {
>> + next->size = size;
>> + next->offset = va;
>> + list_add(&next->list, &hole->list);
>> + }
>> +
>> out:
>> pthread_mutex_unlock(&mgr->bo_va_mutex);
>> }
>
_______________________________________________
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 libdrm 2/2] libdrm: clean up non list code path for vamgr
[not found] ` <20180112054554.19585-2-david1.zhou-5C7GfCeVMHo@public.gmane.org>
2018-01-12 8:04 ` Christian König
@ 2018-02-08 9:01 ` Michel Dänzer
[not found] ` <e3722edc-8ca4-4730-d649-2b5a959b92c1-otUistvHUpPR7s880joybQ@public.gmane.org>
1 sibling, 1 reply; 12+ messages in thread
From: Michel Dänzer @ 2018-02-08 9:01 UTC (permalink / raw)
To: Chunming Zhou
Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Hui.Deng-5C7GfCeVMHo
Hi David,
this change completely broke radeonsi due to memory management errors
(see valgrind output for glxgears below), so I had to revert it.
==4831== Memcheck, a memory error detector
==4831== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==4831== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==4831== Command: glxgears
==4831==
==4831== Invalid read of size 8
==4831== at 0xAE4E79B: list_add (util_double_list.h:56)
==4831== by 0xAE4E79B: amdgpu_vamgr_free_va.part.0 (amdgpu_vamgr.c:184)
==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
==4831== by 0x9DD5067: pb_cache_release_all_buffers (pb_cache.c:241)
==4831== by 0x9DD5260: pb_cache_deinit (pb_cache.c:313)
==4831== by 0xA0FFD82: amdgpu_winsys_destroy (amdgpu_winsys.c:99)
==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
==4831== by 0x535BCCE: FreeScreenConfigs.isra.3 (glxext.c:221)
==4831== Address 0x151eccb8 is 8 bytes inside a block of size 32 free'd
==4831== at 0x4C2DDBB: free (vg_replace_malloc.c:530)
==4831== by 0xAE4E85B: amdgpu_vamgr_free_va.part.0 (amdgpu_vamgr.c:165)
==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
==4831== by 0x9DD5067: pb_cache_release_all_buffers (pb_cache.c:241)
==4831== by 0x9DD5260: pb_cache_deinit (pb_cache.c:313)
==4831== by 0xA0FFD82: amdgpu_winsys_destroy (amdgpu_winsys.c:99)
==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
==4831== Block was alloc'd at
==4831== at 0x4C2EBA5: calloc (vg_replace_malloc.c:711)
==4831== by 0xAE4E795: amdgpu_vamgr_free_va.part.0 (amdgpu_vamgr.c:180)
==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
==4831== by 0x9DD5067: pb_cache_release_all_buffers (pb_cache.c:241)
==4831== by 0x9DD5260: pb_cache_deinit (pb_cache.c:313)
==4831== by 0xA0FFD82: amdgpu_winsys_destroy (amdgpu_winsys.c:99)
==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
==4831==
==4831== Invalid read of size 8
==4831== at 0xAE4E7B0: list_add (util_double_list.h:57)
==4831== by 0xAE4E7B0: amdgpu_vamgr_free_va.part.0 (amdgpu_vamgr.c:184)
==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
==4831== by 0x9DD5067: pb_cache_release_all_buffers (pb_cache.c:241)
==4831== by 0x9DD5260: pb_cache_deinit (pb_cache.c:313)
==4831== by 0xA0FFD82: amdgpu_winsys_destroy (amdgpu_winsys.c:99)
==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
==4831== by 0x535BCCE: FreeScreenConfigs.isra.3 (glxext.c:221)
==4831== Address 0x151eccb8 is 8 bytes inside a block of size 32 free'd
==4831== at 0x4C2DDBB: free (vg_replace_malloc.c:530)
==4831== by 0xAE4E85B: amdgpu_vamgr_free_va.part.0 (amdgpu_vamgr.c:165)
==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
==4831== by 0x9DD5067: pb_cache_release_all_buffers (pb_cache.c:241)
==4831== by 0x9DD5260: pb_cache_deinit (pb_cache.c:313)
==4831== by 0xA0FFD82: amdgpu_winsys_destroy (amdgpu_winsys.c:99)
==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
==4831== Block was alloc'd at
==4831== at 0x4C2EBA5: calloc (vg_replace_malloc.c:711)
==4831== by 0xAE4E795: amdgpu_vamgr_free_va.part.0 (amdgpu_vamgr.c:180)
==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
==4831== by 0x9DD5067: pb_cache_release_all_buffers (pb_cache.c:241)
==4831== by 0x9DD5260: pb_cache_deinit (pb_cache.c:313)
==4831== by 0xA0FFD82: amdgpu_winsys_destroy (amdgpu_winsys.c:99)
==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
==4831==
==4831== Invalid write of size 8
==4831== at 0xAE4E7BB: list_add (util_double_list.h:58)
==4831== by 0xAE4E7BB: amdgpu_vamgr_free_va.part.0 (amdgpu_vamgr.c:184)
==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
==4831== by 0x9DD5067: pb_cache_release_all_buffers (pb_cache.c:241)
==4831== by 0x9DD5260: pb_cache_deinit (pb_cache.c:313)
==4831== by 0xA0FFD82: amdgpu_winsys_destroy (amdgpu_winsys.c:99)
==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
==4831== by 0x535BCCE: FreeScreenConfigs.isra.3 (glxext.c:221)
==4831== Address 0x151eccb8 is 8 bytes inside a block of size 32 free'd
==4831== at 0x4C2DDBB: free (vg_replace_malloc.c:530)
==4831== by 0xAE4E85B: amdgpu_vamgr_free_va.part.0 (amdgpu_vamgr.c:165)
==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
==4831== by 0x9DD5067: pb_cache_release_all_buffers (pb_cache.c:241)
==4831== by 0x9DD5260: pb_cache_deinit (pb_cache.c:313)
==4831== by 0xA0FFD82: amdgpu_winsys_destroy (amdgpu_winsys.c:99)
==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
==4831== Block was alloc'd at
==4831== at 0x4C2EBA5: calloc (vg_replace_malloc.c:711)
==4831== by 0xAE4E795: amdgpu_vamgr_free_va.part.0 (amdgpu_vamgr.c:180)
==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
==4831== by 0x9DD5067: pb_cache_release_all_buffers (pb_cache.c:241)
==4831== by 0x9DD5260: pb_cache_deinit (pb_cache.c:313)
==4831== by 0xA0FFD82: amdgpu_winsys_destroy (amdgpu_winsys.c:99)
==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
==4831==
==4831== Invalid read of size 8
==4831== at 0xAE4E730: amdgpu_vamgr_free_va.part.0 (amdgpu_vamgr.c:149)
==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
==4831== by 0x9DD5067: pb_cache_release_all_buffers (pb_cache.c:241)
==4831== by 0x9DD5260: pb_cache_deinit (pb_cache.c:313)
==4831== by 0xA0FFD82: amdgpu_winsys_destroy (amdgpu_winsys.c:99)
==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
==4831== by 0x535BCCE: FreeScreenConfigs.isra.3 (glxext.c:221)
==4831== Address 0x150164b0 is 16 bytes inside a block of size 32 free'd
==4831== at 0x4C2DDBB: free (vg_replace_malloc.c:530)
==4831== by 0xAE4E85B: amdgpu_vamgr_free_va.part.0 (amdgpu_vamgr.c:165)
==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
==4831== by 0x9DD5067: pb_cache_release_all_buffers (pb_cache.c:241)
==4831== by 0x9DD5260: pb_cache_deinit (pb_cache.c:313)
==4831== by 0xA0FFD82: amdgpu_winsys_destroy (amdgpu_winsys.c:99)
==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
==4831== Block was alloc'd at
==4831== at 0x4C2EBA5: calloc (vg_replace_malloc.c:711)
==4831== by 0xAE4E795: amdgpu_vamgr_free_va.part.0 (amdgpu_vamgr.c:180)
==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
==4831== by 0xA12EADF: pb_destroy (pb_buffer.h:232)
==4831== by 0xA12EADF: pb_reference (pb_buffer.h:242)
==4831== by 0xA12EADF: r600_texture_destroy (r600_texture.c:825)
==4831== by 0x9D8490E: pipe_resource_reference (u_inlines.h:144)
==4831== by 0x9D8490E: dri2_destroy_image (dri_helpers.c:317)
==4831== by 0x538A94D: dri3_free_render_buffer.isra.3 (loader_dri3_helper.c:223)
==4831== by 0x538B347: loader_dri3_drawable_fini (loader_dri3_helper.c:238)
==4831== by 0x53861E4: dri3_destroy_drawable (dri3_glx.c:338)
==4831== by 0x537F739: driReleaseDrawables (dri_common.c:481)
==4831== by 0x53866C2: dri3_destroy_context (dri3_glx.c:166)
==4831== by 0x5358792: glXDestroyContext (glxcmds.c:471)
==4831==
==4831== Invalid read of size 8
==4831== at 0xAE4E73D: amdgpu_vamgr_free_va.part.0 (amdgpu_vamgr.c:148)
==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
==4831== by 0x9DD5067: pb_cache_release_all_buffers (pb_cache.c:241)
==4831== by 0x9DD5260: pb_cache_deinit (pb_cache.c:313)
==4831== by 0xA0FFD82: amdgpu_winsys_destroy (amdgpu_winsys.c:99)
==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
==4831== by 0x535BCCE: FreeScreenConfigs.isra.3 (glxext.c:221)
==4831== Address 0x150164a8 is 8 bytes inside a block of size 32 free'd
==4831== at 0x4C2DDBB: free (vg_replace_malloc.c:530)
==4831== by 0xAE4E85B: amdgpu_vamgr_free_va.part.0 (amdgpu_vamgr.c:165)
==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
==4831== by 0x9DD5067: pb_cache_release_all_buffers (pb_cache.c:241)
==4831== by 0x9DD5260: pb_cache_deinit (pb_cache.c:313)
==4831== by 0xA0FFD82: amdgpu_winsys_destroy (amdgpu_winsys.c:99)
==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
==4831== Block was alloc'd at
==4831== at 0x4C2EBA5: calloc (vg_replace_malloc.c:711)
==4831== by 0xAE4E795: amdgpu_vamgr_free_va.part.0 (amdgpu_vamgr.c:180)
==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
==4831== by 0xA12EADF: pb_destroy (pb_buffer.h:232)
==4831== by 0xA12EADF: pb_reference (pb_buffer.h:242)
==4831== by 0xA12EADF: r600_texture_destroy (r600_texture.c:825)
==4831== by 0x9D8490E: pipe_resource_reference (u_inlines.h:144)
==4831== by 0x9D8490E: dri2_destroy_image (dri_helpers.c:317)
==4831== by 0x538A94D: dri3_free_render_buffer.isra.3 (loader_dri3_helper.c:223)
==4831== by 0x538B347: loader_dri3_drawable_fini (loader_dri3_helper.c:238)
==4831== by 0x53861E4: dri3_destroy_drawable (dri3_glx.c:338)
==4831== by 0x537F739: driReleaseDrawables (dri_common.c:481)
==4831== by 0x53866C2: dri3_destroy_context (dri3_glx.c:166)
==4831== by 0x5358792: glXDestroyContext (glxcmds.c:471)
==4831==
==4831== Invalid write of size 8
==4831== at 0xAE4E983: list_del (util_double_list.h:80)
==4831== by 0xAE4E983: amdgpu_vamgr_deinit (amdgpu_vamgr.c:70)
==4831== by 0xAE4D883: amdgpu_device_free_internal (amdgpu_device.c:134)
==4831== by 0xAE4DD9B: amdgpu_device_reference (amdgpu_device.c:164)
==4831== by 0xAE4DD9B: amdgpu_device_deinitialize (amdgpu_device.c:307)
==4831== by 0xA0FFD9A: do_winsys_deinit (amdgpu_winsys.c:84)
==4831== by 0xA0FFD9A: amdgpu_winsys_destroy (amdgpu_winsys.c:101)
==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
==4831== by 0x535BCCE: FreeScreenConfigs.isra.3 (glxext.c:221)
==4831== by 0x535BD4E: glx_display_free (glxext.c:244)
==4831== by 0x535BE8D: __glXCloseDisplay (glxext.c:299)
==4831== Address 0x150164a0 is 0 bytes inside a block of size 32 free'd
==4831== at 0x4C2DDBB: free (vg_replace_malloc.c:530)
==4831== by 0xAE4E85B: amdgpu_vamgr_free_va.part.0 (amdgpu_vamgr.c:165)
==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
==4831== by 0x9DD5067: pb_cache_release_all_buffers (pb_cache.c:241)
==4831== by 0x9DD5260: pb_cache_deinit (pb_cache.c:313)
==4831== by 0xA0FFD82: amdgpu_winsys_destroy (amdgpu_winsys.c:99)
==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
==4831== Block was alloc'd at
==4831== at 0x4C2EBA5: calloc (vg_replace_malloc.c:711)
==4831== by 0xAE4E795: amdgpu_vamgr_free_va.part.0 (amdgpu_vamgr.c:180)
==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
==4831== by 0xA12EADF: pb_destroy (pb_buffer.h:232)
==4831== by 0xA12EADF: pb_reference (pb_buffer.h:242)
==4831== by 0xA12EADF: r600_texture_destroy (r600_texture.c:825)
==4831== by 0x9D8490E: pipe_resource_reference (u_inlines.h:144)
==4831== by 0x9D8490E: dri2_destroy_image (dri_helpers.c:317)
==4831== by 0x538A94D: dri3_free_render_buffer.isra.3 (loader_dri3_helper.c:223)
==4831== by 0x538B347: loader_dri3_drawable_fini (loader_dri3_helper.c:238)
==4831== by 0x53861E4: dri3_destroy_drawable (dri3_glx.c:338)
==4831== by 0x537F739: driReleaseDrawables (dri_common.c:481)
==4831== by 0x53866C2: dri3_destroy_context (dri3_glx.c:166)
==4831== by 0x5358792: glXDestroyContext (glxcmds.c:471)
==4831==
==4831== Invalid read of size 8
==4831== at 0xAE4E98B: amdgpu_vamgr_deinit (amdgpu_vamgr.c:69)
==4831== by 0xAE4D883: amdgpu_device_free_internal (amdgpu_device.c:134)
==4831== by 0xAE4DD9B: amdgpu_device_reference (amdgpu_device.c:164)
==4831== by 0xAE4DD9B: amdgpu_device_deinitialize (amdgpu_device.c:307)
==4831== by 0xA0FFD9A: do_winsys_deinit (amdgpu_winsys.c:84)
==4831== by 0xA0FFD9A: amdgpu_winsys_destroy (amdgpu_winsys.c:101)
==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
==4831== by 0x535BCCE: FreeScreenConfigs.isra.3 (glxext.c:221)
==4831== by 0x535BD4E: glx_display_free (glxext.c:244)
==4831== by 0x535BE8D: __glXCloseDisplay (glxext.c:299)
==4831== Address 0x150164a8 is 8 bytes inside a block of size 32 free'd
==4831== at 0x4C2DDBB: free (vg_replace_malloc.c:530)
==4831== by 0xAE4E85B: amdgpu_vamgr_free_va.part.0 (amdgpu_vamgr.c:165)
==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
==4831== by 0x9DD5067: pb_cache_release_all_buffers (pb_cache.c:241)
==4831== by 0x9DD5260: pb_cache_deinit (pb_cache.c:313)
==4831== by 0xA0FFD82: amdgpu_winsys_destroy (amdgpu_winsys.c:99)
==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
==4831== Block was alloc'd at
==4831== at 0x4C2EBA5: calloc (vg_replace_malloc.c:711)
==4831== by 0xAE4E795: amdgpu_vamgr_free_va.part.0 (amdgpu_vamgr.c:180)
==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
==4831== by 0xA12EADF: pb_destroy (pb_buffer.h:232)
==4831== by 0xA12EADF: pb_reference (pb_buffer.h:242)
==4831== by 0xA12EADF: r600_texture_destroy (r600_texture.c:825)
==4831== by 0x9D8490E: pipe_resource_reference (u_inlines.h:144)
==4831== by 0x9D8490E: dri2_destroy_image (dri_helpers.c:317)
==4831== by 0x538A94D: dri3_free_render_buffer.isra.3 (loader_dri3_helper.c:223)
==4831== by 0x538B347: loader_dri3_drawable_fini (loader_dri3_helper.c:238)
==4831== by 0x53861E4: dri3_destroy_drawable (dri3_glx.c:338)
==4831== by 0x537F739: driReleaseDrawables (dri_common.c:481)
==4831== by 0x53866C2: dri3_destroy_context (dri3_glx.c:166)
==4831== by 0x5358792: glXDestroyContext (glxcmds.c:471)
==4831==
==4831== Invalid read of size 8
==4831== at 0xAE4E978: list_del (util_double_list.h:79)
==4831== by 0xAE4E978: amdgpu_vamgr_deinit (amdgpu_vamgr.c:70)
==4831== by 0xAE4D883: amdgpu_device_free_internal (amdgpu_device.c:134)
==4831== by 0xAE4DD9B: amdgpu_device_reference (amdgpu_device.c:164)
==4831== by 0xAE4DD9B: amdgpu_device_deinitialize (amdgpu_device.c:307)
==4831== by 0xA0FFD9A: do_winsys_deinit (amdgpu_winsys.c:84)
==4831== by 0xA0FFD9A: amdgpu_winsys_destroy (amdgpu_winsys.c:101)
==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
==4831== by 0x535BCCE: FreeScreenConfigs.isra.3 (glxext.c:221)
==4831== by 0x535BD4E: glx_display_free (glxext.c:244)
==4831== by 0x535BE8D: __glXCloseDisplay (glxext.c:299)
==4831== Address 0x150164a0 is 0 bytes inside a block of size 32 free'd
==4831== at 0x4C2DDBB: free (vg_replace_malloc.c:530)
==4831== by 0xAE4E85B: amdgpu_vamgr_free_va.part.0 (amdgpu_vamgr.c:165)
==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
==4831== by 0x9DD5067: pb_cache_release_all_buffers (pb_cache.c:241)
==4831== by 0x9DD5260: pb_cache_deinit (pb_cache.c:313)
==4831== by 0xA0FFD82: amdgpu_winsys_destroy (amdgpu_winsys.c:99)
==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
==4831== Block was alloc'd at
==4831== at 0x4C2EBA5: calloc (vg_replace_malloc.c:711)
==4831== by 0xAE4E795: amdgpu_vamgr_free_va.part.0 (amdgpu_vamgr.c:180)
==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
==4831== by 0xA12EADF: pb_destroy (pb_buffer.h:232)
==4831== by 0xA12EADF: pb_reference (pb_buffer.h:242)
==4831== by 0xA12EADF: r600_texture_destroy (r600_texture.c:825)
==4831== by 0x9D8490E: pipe_resource_reference (u_inlines.h:144)
==4831== by 0x9D8490E: dri2_destroy_image (dri_helpers.c:317)
==4831== by 0x538A94D: dri3_free_render_buffer.isra.3 (loader_dri3_helper.c:223)
==4831== by 0x538B347: loader_dri3_drawable_fini (loader_dri3_helper.c:238)
==4831== by 0x53861E4: dri3_destroy_drawable (dri3_glx.c:338)
==4831== by 0x537F739: driReleaseDrawables (dri_common.c:481)
==4831== by 0x53866C2: dri3_destroy_context (dri3_glx.c:166)
==4831== by 0x5358792: glXDestroyContext (glxcmds.c:471)
==4831==
==4831== Invalid read of size 8
==4831== at 0xAE4E97F: list_del (util_double_list.h:80)
==4831== by 0xAE4E97F: amdgpu_vamgr_deinit (amdgpu_vamgr.c:70)
==4831== by 0xAE4D883: amdgpu_device_free_internal (amdgpu_device.c:134)
==4831== by 0xAE4DD9B: amdgpu_device_reference (amdgpu_device.c:164)
==4831== by 0xAE4DD9B: amdgpu_device_deinitialize (amdgpu_device.c:307)
==4831== by 0xA0FFD9A: do_winsys_deinit (amdgpu_winsys.c:84)
==4831== by 0xA0FFD9A: amdgpu_winsys_destroy (amdgpu_winsys.c:101)
==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
==4831== by 0x535BCCE: FreeScreenConfigs.isra.3 (glxext.c:221)
==4831== by 0x535BD4E: glx_display_free (glxext.c:244)
==4831== by 0x535BE8D: __glXCloseDisplay (glxext.c:299)
==4831== Address 0x150164a8 is 8 bytes inside a block of size 32 free'd
==4831== at 0x4C2DDBB: free (vg_replace_malloc.c:530)
==4831== by 0xAE4E85B: amdgpu_vamgr_free_va.part.0 (amdgpu_vamgr.c:165)
==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
==4831== by 0x9DD5067: pb_cache_release_all_buffers (pb_cache.c:241)
==4831== by 0x9DD5260: pb_cache_deinit (pb_cache.c:313)
==4831== by 0xA0FFD82: amdgpu_winsys_destroy (amdgpu_winsys.c:99)
==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
==4831== Block was alloc'd at
==4831== at 0x4C2EBA5: calloc (vg_replace_malloc.c:711)
==4831== by 0xAE4E795: amdgpu_vamgr_free_va.part.0 (amdgpu_vamgr.c:180)
==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
==4831== by 0xA12EADF: pb_destroy (pb_buffer.h:232)
==4831== by 0xA12EADF: pb_reference (pb_buffer.h:242)
==4831== by 0xA12EADF: r600_texture_destroy (r600_texture.c:825)
==4831== by 0x9D8490E: pipe_resource_reference (u_inlines.h:144)
==4831== by 0x9D8490E: dri2_destroy_image (dri_helpers.c:317)
==4831== by 0x538A94D: dri3_free_render_buffer.isra.3 (loader_dri3_helper.c:223)
==4831== by 0x538B347: loader_dri3_drawable_fini (loader_dri3_helper.c:238)
==4831== by 0x53861E4: dri3_destroy_drawable (dri3_glx.c:338)
==4831== by 0x537F739: driReleaseDrawables (dri_common.c:481)
==4831== by 0x53866C2: dri3_destroy_context (dri3_glx.c:166)
==4831== by 0x5358792: glXDestroyContext (glxcmds.c:471)
==4831==
==4831== Invalid free() / delete / delete[] / realloc()
==4831== at 0x4C2DDBB: free (vg_replace_malloc.c:530)
==4831== by 0xAE4E98A: amdgpu_vamgr_deinit (amdgpu_vamgr.c:71)
==4831== by 0xAE4D883: amdgpu_device_free_internal (amdgpu_device.c:134)
==4831== by 0xAE4DD9B: amdgpu_device_reference (amdgpu_device.c:164)
==4831== by 0xAE4DD9B: amdgpu_device_deinitialize (amdgpu_device.c:307)
==4831== by 0xA0FFD9A: do_winsys_deinit (amdgpu_winsys.c:84)
==4831== by 0xA0FFD9A: amdgpu_winsys_destroy (amdgpu_winsys.c:101)
==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
==4831== by 0x535BCCE: FreeScreenConfigs.isra.3 (glxext.c:221)
==4831== by 0x535BD4E: glx_display_free (glxext.c:244)
==4831== Address 0x150164a0 is 0 bytes inside a block of size 32 free'd
==4831== at 0x4C2DDBB: free (vg_replace_malloc.c:530)
==4831== by 0xAE4E85B: amdgpu_vamgr_free_va.part.0 (amdgpu_vamgr.c:165)
==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
==4831== by 0x9DD5067: pb_cache_release_all_buffers (pb_cache.c:241)
==4831== by 0x9DD5260: pb_cache_deinit (pb_cache.c:313)
==4831== by 0xA0FFD82: amdgpu_winsys_destroy (amdgpu_winsys.c:99)
==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
==4831== Block was alloc'd at
==4831== at 0x4C2EBA5: calloc (vg_replace_malloc.c:711)
==4831== by 0xAE4E795: amdgpu_vamgr_free_va.part.0 (amdgpu_vamgr.c:180)
==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
==4831== by 0xA12EADF: pb_destroy (pb_buffer.h:232)
==4831== by 0xA12EADF: pb_reference (pb_buffer.h:242)
==4831== by 0xA12EADF: r600_texture_destroy (r600_texture.c:825)
==4831== by 0x9D8490E: pipe_resource_reference (u_inlines.h:144)
==4831== by 0x9D8490E: dri2_destroy_image (dri_helpers.c:317)
==4831== by 0x538A94D: dri3_free_render_buffer.isra.3 (loader_dri3_helper.c:223)
==4831== by 0x538B347: loader_dri3_drawable_fini (loader_dri3_helper.c:238)
==4831== by 0x53861E4: dri3_destroy_drawable (dri3_glx.c:338)
==4831== by 0x537F739: driReleaseDrawables (dri_common.c:481)
==4831== by 0x53866C2: dri3_destroy_context (dri3_glx.c:166)
==4831== by 0x5358792: glXDestroyContext (glxcmds.c:471)
==4831==
==4831==
==4831== HEAP SUMMARY:
==4831== in use at exit: 156,580 bytes in 1,724 blocks
==4831== total heap usage: 66,624 allocs, 64,901 frees, 32,392,118 bytes allocated
==4831==
==4831== LEAK SUMMARY:
==4831== definitely lost: 96 bytes in 3 blocks
==4831== indirectly lost: 0 bytes in 0 blocks
==4831== possibly lost: 0 bytes in 0 blocks
==4831== still reachable: 156,484 bytes in 1,721 blocks
==4831== suppressed: 0 bytes in 0 blocks
==4831== Rerun with --leak-check=full to see details of leaked memory
==4831==
==4831== For counts of detected and suppressed errors, rerun with: -v
==4831== ERROR SUMMARY: 19 errors from 10 contexts (suppressed: 0 from 0)
--
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 libdrm 2/2] libdrm: clean up non list code path for vamgr
[not found] ` <e3722edc-8ca4-4730-d649-2b5a959b92c1-otUistvHUpPR7s880joybQ@public.gmane.org>
@ 2018-02-08 9:13 ` Chunming Zhou
[not found] ` <4a2036e5-820f-d62a-a773-2da1f575e1bc-5C7GfCeVMHo@public.gmane.org>
0 siblings, 1 reply; 12+ messages in thread
From: Chunming Zhou @ 2018-02-08 9:13 UTC (permalink / raw)
To: Michel Dänzer, Chunming Zhou
Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Hui.Deng-5C7GfCeVMHo
On 2018年02月08日 17:01, Michel Dänzer wrote:
> Hi David,
>
>
> this change completely broke radeonsi due to memory management errors
> (see valgrind output for glxgears below), so I had to revert it.
ok, I will look into what happens. Sorry for broken.
Regards,
David Zhou
>
>
> ==4831== Memcheck, a memory error detector
> ==4831== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
> ==4831== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
> ==4831== Command: glxgears
> ==4831==
> ==4831== Invalid read of size 8
> ==4831== at 0xAE4E79B: list_add (util_double_list.h:56)
> ==4831== by 0xAE4E79B: amdgpu_vamgr_free_va.part.0 (amdgpu_vamgr.c:184)
> ==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
> ==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
> ==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
> ==4831== by 0x9DD5067: pb_cache_release_all_buffers (pb_cache.c:241)
> ==4831== by 0x9DD5260: pb_cache_deinit (pb_cache.c:313)
> ==4831== by 0xA0FFD82: amdgpu_winsys_destroy (amdgpu_winsys.c:99)
> ==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
> ==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
> ==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
> ==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
> ==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
> ==4831== by 0x535BCCE: FreeScreenConfigs.isra.3 (glxext.c:221)
> ==4831== Address 0x151eccb8 is 8 bytes inside a block of size 32 free'd
> ==4831== at 0x4C2DDBB: free (vg_replace_malloc.c:530)
> ==4831== by 0xAE4E85B: amdgpu_vamgr_free_va.part.0 (amdgpu_vamgr.c:165)
> ==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
> ==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
> ==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
> ==4831== by 0x9DD5067: pb_cache_release_all_buffers (pb_cache.c:241)
> ==4831== by 0x9DD5260: pb_cache_deinit (pb_cache.c:313)
> ==4831== by 0xA0FFD82: amdgpu_winsys_destroy (amdgpu_winsys.c:99)
> ==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
> ==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
> ==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
> ==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
> ==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
> ==4831== Block was alloc'd at
> ==4831== at 0x4C2EBA5: calloc (vg_replace_malloc.c:711)
> ==4831== by 0xAE4E795: amdgpu_vamgr_free_va.part.0 (amdgpu_vamgr.c:180)
> ==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
> ==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
> ==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
> ==4831== by 0x9DD5067: pb_cache_release_all_buffers (pb_cache.c:241)
> ==4831== by 0x9DD5260: pb_cache_deinit (pb_cache.c:313)
> ==4831== by 0xA0FFD82: amdgpu_winsys_destroy (amdgpu_winsys.c:99)
> ==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
> ==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
> ==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
> ==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
> ==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
> ==4831==
> ==4831== Invalid read of size 8
> ==4831== at 0xAE4E7B0: list_add (util_double_list.h:57)
> ==4831== by 0xAE4E7B0: amdgpu_vamgr_free_va.part.0 (amdgpu_vamgr.c:184)
> ==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
> ==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
> ==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
> ==4831== by 0x9DD5067: pb_cache_release_all_buffers (pb_cache.c:241)
> ==4831== by 0x9DD5260: pb_cache_deinit (pb_cache.c:313)
> ==4831== by 0xA0FFD82: amdgpu_winsys_destroy (amdgpu_winsys.c:99)
> ==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
> ==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
> ==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
> ==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
> ==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
> ==4831== by 0x535BCCE: FreeScreenConfigs.isra.3 (glxext.c:221)
> ==4831== Address 0x151eccb8 is 8 bytes inside a block of size 32 free'd
> ==4831== at 0x4C2DDBB: free (vg_replace_malloc.c:530)
> ==4831== by 0xAE4E85B: amdgpu_vamgr_free_va.part.0 (amdgpu_vamgr.c:165)
> ==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
> ==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
> ==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
> ==4831== by 0x9DD5067: pb_cache_release_all_buffers (pb_cache.c:241)
> ==4831== by 0x9DD5260: pb_cache_deinit (pb_cache.c:313)
> ==4831== by 0xA0FFD82: amdgpu_winsys_destroy (amdgpu_winsys.c:99)
> ==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
> ==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
> ==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
> ==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
> ==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
> ==4831== Block was alloc'd at
> ==4831== at 0x4C2EBA5: calloc (vg_replace_malloc.c:711)
> ==4831== by 0xAE4E795: amdgpu_vamgr_free_va.part.0 (amdgpu_vamgr.c:180)
> ==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
> ==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
> ==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
> ==4831== by 0x9DD5067: pb_cache_release_all_buffers (pb_cache.c:241)
> ==4831== by 0x9DD5260: pb_cache_deinit (pb_cache.c:313)
> ==4831== by 0xA0FFD82: amdgpu_winsys_destroy (amdgpu_winsys.c:99)
> ==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
> ==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
> ==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
> ==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
> ==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
> ==4831==
> ==4831== Invalid write of size 8
> ==4831== at 0xAE4E7BB: list_add (util_double_list.h:58)
> ==4831== by 0xAE4E7BB: amdgpu_vamgr_free_va.part.0 (amdgpu_vamgr.c:184)
> ==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
> ==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
> ==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
> ==4831== by 0x9DD5067: pb_cache_release_all_buffers (pb_cache.c:241)
> ==4831== by 0x9DD5260: pb_cache_deinit (pb_cache.c:313)
> ==4831== by 0xA0FFD82: amdgpu_winsys_destroy (amdgpu_winsys.c:99)
> ==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
> ==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
> ==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
> ==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
> ==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
> ==4831== by 0x535BCCE: FreeScreenConfigs.isra.3 (glxext.c:221)
> ==4831== Address 0x151eccb8 is 8 bytes inside a block of size 32 free'd
> ==4831== at 0x4C2DDBB: free (vg_replace_malloc.c:530)
> ==4831== by 0xAE4E85B: amdgpu_vamgr_free_va.part.0 (amdgpu_vamgr.c:165)
> ==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
> ==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
> ==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
> ==4831== by 0x9DD5067: pb_cache_release_all_buffers (pb_cache.c:241)
> ==4831== by 0x9DD5260: pb_cache_deinit (pb_cache.c:313)
> ==4831== by 0xA0FFD82: amdgpu_winsys_destroy (amdgpu_winsys.c:99)
> ==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
> ==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
> ==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
> ==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
> ==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
> ==4831== Block was alloc'd at
> ==4831== at 0x4C2EBA5: calloc (vg_replace_malloc.c:711)
> ==4831== by 0xAE4E795: amdgpu_vamgr_free_va.part.0 (amdgpu_vamgr.c:180)
> ==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
> ==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
> ==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
> ==4831== by 0x9DD5067: pb_cache_release_all_buffers (pb_cache.c:241)
> ==4831== by 0x9DD5260: pb_cache_deinit (pb_cache.c:313)
> ==4831== by 0xA0FFD82: amdgpu_winsys_destroy (amdgpu_winsys.c:99)
> ==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
> ==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
> ==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
> ==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
> ==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
> ==4831==
> ==4831== Invalid read of size 8
> ==4831== at 0xAE4E730: amdgpu_vamgr_free_va.part.0 (amdgpu_vamgr.c:149)
> ==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
> ==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
> ==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
> ==4831== by 0x9DD5067: pb_cache_release_all_buffers (pb_cache.c:241)
> ==4831== by 0x9DD5260: pb_cache_deinit (pb_cache.c:313)
> ==4831== by 0xA0FFD82: amdgpu_winsys_destroy (amdgpu_winsys.c:99)
> ==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
> ==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
> ==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
> ==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
> ==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
> ==4831== by 0x535BCCE: FreeScreenConfigs.isra.3 (glxext.c:221)
> ==4831== Address 0x150164b0 is 16 bytes inside a block of size 32 free'd
> ==4831== at 0x4C2DDBB: free (vg_replace_malloc.c:530)
> ==4831== by 0xAE4E85B: amdgpu_vamgr_free_va.part.0 (amdgpu_vamgr.c:165)
> ==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
> ==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
> ==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
> ==4831== by 0x9DD5067: pb_cache_release_all_buffers (pb_cache.c:241)
> ==4831== by 0x9DD5260: pb_cache_deinit (pb_cache.c:313)
> ==4831== by 0xA0FFD82: amdgpu_winsys_destroy (amdgpu_winsys.c:99)
> ==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
> ==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
> ==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
> ==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
> ==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
> ==4831== Block was alloc'd at
> ==4831== at 0x4C2EBA5: calloc (vg_replace_malloc.c:711)
> ==4831== by 0xAE4E795: amdgpu_vamgr_free_va.part.0 (amdgpu_vamgr.c:180)
> ==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
> ==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
> ==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
> ==4831== by 0xA12EADF: pb_destroy (pb_buffer.h:232)
> ==4831== by 0xA12EADF: pb_reference (pb_buffer.h:242)
> ==4831== by 0xA12EADF: r600_texture_destroy (r600_texture.c:825)
> ==4831== by 0x9D8490E: pipe_resource_reference (u_inlines.h:144)
> ==4831== by 0x9D8490E: dri2_destroy_image (dri_helpers.c:317)
> ==4831== by 0x538A94D: dri3_free_render_buffer.isra.3 (loader_dri3_helper.c:223)
> ==4831== by 0x538B347: loader_dri3_drawable_fini (loader_dri3_helper.c:238)
> ==4831== by 0x53861E4: dri3_destroy_drawable (dri3_glx.c:338)
> ==4831== by 0x537F739: driReleaseDrawables (dri_common.c:481)
> ==4831== by 0x53866C2: dri3_destroy_context (dri3_glx.c:166)
> ==4831== by 0x5358792: glXDestroyContext (glxcmds.c:471)
> ==4831==
> ==4831== Invalid read of size 8
> ==4831== at 0xAE4E73D: amdgpu_vamgr_free_va.part.0 (amdgpu_vamgr.c:148)
> ==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
> ==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
> ==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
> ==4831== by 0x9DD5067: pb_cache_release_all_buffers (pb_cache.c:241)
> ==4831== by 0x9DD5260: pb_cache_deinit (pb_cache.c:313)
> ==4831== by 0xA0FFD82: amdgpu_winsys_destroy (amdgpu_winsys.c:99)
> ==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
> ==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
> ==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
> ==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
> ==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
> ==4831== by 0x535BCCE: FreeScreenConfigs.isra.3 (glxext.c:221)
> ==4831== Address 0x150164a8 is 8 bytes inside a block of size 32 free'd
> ==4831== at 0x4C2DDBB: free (vg_replace_malloc.c:530)
> ==4831== by 0xAE4E85B: amdgpu_vamgr_free_va.part.0 (amdgpu_vamgr.c:165)
> ==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
> ==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
> ==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
> ==4831== by 0x9DD5067: pb_cache_release_all_buffers (pb_cache.c:241)
> ==4831== by 0x9DD5260: pb_cache_deinit (pb_cache.c:313)
> ==4831== by 0xA0FFD82: amdgpu_winsys_destroy (amdgpu_winsys.c:99)
> ==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
> ==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
> ==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
> ==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
> ==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
> ==4831== Block was alloc'd at
> ==4831== at 0x4C2EBA5: calloc (vg_replace_malloc.c:711)
> ==4831== by 0xAE4E795: amdgpu_vamgr_free_va.part.0 (amdgpu_vamgr.c:180)
> ==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
> ==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
> ==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
> ==4831== by 0xA12EADF: pb_destroy (pb_buffer.h:232)
> ==4831== by 0xA12EADF: pb_reference (pb_buffer.h:242)
> ==4831== by 0xA12EADF: r600_texture_destroy (r600_texture.c:825)
> ==4831== by 0x9D8490E: pipe_resource_reference (u_inlines.h:144)
> ==4831== by 0x9D8490E: dri2_destroy_image (dri_helpers.c:317)
> ==4831== by 0x538A94D: dri3_free_render_buffer.isra.3 (loader_dri3_helper.c:223)
> ==4831== by 0x538B347: loader_dri3_drawable_fini (loader_dri3_helper.c:238)
> ==4831== by 0x53861E4: dri3_destroy_drawable (dri3_glx.c:338)
> ==4831== by 0x537F739: driReleaseDrawables (dri_common.c:481)
> ==4831== by 0x53866C2: dri3_destroy_context (dri3_glx.c:166)
> ==4831== by 0x5358792: glXDestroyContext (glxcmds.c:471)
> ==4831==
> ==4831== Invalid write of size 8
> ==4831== at 0xAE4E983: list_del (util_double_list.h:80)
> ==4831== by 0xAE4E983: amdgpu_vamgr_deinit (amdgpu_vamgr.c:70)
> ==4831== by 0xAE4D883: amdgpu_device_free_internal (amdgpu_device.c:134)
> ==4831== by 0xAE4DD9B: amdgpu_device_reference (amdgpu_device.c:164)
> ==4831== by 0xAE4DD9B: amdgpu_device_deinitialize (amdgpu_device.c:307)
> ==4831== by 0xA0FFD9A: do_winsys_deinit (amdgpu_winsys.c:84)
> ==4831== by 0xA0FFD9A: amdgpu_winsys_destroy (amdgpu_winsys.c:101)
> ==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
> ==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
> ==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
> ==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
> ==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
> ==4831== by 0x535BCCE: FreeScreenConfigs.isra.3 (glxext.c:221)
> ==4831== by 0x535BD4E: glx_display_free (glxext.c:244)
> ==4831== by 0x535BE8D: __glXCloseDisplay (glxext.c:299)
> ==4831== Address 0x150164a0 is 0 bytes inside a block of size 32 free'd
> ==4831== at 0x4C2DDBB: free (vg_replace_malloc.c:530)
> ==4831== by 0xAE4E85B: amdgpu_vamgr_free_va.part.0 (amdgpu_vamgr.c:165)
> ==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
> ==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
> ==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
> ==4831== by 0x9DD5067: pb_cache_release_all_buffers (pb_cache.c:241)
> ==4831== by 0x9DD5260: pb_cache_deinit (pb_cache.c:313)
> ==4831== by 0xA0FFD82: amdgpu_winsys_destroy (amdgpu_winsys.c:99)
> ==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
> ==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
> ==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
> ==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
> ==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
> ==4831== Block was alloc'd at
> ==4831== at 0x4C2EBA5: calloc (vg_replace_malloc.c:711)
> ==4831== by 0xAE4E795: amdgpu_vamgr_free_va.part.0 (amdgpu_vamgr.c:180)
> ==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
> ==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
> ==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
> ==4831== by 0xA12EADF: pb_destroy (pb_buffer.h:232)
> ==4831== by 0xA12EADF: pb_reference (pb_buffer.h:242)
> ==4831== by 0xA12EADF: r600_texture_destroy (r600_texture.c:825)
> ==4831== by 0x9D8490E: pipe_resource_reference (u_inlines.h:144)
> ==4831== by 0x9D8490E: dri2_destroy_image (dri_helpers.c:317)
> ==4831== by 0x538A94D: dri3_free_render_buffer.isra.3 (loader_dri3_helper.c:223)
> ==4831== by 0x538B347: loader_dri3_drawable_fini (loader_dri3_helper.c:238)
> ==4831== by 0x53861E4: dri3_destroy_drawable (dri3_glx.c:338)
> ==4831== by 0x537F739: driReleaseDrawables (dri_common.c:481)
> ==4831== by 0x53866C2: dri3_destroy_context (dri3_glx.c:166)
> ==4831== by 0x5358792: glXDestroyContext (glxcmds.c:471)
> ==4831==
> ==4831== Invalid read of size 8
> ==4831== at 0xAE4E98B: amdgpu_vamgr_deinit (amdgpu_vamgr.c:69)
> ==4831== by 0xAE4D883: amdgpu_device_free_internal (amdgpu_device.c:134)
> ==4831== by 0xAE4DD9B: amdgpu_device_reference (amdgpu_device.c:164)
> ==4831== by 0xAE4DD9B: amdgpu_device_deinitialize (amdgpu_device.c:307)
> ==4831== by 0xA0FFD9A: do_winsys_deinit (amdgpu_winsys.c:84)
> ==4831== by 0xA0FFD9A: amdgpu_winsys_destroy (amdgpu_winsys.c:101)
> ==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
> ==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
> ==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
> ==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
> ==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
> ==4831== by 0x535BCCE: FreeScreenConfigs.isra.3 (glxext.c:221)
> ==4831== by 0x535BD4E: glx_display_free (glxext.c:244)
> ==4831== by 0x535BE8D: __glXCloseDisplay (glxext.c:299)
> ==4831== Address 0x150164a8 is 8 bytes inside a block of size 32 free'd
> ==4831== at 0x4C2DDBB: free (vg_replace_malloc.c:530)
> ==4831== by 0xAE4E85B: amdgpu_vamgr_free_va.part.0 (amdgpu_vamgr.c:165)
> ==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
> ==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
> ==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
> ==4831== by 0x9DD5067: pb_cache_release_all_buffers (pb_cache.c:241)
> ==4831== by 0x9DD5260: pb_cache_deinit (pb_cache.c:313)
> ==4831== by 0xA0FFD82: amdgpu_winsys_destroy (amdgpu_winsys.c:99)
> ==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
> ==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
> ==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
> ==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
> ==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
> ==4831== Block was alloc'd at
> ==4831== at 0x4C2EBA5: calloc (vg_replace_malloc.c:711)
> ==4831== by 0xAE4E795: amdgpu_vamgr_free_va.part.0 (amdgpu_vamgr.c:180)
> ==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
> ==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
> ==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
> ==4831== by 0xA12EADF: pb_destroy (pb_buffer.h:232)
> ==4831== by 0xA12EADF: pb_reference (pb_buffer.h:242)
> ==4831== by 0xA12EADF: r600_texture_destroy (r600_texture.c:825)
> ==4831== by 0x9D8490E: pipe_resource_reference (u_inlines.h:144)
> ==4831== by 0x9D8490E: dri2_destroy_image (dri_helpers.c:317)
> ==4831== by 0x538A94D: dri3_free_render_buffer.isra.3 (loader_dri3_helper.c:223)
> ==4831== by 0x538B347: loader_dri3_drawable_fini (loader_dri3_helper.c:238)
> ==4831== by 0x53861E4: dri3_destroy_drawable (dri3_glx.c:338)
> ==4831== by 0x537F739: driReleaseDrawables (dri_common.c:481)
> ==4831== by 0x53866C2: dri3_destroy_context (dri3_glx.c:166)
> ==4831== by 0x5358792: glXDestroyContext (glxcmds.c:471)
> ==4831==
> ==4831== Invalid read of size 8
> ==4831== at 0xAE4E978: list_del (util_double_list.h:79)
> ==4831== by 0xAE4E978: amdgpu_vamgr_deinit (amdgpu_vamgr.c:70)
> ==4831== by 0xAE4D883: amdgpu_device_free_internal (amdgpu_device.c:134)
> ==4831== by 0xAE4DD9B: amdgpu_device_reference (amdgpu_device.c:164)
> ==4831== by 0xAE4DD9B: amdgpu_device_deinitialize (amdgpu_device.c:307)
> ==4831== by 0xA0FFD9A: do_winsys_deinit (amdgpu_winsys.c:84)
> ==4831== by 0xA0FFD9A: amdgpu_winsys_destroy (amdgpu_winsys.c:101)
> ==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
> ==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
> ==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
> ==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
> ==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
> ==4831== by 0x535BCCE: FreeScreenConfigs.isra.3 (glxext.c:221)
> ==4831== by 0x535BD4E: glx_display_free (glxext.c:244)
> ==4831== by 0x535BE8D: __glXCloseDisplay (glxext.c:299)
> ==4831== Address 0x150164a0 is 0 bytes inside a block of size 32 free'd
> ==4831== at 0x4C2DDBB: free (vg_replace_malloc.c:530)
> ==4831== by 0xAE4E85B: amdgpu_vamgr_free_va.part.0 (amdgpu_vamgr.c:165)
> ==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
> ==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
> ==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
> ==4831== by 0x9DD5067: pb_cache_release_all_buffers (pb_cache.c:241)
> ==4831== by 0x9DD5260: pb_cache_deinit (pb_cache.c:313)
> ==4831== by 0xA0FFD82: amdgpu_winsys_destroy (amdgpu_winsys.c:99)
> ==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
> ==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
> ==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
> ==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
> ==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
> ==4831== Block was alloc'd at
> ==4831== at 0x4C2EBA5: calloc (vg_replace_malloc.c:711)
> ==4831== by 0xAE4E795: amdgpu_vamgr_free_va.part.0 (amdgpu_vamgr.c:180)
> ==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
> ==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
> ==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
> ==4831== by 0xA12EADF: pb_destroy (pb_buffer.h:232)
> ==4831== by 0xA12EADF: pb_reference (pb_buffer.h:242)
> ==4831== by 0xA12EADF: r600_texture_destroy (r600_texture.c:825)
> ==4831== by 0x9D8490E: pipe_resource_reference (u_inlines.h:144)
> ==4831== by 0x9D8490E: dri2_destroy_image (dri_helpers.c:317)
> ==4831== by 0x538A94D: dri3_free_render_buffer.isra.3 (loader_dri3_helper.c:223)
> ==4831== by 0x538B347: loader_dri3_drawable_fini (loader_dri3_helper.c:238)
> ==4831== by 0x53861E4: dri3_destroy_drawable (dri3_glx.c:338)
> ==4831== by 0x537F739: driReleaseDrawables (dri_common.c:481)
> ==4831== by 0x53866C2: dri3_destroy_context (dri3_glx.c:166)
> ==4831== by 0x5358792: glXDestroyContext (glxcmds.c:471)
> ==4831==
> ==4831== Invalid read of size 8
> ==4831== at 0xAE4E97F: list_del (util_double_list.h:80)
> ==4831== by 0xAE4E97F: amdgpu_vamgr_deinit (amdgpu_vamgr.c:70)
> ==4831== by 0xAE4D883: amdgpu_device_free_internal (amdgpu_device.c:134)
> ==4831== by 0xAE4DD9B: amdgpu_device_reference (amdgpu_device.c:164)
> ==4831== by 0xAE4DD9B: amdgpu_device_deinitialize (amdgpu_device.c:307)
> ==4831== by 0xA0FFD9A: do_winsys_deinit (amdgpu_winsys.c:84)
> ==4831== by 0xA0FFD9A: amdgpu_winsys_destroy (amdgpu_winsys.c:101)
> ==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
> ==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
> ==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
> ==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
> ==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
> ==4831== by 0x535BCCE: FreeScreenConfigs.isra.3 (glxext.c:221)
> ==4831== by 0x535BD4E: glx_display_free (glxext.c:244)
> ==4831== by 0x535BE8D: __glXCloseDisplay (glxext.c:299)
> ==4831== Address 0x150164a8 is 8 bytes inside a block of size 32 free'd
> ==4831== at 0x4C2DDBB: free (vg_replace_malloc.c:530)
> ==4831== by 0xAE4E85B: amdgpu_vamgr_free_va.part.0 (amdgpu_vamgr.c:165)
> ==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
> ==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
> ==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
> ==4831== by 0x9DD5067: pb_cache_release_all_buffers (pb_cache.c:241)
> ==4831== by 0x9DD5260: pb_cache_deinit (pb_cache.c:313)
> ==4831== by 0xA0FFD82: amdgpu_winsys_destroy (amdgpu_winsys.c:99)
> ==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
> ==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
> ==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
> ==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
> ==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
> ==4831== Block was alloc'd at
> ==4831== at 0x4C2EBA5: calloc (vg_replace_malloc.c:711)
> ==4831== by 0xAE4E795: amdgpu_vamgr_free_va.part.0 (amdgpu_vamgr.c:180)
> ==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
> ==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
> ==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
> ==4831== by 0xA12EADF: pb_destroy (pb_buffer.h:232)
> ==4831== by 0xA12EADF: pb_reference (pb_buffer.h:242)
> ==4831== by 0xA12EADF: r600_texture_destroy (r600_texture.c:825)
> ==4831== by 0x9D8490E: pipe_resource_reference (u_inlines.h:144)
> ==4831== by 0x9D8490E: dri2_destroy_image (dri_helpers.c:317)
> ==4831== by 0x538A94D: dri3_free_render_buffer.isra.3 (loader_dri3_helper.c:223)
> ==4831== by 0x538B347: loader_dri3_drawable_fini (loader_dri3_helper.c:238)
> ==4831== by 0x53861E4: dri3_destroy_drawable (dri3_glx.c:338)
> ==4831== by 0x537F739: driReleaseDrawables (dri_common.c:481)
> ==4831== by 0x53866C2: dri3_destroy_context (dri3_glx.c:166)
> ==4831== by 0x5358792: glXDestroyContext (glxcmds.c:471)
> ==4831==
> ==4831== Invalid free() / delete / delete[] / realloc()
> ==4831== at 0x4C2DDBB: free (vg_replace_malloc.c:530)
> ==4831== by 0xAE4E98A: amdgpu_vamgr_deinit (amdgpu_vamgr.c:71)
> ==4831== by 0xAE4D883: amdgpu_device_free_internal (amdgpu_device.c:134)
> ==4831== by 0xAE4DD9B: amdgpu_device_reference (amdgpu_device.c:164)
> ==4831== by 0xAE4DD9B: amdgpu_device_deinitialize (amdgpu_device.c:307)
> ==4831== by 0xA0FFD9A: do_winsys_deinit (amdgpu_winsys.c:84)
> ==4831== by 0xA0FFD9A: amdgpu_winsys_destroy (amdgpu_winsys.c:101)
> ==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
> ==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
> ==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
> ==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
> ==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
> ==4831== by 0x535BCCE: FreeScreenConfigs.isra.3 (glxext.c:221)
> ==4831== by 0x535BD4E: glx_display_free (glxext.c:244)
> ==4831== Address 0x150164a0 is 0 bytes inside a block of size 32 free'd
> ==4831== at 0x4C2DDBB: free (vg_replace_malloc.c:530)
> ==4831== by 0xAE4E85B: amdgpu_vamgr_free_va.part.0 (amdgpu_vamgr.c:165)
> ==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
> ==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
> ==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
> ==4831== by 0x9DD5067: pb_cache_release_all_buffers (pb_cache.c:241)
> ==4831== by 0x9DD5260: pb_cache_deinit (pb_cache.c:313)
> ==4831== by 0xA0FFD82: amdgpu_winsys_destroy (amdgpu_winsys.c:99)
> ==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
> ==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
> ==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
> ==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
> ==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
> ==4831== Block was alloc'd at
> ==4831== at 0x4C2EBA5: calloc (vg_replace_malloc.c:711)
> ==4831== by 0xAE4E795: amdgpu_vamgr_free_va.part.0 (amdgpu_vamgr.c:180)
> ==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
> ==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
> ==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
> ==4831== by 0xA12EADF: pb_destroy (pb_buffer.h:232)
> ==4831== by 0xA12EADF: pb_reference (pb_buffer.h:242)
> ==4831== by 0xA12EADF: r600_texture_destroy (r600_texture.c:825)
> ==4831== by 0x9D8490E: pipe_resource_reference (u_inlines.h:144)
> ==4831== by 0x9D8490E: dri2_destroy_image (dri_helpers.c:317)
> ==4831== by 0x538A94D: dri3_free_render_buffer.isra.3 (loader_dri3_helper.c:223)
> ==4831== by 0x538B347: loader_dri3_drawable_fini (loader_dri3_helper.c:238)
> ==4831== by 0x53861E4: dri3_destroy_drawable (dri3_glx.c:338)
> ==4831== by 0x537F739: driReleaseDrawables (dri_common.c:481)
> ==4831== by 0x53866C2: dri3_destroy_context (dri3_glx.c:166)
> ==4831== by 0x5358792: glXDestroyContext (glxcmds.c:471)
> ==4831==
> ==4831==
> ==4831== HEAP SUMMARY:
> ==4831== in use at exit: 156,580 bytes in 1,724 blocks
> ==4831== total heap usage: 66,624 allocs, 64,901 frees, 32,392,118 bytes allocated
> ==4831==
> ==4831== LEAK SUMMARY:
> ==4831== definitely lost: 96 bytes in 3 blocks
> ==4831== indirectly lost: 0 bytes in 0 blocks
> ==4831== possibly lost: 0 bytes in 0 blocks
> ==4831== still reachable: 156,484 bytes in 1,721 blocks
> ==4831== suppressed: 0 bytes in 0 blocks
> ==4831== Rerun with --leak-check=full to see details of leaked memory
> ==4831==
> ==4831== For counts of detected and suppressed errors, rerun with: -v
> ==4831== ERROR SUMMARY: 19 errors from 10 contexts (suppressed: 0 from 0)
>
>
>
_______________________________________________
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 libdrm 2/2] libdrm: clean up non list code path for vamgr
[not found] ` <4a2036e5-820f-d62a-a773-2da1f575e1bc-5C7GfCeVMHo@public.gmane.org>
@ 2018-02-09 6:01 ` Chunming Zhou
[not found] ` <c6b30b81-8b6f-3b5a-5654-e8075939143e-5C7GfCeVMHo@public.gmane.org>
0 siblings, 1 reply; 12+ messages in thread
From: Chunming Zhou @ 2018-02-09 6:01 UTC (permalink / raw)
To: Michel Dänzer, Chunming Zhou
Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Hui.Deng-5C7GfCeVMHo
[-- Attachment #1: Type: text/plain, Size: 33689 bytes --]
On 2018年02月08日 17:13, Chunming Zhou wrote:
>
>
> On 2018年02月08日 17:01, Michel Dänzer wrote:
>> Hi David,
>>
>>
>> this change completely broke radeonsi due to memory management errors
>> (see valgrind output for glxgears below), so I had to revert it.
> ok, I will look into what happens. Sorry for broken.
The patch lost a "goto out" in free_va when applying patch from hybrid
to opensource.
The attached fixes that, I tested successfully in my local side.
please review or test, if no problem, I will submit it again.
Thanks,
David Zhou
>
> Regards,
> David Zhou
>>
>>
>> ==4831== Memcheck, a memory error detector
>> ==4831== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
>> ==4831== Using Valgrind-3.13.0 and LibVEX; rerun with -h for
>> copyright info
>> ==4831== Command: glxgears
>> ==4831==
>> ==4831== Invalid read of size 8
>> ==4831== at 0xAE4E79B: list_add (util_double_list.h:56)
>> ==4831== by 0xAE4E79B: amdgpu_vamgr_free_va.part.0
>> (amdgpu_vamgr.c:184)
>> ==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
>> ==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
>> ==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
>> ==4831== by 0x9DD5067: pb_cache_release_all_buffers (pb_cache.c:241)
>> ==4831== by 0x9DD5260: pb_cache_deinit (pb_cache.c:313)
>> ==4831== by 0xA0FFD82: amdgpu_winsys_destroy (amdgpu_winsys.c:99)
>> ==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
>> ==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
>> ==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
>> ==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
>> ==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
>> ==4831== by 0x535BCCE: FreeScreenConfigs.isra.3 (glxext.c:221)
>> ==4831== Address 0x151eccb8 is 8 bytes inside a block of size 32 free'd
>> ==4831== at 0x4C2DDBB: free (vg_replace_malloc.c:530)
>> ==4831== by 0xAE4E85B: amdgpu_vamgr_free_va.part.0
>> (amdgpu_vamgr.c:165)
>> ==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
>> ==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
>> ==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
>> ==4831== by 0x9DD5067: pb_cache_release_all_buffers (pb_cache.c:241)
>> ==4831== by 0x9DD5260: pb_cache_deinit (pb_cache.c:313)
>> ==4831== by 0xA0FFD82: amdgpu_winsys_destroy (amdgpu_winsys.c:99)
>> ==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
>> ==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
>> ==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
>> ==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
>> ==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
>> ==4831== Block was alloc'd at
>> ==4831== at 0x4C2EBA5: calloc (vg_replace_malloc.c:711)
>> ==4831== by 0xAE4E795: amdgpu_vamgr_free_va.part.0
>> (amdgpu_vamgr.c:180)
>> ==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
>> ==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
>> ==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
>> ==4831== by 0x9DD5067: pb_cache_release_all_buffers (pb_cache.c:241)
>> ==4831== by 0x9DD5260: pb_cache_deinit (pb_cache.c:313)
>> ==4831== by 0xA0FFD82: amdgpu_winsys_destroy (amdgpu_winsys.c:99)
>> ==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
>> ==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
>> ==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
>> ==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
>> ==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
>> ==4831==
>> ==4831== Invalid read of size 8
>> ==4831== at 0xAE4E7B0: list_add (util_double_list.h:57)
>> ==4831== by 0xAE4E7B0: amdgpu_vamgr_free_va.part.0
>> (amdgpu_vamgr.c:184)
>> ==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
>> ==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
>> ==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
>> ==4831== by 0x9DD5067: pb_cache_release_all_buffers (pb_cache.c:241)
>> ==4831== by 0x9DD5260: pb_cache_deinit (pb_cache.c:313)
>> ==4831== by 0xA0FFD82: amdgpu_winsys_destroy (amdgpu_winsys.c:99)
>> ==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
>> ==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
>> ==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
>> ==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
>> ==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
>> ==4831== by 0x535BCCE: FreeScreenConfigs.isra.3 (glxext.c:221)
>> ==4831== Address 0x151eccb8 is 8 bytes inside a block of size 32 free'd
>> ==4831== at 0x4C2DDBB: free (vg_replace_malloc.c:530)
>> ==4831== by 0xAE4E85B: amdgpu_vamgr_free_va.part.0
>> (amdgpu_vamgr.c:165)
>> ==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
>> ==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
>> ==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
>> ==4831== by 0x9DD5067: pb_cache_release_all_buffers (pb_cache.c:241)
>> ==4831== by 0x9DD5260: pb_cache_deinit (pb_cache.c:313)
>> ==4831== by 0xA0FFD82: amdgpu_winsys_destroy (amdgpu_winsys.c:99)
>> ==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
>> ==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
>> ==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
>> ==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
>> ==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
>> ==4831== Block was alloc'd at
>> ==4831== at 0x4C2EBA5: calloc (vg_replace_malloc.c:711)
>> ==4831== by 0xAE4E795: amdgpu_vamgr_free_va.part.0
>> (amdgpu_vamgr.c:180)
>> ==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
>> ==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
>> ==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
>> ==4831== by 0x9DD5067: pb_cache_release_all_buffers (pb_cache.c:241)
>> ==4831== by 0x9DD5260: pb_cache_deinit (pb_cache.c:313)
>> ==4831== by 0xA0FFD82: amdgpu_winsys_destroy (amdgpu_winsys.c:99)
>> ==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
>> ==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
>> ==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
>> ==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
>> ==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
>> ==4831==
>> ==4831== Invalid write of size 8
>> ==4831== at 0xAE4E7BB: list_add (util_double_list.h:58)
>> ==4831== by 0xAE4E7BB: amdgpu_vamgr_free_va.part.0
>> (amdgpu_vamgr.c:184)
>> ==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
>> ==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
>> ==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
>> ==4831== by 0x9DD5067: pb_cache_release_all_buffers (pb_cache.c:241)
>> ==4831== by 0x9DD5260: pb_cache_deinit (pb_cache.c:313)
>> ==4831== by 0xA0FFD82: amdgpu_winsys_destroy (amdgpu_winsys.c:99)
>> ==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
>> ==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
>> ==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
>> ==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
>> ==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
>> ==4831== by 0x535BCCE: FreeScreenConfigs.isra.3 (glxext.c:221)
>> ==4831== Address 0x151eccb8 is 8 bytes inside a block of size 32 free'd
>> ==4831== at 0x4C2DDBB: free (vg_replace_malloc.c:530)
>> ==4831== by 0xAE4E85B: amdgpu_vamgr_free_va.part.0
>> (amdgpu_vamgr.c:165)
>> ==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
>> ==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
>> ==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
>> ==4831== by 0x9DD5067: pb_cache_release_all_buffers (pb_cache.c:241)
>> ==4831== by 0x9DD5260: pb_cache_deinit (pb_cache.c:313)
>> ==4831== by 0xA0FFD82: amdgpu_winsys_destroy (amdgpu_winsys.c:99)
>> ==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
>> ==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
>> ==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
>> ==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
>> ==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
>> ==4831== Block was alloc'd at
>> ==4831== at 0x4C2EBA5: calloc (vg_replace_malloc.c:711)
>> ==4831== by 0xAE4E795: amdgpu_vamgr_free_va.part.0
>> (amdgpu_vamgr.c:180)
>> ==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
>> ==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
>> ==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
>> ==4831== by 0x9DD5067: pb_cache_release_all_buffers (pb_cache.c:241)
>> ==4831== by 0x9DD5260: pb_cache_deinit (pb_cache.c:313)
>> ==4831== by 0xA0FFD82: amdgpu_winsys_destroy (amdgpu_winsys.c:99)
>> ==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
>> ==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
>> ==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
>> ==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
>> ==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
>> ==4831==
>> ==4831== Invalid read of size 8
>> ==4831== at 0xAE4E730: amdgpu_vamgr_free_va.part.0
>> (amdgpu_vamgr.c:149)
>> ==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
>> ==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
>> ==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
>> ==4831== by 0x9DD5067: pb_cache_release_all_buffers (pb_cache.c:241)
>> ==4831== by 0x9DD5260: pb_cache_deinit (pb_cache.c:313)
>> ==4831== by 0xA0FFD82: amdgpu_winsys_destroy (amdgpu_winsys.c:99)
>> ==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
>> ==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
>> ==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
>> ==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
>> ==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
>> ==4831== by 0x535BCCE: FreeScreenConfigs.isra.3 (glxext.c:221)
>> ==4831== Address 0x150164b0 is 16 bytes inside a block of size 32
>> free'd
>> ==4831== at 0x4C2DDBB: free (vg_replace_malloc.c:530)
>> ==4831== by 0xAE4E85B: amdgpu_vamgr_free_va.part.0
>> (amdgpu_vamgr.c:165)
>> ==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
>> ==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
>> ==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
>> ==4831== by 0x9DD5067: pb_cache_release_all_buffers (pb_cache.c:241)
>> ==4831== by 0x9DD5260: pb_cache_deinit (pb_cache.c:313)
>> ==4831== by 0xA0FFD82: amdgpu_winsys_destroy (amdgpu_winsys.c:99)
>> ==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
>> ==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
>> ==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
>> ==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
>> ==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
>> ==4831== Block was alloc'd at
>> ==4831== at 0x4C2EBA5: calloc (vg_replace_malloc.c:711)
>> ==4831== by 0xAE4E795: amdgpu_vamgr_free_va.part.0
>> (amdgpu_vamgr.c:180)
>> ==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
>> ==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
>> ==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
>> ==4831== by 0xA12EADF: pb_destroy (pb_buffer.h:232)
>> ==4831== by 0xA12EADF: pb_reference (pb_buffer.h:242)
>> ==4831== by 0xA12EADF: r600_texture_destroy (r600_texture.c:825)
>> ==4831== by 0x9D8490E: pipe_resource_reference (u_inlines.h:144)
>> ==4831== by 0x9D8490E: dri2_destroy_image (dri_helpers.c:317)
>> ==4831== by 0x538A94D: dri3_free_render_buffer.isra.3
>> (loader_dri3_helper.c:223)
>> ==4831== by 0x538B347: loader_dri3_drawable_fini
>> (loader_dri3_helper.c:238)
>> ==4831== by 0x53861E4: dri3_destroy_drawable (dri3_glx.c:338)
>> ==4831== by 0x537F739: driReleaseDrawables (dri_common.c:481)
>> ==4831== by 0x53866C2: dri3_destroy_context (dri3_glx.c:166)
>> ==4831== by 0x5358792: glXDestroyContext (glxcmds.c:471)
>> ==4831==
>> ==4831== Invalid read of size 8
>> ==4831== at 0xAE4E73D: amdgpu_vamgr_free_va.part.0
>> (amdgpu_vamgr.c:148)
>> ==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
>> ==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
>> ==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
>> ==4831== by 0x9DD5067: pb_cache_release_all_buffers (pb_cache.c:241)
>> ==4831== by 0x9DD5260: pb_cache_deinit (pb_cache.c:313)
>> ==4831== by 0xA0FFD82: amdgpu_winsys_destroy (amdgpu_winsys.c:99)
>> ==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
>> ==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
>> ==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
>> ==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
>> ==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
>> ==4831== by 0x535BCCE: FreeScreenConfigs.isra.3 (glxext.c:221)
>> ==4831== Address 0x150164a8 is 8 bytes inside a block of size 32 free'd
>> ==4831== at 0x4C2DDBB: free (vg_replace_malloc.c:530)
>> ==4831== by 0xAE4E85B: amdgpu_vamgr_free_va.part.0
>> (amdgpu_vamgr.c:165)
>> ==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
>> ==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
>> ==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
>> ==4831== by 0x9DD5067: pb_cache_release_all_buffers (pb_cache.c:241)
>> ==4831== by 0x9DD5260: pb_cache_deinit (pb_cache.c:313)
>> ==4831== by 0xA0FFD82: amdgpu_winsys_destroy (amdgpu_winsys.c:99)
>> ==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
>> ==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
>> ==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
>> ==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
>> ==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
>> ==4831== Block was alloc'd at
>> ==4831== at 0x4C2EBA5: calloc (vg_replace_malloc.c:711)
>> ==4831== by 0xAE4E795: amdgpu_vamgr_free_va.part.0
>> (amdgpu_vamgr.c:180)
>> ==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
>> ==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
>> ==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
>> ==4831== by 0xA12EADF: pb_destroy (pb_buffer.h:232)
>> ==4831== by 0xA12EADF: pb_reference (pb_buffer.h:242)
>> ==4831== by 0xA12EADF: r600_texture_destroy (r600_texture.c:825)
>> ==4831== by 0x9D8490E: pipe_resource_reference (u_inlines.h:144)
>> ==4831== by 0x9D8490E: dri2_destroy_image (dri_helpers.c:317)
>> ==4831== by 0x538A94D: dri3_free_render_buffer.isra.3
>> (loader_dri3_helper.c:223)
>> ==4831== by 0x538B347: loader_dri3_drawable_fini
>> (loader_dri3_helper.c:238)
>> ==4831== by 0x53861E4: dri3_destroy_drawable (dri3_glx.c:338)
>> ==4831== by 0x537F739: driReleaseDrawables (dri_common.c:481)
>> ==4831== by 0x53866C2: dri3_destroy_context (dri3_glx.c:166)
>> ==4831== by 0x5358792: glXDestroyContext (glxcmds.c:471)
>> ==4831==
>> ==4831== Invalid write of size 8
>> ==4831== at 0xAE4E983: list_del (util_double_list.h:80)
>> ==4831== by 0xAE4E983: amdgpu_vamgr_deinit (amdgpu_vamgr.c:70)
>> ==4831== by 0xAE4D883: amdgpu_device_free_internal
>> (amdgpu_device.c:134)
>> ==4831== by 0xAE4DD9B: amdgpu_device_reference (amdgpu_device.c:164)
>> ==4831== by 0xAE4DD9B: amdgpu_device_deinitialize
>> (amdgpu_device.c:307)
>> ==4831== by 0xA0FFD9A: do_winsys_deinit (amdgpu_winsys.c:84)
>> ==4831== by 0xA0FFD9A: amdgpu_winsys_destroy (amdgpu_winsys.c:101)
>> ==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
>> ==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
>> ==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
>> ==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
>> ==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
>> ==4831== by 0x535BCCE: FreeScreenConfigs.isra.3 (glxext.c:221)
>> ==4831== by 0x535BD4E: glx_display_free (glxext.c:244)
>> ==4831== by 0x535BE8D: __glXCloseDisplay (glxext.c:299)
>> ==4831== Address 0x150164a0 is 0 bytes inside a block of size 32 free'd
>> ==4831== at 0x4C2DDBB: free (vg_replace_malloc.c:530)
>> ==4831== by 0xAE4E85B: amdgpu_vamgr_free_va.part.0
>> (amdgpu_vamgr.c:165)
>> ==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
>> ==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
>> ==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
>> ==4831== by 0x9DD5067: pb_cache_release_all_buffers (pb_cache.c:241)
>> ==4831== by 0x9DD5260: pb_cache_deinit (pb_cache.c:313)
>> ==4831== by 0xA0FFD82: amdgpu_winsys_destroy (amdgpu_winsys.c:99)
>> ==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
>> ==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
>> ==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
>> ==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
>> ==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
>> ==4831== Block was alloc'd at
>> ==4831== at 0x4C2EBA5: calloc (vg_replace_malloc.c:711)
>> ==4831== by 0xAE4E795: amdgpu_vamgr_free_va.part.0
>> (amdgpu_vamgr.c:180)
>> ==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
>> ==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
>> ==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
>> ==4831== by 0xA12EADF: pb_destroy (pb_buffer.h:232)
>> ==4831== by 0xA12EADF: pb_reference (pb_buffer.h:242)
>> ==4831== by 0xA12EADF: r600_texture_destroy (r600_texture.c:825)
>> ==4831== by 0x9D8490E: pipe_resource_reference (u_inlines.h:144)
>> ==4831== by 0x9D8490E: dri2_destroy_image (dri_helpers.c:317)
>> ==4831== by 0x538A94D: dri3_free_render_buffer.isra.3
>> (loader_dri3_helper.c:223)
>> ==4831== by 0x538B347: loader_dri3_drawable_fini
>> (loader_dri3_helper.c:238)
>> ==4831== by 0x53861E4: dri3_destroy_drawable (dri3_glx.c:338)
>> ==4831== by 0x537F739: driReleaseDrawables (dri_common.c:481)
>> ==4831== by 0x53866C2: dri3_destroy_context (dri3_glx.c:166)
>> ==4831== by 0x5358792: glXDestroyContext (glxcmds.c:471)
>> ==4831==
>> ==4831== Invalid read of size 8
>> ==4831== at 0xAE4E98B: amdgpu_vamgr_deinit (amdgpu_vamgr.c:69)
>> ==4831== by 0xAE4D883: amdgpu_device_free_internal
>> (amdgpu_device.c:134)
>> ==4831== by 0xAE4DD9B: amdgpu_device_reference (amdgpu_device.c:164)
>> ==4831== by 0xAE4DD9B: amdgpu_device_deinitialize
>> (amdgpu_device.c:307)
>> ==4831== by 0xA0FFD9A: do_winsys_deinit (amdgpu_winsys.c:84)
>> ==4831== by 0xA0FFD9A: amdgpu_winsys_destroy (amdgpu_winsys.c:101)
>> ==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
>> ==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
>> ==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
>> ==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
>> ==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
>> ==4831== by 0x535BCCE: FreeScreenConfigs.isra.3 (glxext.c:221)
>> ==4831== by 0x535BD4E: glx_display_free (glxext.c:244)
>> ==4831== by 0x535BE8D: __glXCloseDisplay (glxext.c:299)
>> ==4831== Address 0x150164a8 is 8 bytes inside a block of size 32 free'd
>> ==4831== at 0x4C2DDBB: free (vg_replace_malloc.c:530)
>> ==4831== by 0xAE4E85B: amdgpu_vamgr_free_va.part.0
>> (amdgpu_vamgr.c:165)
>> ==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
>> ==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
>> ==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
>> ==4831== by 0x9DD5067: pb_cache_release_all_buffers (pb_cache.c:241)
>> ==4831== by 0x9DD5260: pb_cache_deinit (pb_cache.c:313)
>> ==4831== by 0xA0FFD82: amdgpu_winsys_destroy (amdgpu_winsys.c:99)
>> ==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
>> ==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
>> ==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
>> ==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
>> ==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
>> ==4831== Block was alloc'd at
>> ==4831== at 0x4C2EBA5: calloc (vg_replace_malloc.c:711)
>> ==4831== by 0xAE4E795: amdgpu_vamgr_free_va.part.0
>> (amdgpu_vamgr.c:180)
>> ==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
>> ==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
>> ==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
>> ==4831== by 0xA12EADF: pb_destroy (pb_buffer.h:232)
>> ==4831== by 0xA12EADF: pb_reference (pb_buffer.h:242)
>> ==4831== by 0xA12EADF: r600_texture_destroy (r600_texture.c:825)
>> ==4831== by 0x9D8490E: pipe_resource_reference (u_inlines.h:144)
>> ==4831== by 0x9D8490E: dri2_destroy_image (dri_helpers.c:317)
>> ==4831== by 0x538A94D: dri3_free_render_buffer.isra.3
>> (loader_dri3_helper.c:223)
>> ==4831== by 0x538B347: loader_dri3_drawable_fini
>> (loader_dri3_helper.c:238)
>> ==4831== by 0x53861E4: dri3_destroy_drawable (dri3_glx.c:338)
>> ==4831== by 0x537F739: driReleaseDrawables (dri_common.c:481)
>> ==4831== by 0x53866C2: dri3_destroy_context (dri3_glx.c:166)
>> ==4831== by 0x5358792: glXDestroyContext (glxcmds.c:471)
>> ==4831==
>> ==4831== Invalid read of size 8
>> ==4831== at 0xAE4E978: list_del (util_double_list.h:79)
>> ==4831== by 0xAE4E978: amdgpu_vamgr_deinit (amdgpu_vamgr.c:70)
>> ==4831== by 0xAE4D883: amdgpu_device_free_internal
>> (amdgpu_device.c:134)
>> ==4831== by 0xAE4DD9B: amdgpu_device_reference (amdgpu_device.c:164)
>> ==4831== by 0xAE4DD9B: amdgpu_device_deinitialize
>> (amdgpu_device.c:307)
>> ==4831== by 0xA0FFD9A: do_winsys_deinit (amdgpu_winsys.c:84)
>> ==4831== by 0xA0FFD9A: amdgpu_winsys_destroy (amdgpu_winsys.c:101)
>> ==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
>> ==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
>> ==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
>> ==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
>> ==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
>> ==4831== by 0x535BCCE: FreeScreenConfigs.isra.3 (glxext.c:221)
>> ==4831== by 0x535BD4E: glx_display_free (glxext.c:244)
>> ==4831== by 0x535BE8D: __glXCloseDisplay (glxext.c:299)
>> ==4831== Address 0x150164a0 is 0 bytes inside a block of size 32 free'd
>> ==4831== at 0x4C2DDBB: free (vg_replace_malloc.c:530)
>> ==4831== by 0xAE4E85B: amdgpu_vamgr_free_va.part.0
>> (amdgpu_vamgr.c:165)
>> ==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
>> ==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
>> ==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
>> ==4831== by 0x9DD5067: pb_cache_release_all_buffers (pb_cache.c:241)
>> ==4831== by 0x9DD5260: pb_cache_deinit (pb_cache.c:313)
>> ==4831== by 0xA0FFD82: amdgpu_winsys_destroy (amdgpu_winsys.c:99)
>> ==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
>> ==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
>> ==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
>> ==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
>> ==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
>> ==4831== Block was alloc'd at
>> ==4831== at 0x4C2EBA5: calloc (vg_replace_malloc.c:711)
>> ==4831== by 0xAE4E795: amdgpu_vamgr_free_va.part.0
>> (amdgpu_vamgr.c:180)
>> ==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
>> ==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
>> ==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
>> ==4831== by 0xA12EADF: pb_destroy (pb_buffer.h:232)
>> ==4831== by 0xA12EADF: pb_reference (pb_buffer.h:242)
>> ==4831== by 0xA12EADF: r600_texture_destroy (r600_texture.c:825)
>> ==4831== by 0x9D8490E: pipe_resource_reference (u_inlines.h:144)
>> ==4831== by 0x9D8490E: dri2_destroy_image (dri_helpers.c:317)
>> ==4831== by 0x538A94D: dri3_free_render_buffer.isra.3
>> (loader_dri3_helper.c:223)
>> ==4831== by 0x538B347: loader_dri3_drawable_fini
>> (loader_dri3_helper.c:238)
>> ==4831== by 0x53861E4: dri3_destroy_drawable (dri3_glx.c:338)
>> ==4831== by 0x537F739: driReleaseDrawables (dri_common.c:481)
>> ==4831== by 0x53866C2: dri3_destroy_context (dri3_glx.c:166)
>> ==4831== by 0x5358792: glXDestroyContext (glxcmds.c:471)
>> ==4831==
>> ==4831== Invalid read of size 8
>> ==4831== at 0xAE4E97F: list_del (util_double_list.h:80)
>> ==4831== by 0xAE4E97F: amdgpu_vamgr_deinit (amdgpu_vamgr.c:70)
>> ==4831== by 0xAE4D883: amdgpu_device_free_internal
>> (amdgpu_device.c:134)
>> ==4831== by 0xAE4DD9B: amdgpu_device_reference (amdgpu_device.c:164)
>> ==4831== by 0xAE4DD9B: amdgpu_device_deinitialize
>> (amdgpu_device.c:307)
>> ==4831== by 0xA0FFD9A: do_winsys_deinit (amdgpu_winsys.c:84)
>> ==4831== by 0xA0FFD9A: amdgpu_winsys_destroy (amdgpu_winsys.c:101)
>> ==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
>> ==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
>> ==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
>> ==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
>> ==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
>> ==4831== by 0x535BCCE: FreeScreenConfigs.isra.3 (glxext.c:221)
>> ==4831== by 0x535BD4E: glx_display_free (glxext.c:244)
>> ==4831== by 0x535BE8D: __glXCloseDisplay (glxext.c:299)
>> ==4831== Address 0x150164a8 is 8 bytes inside a block of size 32 free'd
>> ==4831== at 0x4C2DDBB: free (vg_replace_malloc.c:530)
>> ==4831== by 0xAE4E85B: amdgpu_vamgr_free_va.part.0
>> (amdgpu_vamgr.c:165)
>> ==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
>> ==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
>> ==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
>> ==4831== by 0x9DD5067: pb_cache_release_all_buffers (pb_cache.c:241)
>> ==4831== by 0x9DD5260: pb_cache_deinit (pb_cache.c:313)
>> ==4831== by 0xA0FFD82: amdgpu_winsys_destroy (amdgpu_winsys.c:99)
>> ==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
>> ==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
>> ==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
>> ==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
>> ==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
>> ==4831== Block was alloc'd at
>> ==4831== at 0x4C2EBA5: calloc (vg_replace_malloc.c:711)
>> ==4831== by 0xAE4E795: amdgpu_vamgr_free_va.part.0
>> (amdgpu_vamgr.c:180)
>> ==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
>> ==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
>> ==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
>> ==4831== by 0xA12EADF: pb_destroy (pb_buffer.h:232)
>> ==4831== by 0xA12EADF: pb_reference (pb_buffer.h:242)
>> ==4831== by 0xA12EADF: r600_texture_destroy (r600_texture.c:825)
>> ==4831== by 0x9D8490E: pipe_resource_reference (u_inlines.h:144)
>> ==4831== by 0x9D8490E: dri2_destroy_image (dri_helpers.c:317)
>> ==4831== by 0x538A94D: dri3_free_render_buffer.isra.3
>> (loader_dri3_helper.c:223)
>> ==4831== by 0x538B347: loader_dri3_drawable_fini
>> (loader_dri3_helper.c:238)
>> ==4831== by 0x53861E4: dri3_destroy_drawable (dri3_glx.c:338)
>> ==4831== by 0x537F739: driReleaseDrawables (dri_common.c:481)
>> ==4831== by 0x53866C2: dri3_destroy_context (dri3_glx.c:166)
>> ==4831== by 0x5358792: glXDestroyContext (glxcmds.c:471)
>> ==4831==
>> ==4831== Invalid free() / delete / delete[] / realloc()
>> ==4831== at 0x4C2DDBB: free (vg_replace_malloc.c:530)
>> ==4831== by 0xAE4E98A: amdgpu_vamgr_deinit (amdgpu_vamgr.c:71)
>> ==4831== by 0xAE4D883: amdgpu_device_free_internal
>> (amdgpu_device.c:134)
>> ==4831== by 0xAE4DD9B: amdgpu_device_reference (amdgpu_device.c:164)
>> ==4831== by 0xAE4DD9B: amdgpu_device_deinitialize
>> (amdgpu_device.c:307)
>> ==4831== by 0xA0FFD9A: do_winsys_deinit (amdgpu_winsys.c:84)
>> ==4831== by 0xA0FFD9A: amdgpu_winsys_destroy (amdgpu_winsys.c:101)
>> ==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
>> ==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
>> ==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
>> ==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
>> ==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
>> ==4831== by 0x535BCCE: FreeScreenConfigs.isra.3 (glxext.c:221)
>> ==4831== by 0x535BD4E: glx_display_free (glxext.c:244)
>> ==4831== Address 0x150164a0 is 0 bytes inside a block of size 32 free'd
>> ==4831== at 0x4C2DDBB: free (vg_replace_malloc.c:530)
>> ==4831== by 0xAE4E85B: amdgpu_vamgr_free_va.part.0
>> (amdgpu_vamgr.c:165)
>> ==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
>> ==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
>> ==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
>> ==4831== by 0x9DD5067: pb_cache_release_all_buffers (pb_cache.c:241)
>> ==4831== by 0x9DD5260: pb_cache_deinit (pb_cache.c:313)
>> ==4831== by 0xA0FFD82: amdgpu_winsys_destroy (amdgpu_winsys.c:99)
>> ==4831== by 0xA051D76: si_destroy_screen (si_pipe.c:515)
>> ==4831== by 0x9D85448: dri_destroy_screen_helper (dri_screen.c:454)
>> ==4831== by 0x9D85475: dri_destroy_screen (dri_screen.c:464)
>> ==4831== by 0x9D82076: driDestroyScreen (dri_util.c:231)
>> ==4831== by 0x5386222: dri3_destroy_screen (dri3_glx.c:584)
>> ==4831== Block was alloc'd at
>> ==4831== at 0x4C2EBA5: calloc (vg_replace_malloc.c:711)
>> ==4831== by 0xAE4E795: amdgpu_vamgr_free_va.part.0
>> (amdgpu_vamgr.c:180)
>> ==4831== by 0xAE4EB2C: amdgpu_vamgr_free_va (amdgpu_vamgr.c:141)
>> ==4831== by 0xAE4EB2C: amdgpu_va_range_free (amdgpu_vamgr.c:246)
>> ==4831== by 0xA0FA53E: amdgpu_bo_destroy (amdgpu_bo.c:178)
>> ==4831== by 0xA12EADF: pb_destroy (pb_buffer.h:232)
>> ==4831== by 0xA12EADF: pb_reference (pb_buffer.h:242)
>> ==4831== by 0xA12EADF: r600_texture_destroy (r600_texture.c:825)
>> ==4831== by 0x9D8490E: pipe_resource_reference (u_inlines.h:144)
>> ==4831== by 0x9D8490E: dri2_destroy_image (dri_helpers.c:317)
>> ==4831== by 0x538A94D: dri3_free_render_buffer.isra.3
>> (loader_dri3_helper.c:223)
>> ==4831== by 0x538B347: loader_dri3_drawable_fini
>> (loader_dri3_helper.c:238)
>> ==4831== by 0x53861E4: dri3_destroy_drawable (dri3_glx.c:338)
>> ==4831== by 0x537F739: driReleaseDrawables (dri_common.c:481)
>> ==4831== by 0x53866C2: dri3_destroy_context (dri3_glx.c:166)
>> ==4831== by 0x5358792: glXDestroyContext (glxcmds.c:471)
>> ==4831==
>> ==4831==
>> ==4831== HEAP SUMMARY:
>> ==4831== in use at exit: 156,580 bytes in 1,724 blocks
>> ==4831== total heap usage: 66,624 allocs, 64,901 frees, 32,392,118
>> bytes allocated
>> ==4831==
>> ==4831== LEAK SUMMARY:
>> ==4831== definitely lost: 96 bytes in 3 blocks
>> ==4831== indirectly lost: 0 bytes in 0 blocks
>> ==4831== possibly lost: 0 bytes in 0 blocks
>> ==4831== still reachable: 156,484 bytes in 1,721 blocks
>> ==4831== suppressed: 0 bytes in 0 blocks
>> ==4831== Rerun with --leak-check=full to see details of leaked memory
>> ==4831==
>> ==4831== For counts of detected and suppressed errors, rerun with: -v
>> ==4831== ERROR SUMMARY: 19 errors from 10 contexts (suppressed: 0
>> from 0)
>>
>>
>>
>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-amdgpu-clean-up-non-list-code-path-for-vamgr.patch --]
[-- Type: text/x-patch; name="0001-amdgpu-clean-up-non-list-code-path-for-vamgr.patch", Size: 5639 bytes --]
>From 27a2e5af2c7fa4a050288d5f926adad9511afde3 Mon Sep 17 00:00:00 2001
From: Chunming Zhou <david1.zhou-5C7GfCeVMHo@public.gmane.org>
Date: Thu, 8 Feb 2018 14:52:11 +0800
Subject: [PATCH libdrm] amdgpu: clean up non list code path for vamgr
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Chunming Zhou <david1.zhou-5C7GfCeVMHo@public.gmane.org>
Reviewed-by: Christian König <christian.koenig-5C7GfCeVMHo@public.gmane.org>
---
amdgpu/amdgpu_internal.h | 2 -
amdgpu/amdgpu_vamgr.c | 122 +++++++++++++++++------------------------------
2 files changed, 44 insertions(+), 80 deletions(-)
diff --git a/amdgpu/amdgpu_internal.h b/amdgpu/amdgpu_internal.h
index 3e044f1..75276a9 100644
--- a/amdgpu/amdgpu_internal.h
+++ b/amdgpu/amdgpu_internal.h
@@ -53,8 +53,6 @@ struct amdgpu_bo_va_hole {
};
struct amdgpu_bo_va_mgr {
- /* the start virtual address */
- uint64_t va_offset;
uint64_t va_max;
struct list_head va_holes;
pthread_mutex_t bo_va_mutex;
diff --git a/amdgpu/amdgpu_vamgr.c b/amdgpu/amdgpu_vamgr.c
index a2852b5..722067f 100644
--- a/amdgpu/amdgpu_vamgr.c
+++ b/amdgpu/amdgpu_vamgr.c
@@ -48,12 +48,19 @@ int amdgpu_va_range_query(amdgpu_device_handle dev,
drm_private void amdgpu_vamgr_init(struct amdgpu_bo_va_mgr *mgr, uint64_t start,
uint64_t max, uint64_t alignment)
{
- mgr->va_offset = start;
+ struct amdgpu_bo_va_hole *n;
+
mgr->va_max = max;
mgr->va_alignment = alignment;
list_inithead(&mgr->va_holes);
pthread_mutex_init(&mgr->bo_va_mutex, NULL);
+ pthread_mutex_lock(&mgr->bo_va_mutex);
+ n = calloc(1, sizeof(struct amdgpu_bo_va_hole));
+ n->size = mgr->va_max;
+ n->offset = start;
+ list_add(&n->list, &mgr->va_holes);
+ pthread_mutex_unlock(&mgr->bo_va_mutex);
}
drm_private void amdgpu_vamgr_deinit(struct amdgpu_bo_va_mgr *mgr)
@@ -122,41 +129,14 @@ amdgpu_vamgr_find_va(struct amdgpu_bo_va_mgr *mgr, uint64_t size,
}
}
- if (base_required) {
- if (base_required < mgr->va_offset) {
- pthread_mutex_unlock(&mgr->bo_va_mutex);
- return AMDGPU_INVALID_VA_ADDRESS;
- }
- offset = mgr->va_offset;
- waste = base_required - mgr->va_offset;
- } else {
- offset = mgr->va_offset;
- waste = offset % alignment;
- waste = waste ? alignment - waste : 0;
- }
-
- if (offset + waste + size > mgr->va_max) {
- pthread_mutex_unlock(&mgr->bo_va_mutex);
- return AMDGPU_INVALID_VA_ADDRESS;
- }
-
- if (waste) {
- n = calloc(1, sizeof(struct amdgpu_bo_va_hole));
- n->size = waste;
- n->offset = offset;
- list_add(&n->list, &mgr->va_holes);
- }
-
- offset += waste;
- mgr->va_offset += size + waste;
pthread_mutex_unlock(&mgr->bo_va_mutex);
- return offset;
+ return AMDGPU_INVALID_VA_ADDRESS;
}
static drm_private void
amdgpu_vamgr_free_va(struct amdgpu_bo_va_mgr *mgr, uint64_t va, uint64_t size)
{
- struct amdgpu_bo_va_hole *hole;
+ struct amdgpu_bo_va_hole *hole, *next;
if (va == AMDGPU_INVALID_VA_ADDRESS)
return;
@@ -164,61 +144,47 @@ amdgpu_vamgr_free_va(struct amdgpu_bo_va_mgr *mgr, uint64_t va, uint64_t size)
size = ALIGN(size, mgr->va_alignment);
pthread_mutex_lock(&mgr->bo_va_mutex);
- if ((va + size) == mgr->va_offset) {
- mgr->va_offset = va;
- /* Delete uppermost hole if it reaches the new top */
- if (!LIST_IS_EMPTY(&mgr->va_holes)) {
- hole = container_of(mgr->va_holes.next, hole, list);
- if ((hole->offset + hole->size) == va) {
- mgr->va_offset = hole->offset;
+ hole = container_of(&mgr->va_holes, hole, list);
+ LIST_FOR_EACH_ENTRY(next, &mgr->va_holes, list) {
+ if (next->offset < va)
+ break;
+ hole = next;
+ }
+
+ if (&hole->list != &mgr->va_holes) {
+ /* Grow upper hole if it's adjacent */
+ if (hole->offset == (va + size)) {
+ hole->offset = va;
+ hole->size += size;
+ /* Merge lower hole if it's adjacent */
+ if (next != hole &&
+ &next->list != &mgr->va_holes &&
+ (next->offset + next->size) == va) {
+ next->size += hole->size;
list_del(&hole->list);
free(hole);
}
- }
- } else {
- struct amdgpu_bo_va_hole *next;
-
- hole = container_of(&mgr->va_holes, hole, list);
- LIST_FOR_EACH_ENTRY(next, &mgr->va_holes, list) {
- if (next->offset < va)
- break;
- hole = next;
- }
-
- if (&hole->list != &mgr->va_holes) {
- /* Grow upper hole if it's adjacent */
- if (hole->offset == (va + size)) {
- hole->offset = va;
- hole->size += size;
- /* Merge lower hole if it's adjacent */
- if (next != hole &&
- &next->list != &mgr->va_holes &&
- (next->offset + next->size) == va) {
- next->size += hole->size;
- list_del(&hole->list);
- free(hole);
- }
- goto out;
- }
- }
-
- /* Grow lower hole if it's adjacent */
- if (next != hole && &next->list != &mgr->va_holes &&
- (next->offset + next->size) == va) {
- next->size += size;
goto out;
}
+ }
- /* FIXME on allocation failure we just lose virtual address space
- * maybe print a warning
- */
- next = calloc(1, sizeof(struct amdgpu_bo_va_hole));
- if (next) {
- next->size = size;
- next->offset = va;
- list_add(&next->list, &hole->list);
- }
+ /* Grow lower hole if it's adjacent */
+ if (next != hole && &next->list != &mgr->va_holes &&
+ (next->offset + next->size) == va) {
+ next->size += size;
+ goto out;
}
+
+ /* FIXME on allocation failure we just lose virtual address space
+ * maybe print a warning
+ */
+ next = calloc(1, sizeof(struct amdgpu_bo_va_hole));
+ if (next) {
+ next->size = size;
+ next->offset = va;
+ list_add(&next->list, &hole->list);
+ }
+
out:
pthread_mutex_unlock(&mgr->bo_va_mutex);
}
--
2.7.4
[-- Attachment #3: Type: text/plain, Size: 154 bytes --]
_______________________________________________
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 libdrm 2/2] libdrm: clean up non list code path for vamgr
[not found] ` <c6b30b81-8b6f-3b5a-5654-e8075939143e-5C7GfCeVMHo@public.gmane.org>
@ 2018-02-09 8:58 ` Michel Dänzer
[not found] ` <c7eaf026-f0f5-fab3-4bab-c11b39701e6a-otUistvHUpPR7s880joybQ@public.gmane.org>
0 siblings, 1 reply; 12+ messages in thread
From: Michel Dänzer @ 2018-02-09 8:58 UTC (permalink / raw)
To: Chunming Zhou, Chunming Zhou
Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Hui.Deng-5C7GfCeVMHo
On 2018-02-09 07:01 AM, Chunming Zhou wrote:
> On 2018年02月08日 17:13, Chunming Zhou wrote:
>> On 2018年02月08日 17:01, Michel Dänzer wrote:
>>>
>>> this change completely broke radeonsi due to memory management errors
>>> (see valgrind output for glxgears below), so I had to revert it.
>> ok, I will look into what happens. Sorry for broken.
> The patch lost a "goto out" in free_va when applying patch from hybrid
> to opensource.
> The attached fixes that, I tested successfully in my local side.
> please review or test, if no problem, I will submit it again.
Please add:
v2: Add missing "goto out"
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
to the commit log before pushing.
--
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 libdrm 2/2] libdrm: clean up non list code path for vamgr
[not found] ` <c7eaf026-f0f5-fab3-4bab-c11b39701e6a-otUistvHUpPR7s880joybQ@public.gmane.org>
@ 2018-02-18 8:41 ` Andrey Grodzovsky
[not found] ` <881720e0-3225-dd36-23f7-146b9bfb919d-5C7GfCeVMHo@public.gmane.org>
0 siblings, 1 reply; 12+ messages in thread
From: Andrey Grodzovsky @ 2018-02-18 8:41 UTC (permalink / raw)
To: Michel Dänzer, Chunming Zhou, Chunming Zhou
Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Hui.Deng-5C7GfCeVMHo
Hi David, I have an issue on Vega 10 where sudo xinit fails with
[ 5801.227] Failed to allocate front buffer memory
[ 5801.227] (EE) AMDGPU(0): amdgpu_setup_kernel_mem failed
[ 5801.227] (EE)
Fatal server error:
[ 5801.227] (EE) AddScreen/ScreenInit failed for driver 0
[ 5801.227] (EE)
[ 5801.227] (EE)
Also in MESA code
si_create_context->si_common_context_init->pipe_buffer_create returns NULL.
Ellsmire works fine, on Vega 10 reverting this patch makes it work.
I am during my test system upgrade right now with some more issues after
this one, so I can spend time on debugging this once my system is in
good shape, unless you have an answer to this problem right away.
Thanks,
Andrey
On 02/09/2018 03:58 AM, Michel Dänzer wrote:
> On 2018-02-09 07:01 AM, Chunming Zhou wrote:
>> On 2018年02月08日 17:13, Chunming Zhou wrote:
>>> On 2018年02月08日 17:01, Michel Dänzer wrote:
>>>> this change completely broke radeonsi due to memory management errors
>>>> (see valgrind output for glxgears below), so I had to revert it.
>>> ok, I will look into what happens. Sorry for broken.
>> The patch lost a "goto out" in free_va when applying patch from hybrid
>> to opensource.
>> The attached fixes that, I tested successfully in my local side.
>> please review or test, if no problem, I will submit it again.
> Please add:
>
> v2: Add missing "goto out"
> Tested-by: Michel Dänzer <michel.daenzer@amd.com>
>
> to the commit log before pushing.
>
>
_______________________________________________
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 libdrm 2/2] libdrm: clean up non list code path for vamgr
[not found] ` <881720e0-3225-dd36-23f7-146b9bfb919d-5C7GfCeVMHo@public.gmane.org>
@ 2018-02-19 7:25 ` Andrey Grodzovsky
[not found] ` <dcb5a4b1-f959-107b-d4af-18758fbf74cd-5C7GfCeVMHo@public.gmane.org>
0 siblings, 1 reply; 12+ messages in thread
From: Andrey Grodzovsky @ 2018-02-19 7:25 UTC (permalink / raw)
To: Michel Dänzer, Chunming Zhou, Chunming Zhou
Cc: Koenig, Christian, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
Hui.Deng-5C7GfCeVMHo
[-- Attachment #1: Type: text/plain, Size: 2011 bytes --]
Found time to do some debugging and found error in assigning of
initial VA hole size, attached patch makes this issue go away, otherwise
amdgpu_vamgr_find_va would always fail.
Thanks,
Andrey
On 02/18/2018 03:41 AM, Andrey Grodzovsky wrote:
> Hi David, I have an issue on Vega 10 where sudo xinit fails with
>
> [ 5801.227] Failed to allocate front buffer memory
> [ 5801.227] (EE) AMDGPU(0): amdgpu_setup_kernel_mem failed
> [ 5801.227] (EE)
> Fatal server error:
> [ 5801.227] (EE) AddScreen/ScreenInit failed for driver 0
> [ 5801.227] (EE)
> [ 5801.227] (EE)
>
> Also in MESA code
> si_create_context->si_common_context_init->pipe_buffer_create returns
> NULL.
>
> Ellsmire works fine, on Vega 10 reverting this patch makes it work.
>
> I am during my test system upgrade right now with some more issues
> after this one, so I can spend time on debugging this once my system
> is in good shape, unless you have an answer to this problem right away.
>
> Thanks,
>
> Andrey
>
>
> On 02/09/2018 03:58 AM, Michel Dänzer wrote:
>> On 2018-02-09 07:01 AM, Chunming Zhou wrote:
>>> On 2018年02月08日 17:13, Chunming Zhou wrote:
>>>> On 2018年02月08日 17:01, Michel Dänzer wrote:
>>>>> this change completely broke radeonsi due to memory management errors
>>>>> (see valgrind output for glxgears below), so I had to revert it.
>>>> ok, I will look into what happens. Sorry for broken.
>>> The patch lost a "goto out" in free_va when applying patch from hybrid
>>> to opensource.
>>> The attached fixes that, I tested successfully in my local side.
>>> please review or test, if no problem, I will submit it again.
>> Please add:
>>
>> v2: Add missing "goto out"
>> Tested-by: Michel Dänzer <michel.daenzer-5C7GfCeVMHo@public.gmane.org>
>>
>> to the commit log before pushing.
>>
>>
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[-- Attachment #2: 0001-amdgpu-Fix-mistake-in-initial-hole-size-calculation.patch --]
[-- Type: text/x-patch, Size: 1220 bytes --]
>From 020b68cf0f5a3c5a1ea4dc48df6a895904da28b6 Mon Sep 17 00:00:00 2001
From: Andrey Grodzovsky <andrey.grodzovsky-5C7GfCeVMHo@public.gmane.org>
Date: Mon, 19 Feb 2018 02:18:36 -0500
Subject: amdgpu: Fix mistake in initial hole size calculation.
Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky-5C7GfCeVMHo@public.gmane.org>
---
amdgpu/amdgpu_vamgr.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/amdgpu/amdgpu_vamgr.c b/amdgpu/amdgpu_vamgr.c
index 722067f..5840042 100644
--- a/amdgpu/amdgpu_vamgr.c
+++ b/amdgpu/amdgpu_vamgr.c
@@ -57,7 +57,7 @@ drm_private void amdgpu_vamgr_init(struct amdgpu_bo_va_mgr *mgr, uint64_t start,
pthread_mutex_init(&mgr->bo_va_mutex, NULL);
pthread_mutex_lock(&mgr->bo_va_mutex);
n = calloc(1, sizeof(struct amdgpu_bo_va_hole));
- n->size = mgr->va_max;
+ n->size = mgr->va_max - start;
n->offset = start;
list_add(&n->list, &mgr->va_holes);
pthread_mutex_unlock(&mgr->bo_va_mutex);
@@ -80,6 +80,7 @@ amdgpu_vamgr_find_va(struct amdgpu_bo_va_mgr *mgr, uint64_t size,
struct amdgpu_bo_va_hole *hole, *n;
uint64_t offset = 0, waste = 0;
+
alignment = MAX2(alignment, mgr->va_alignment);
size = ALIGN(size, mgr->va_alignment);
--
2.7.4
[-- Attachment #3: Type: text/plain, Size: 154 bytes --]
_______________________________________________
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 libdrm 2/2] libdrm: clean up non list code path for vamgr
[not found] ` <dcb5a4b1-f959-107b-d4af-18758fbf74cd-5C7GfCeVMHo@public.gmane.org>
@ 2018-02-19 7:50 ` Christian König
[not found] ` <032f5418-4b01-f269-7e0a-5e1dcad65e10-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
0 siblings, 1 reply; 12+ messages in thread
From: Christian König @ 2018-02-19 7:50 UTC (permalink / raw)
To: Andrey Grodzovsky, Michel Dänzer, Chunming Zhou, Chunming Zhou
Cc: Koenig, Christian, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
Hui.Deng-5C7GfCeVMHo
[-- Attachment #1.1: Type: text/plain, Size: 2436 bytes --]
Patch is Acked-by: Christian König <christian.koenig-5C7GfCeVMHo@public.gmane.org>
Regards,
Christian.
Am 19.02.2018 um 08:25 schrieb Andrey Grodzovsky:
> Found time to do some debugging and found error in assigning of
> initial VA hole size, attached patch makes this issue go away,
> otherwise amdgpu_vamgr_find_va would always fail.
>
> Thanks,
>
> Andrey
>
>
> On 02/18/2018 03:41 AM, Andrey Grodzovsky wrote:
>> Hi David, I have an issue on Vega 10 where sudo xinit fails with
>>
>> [ 5801.227] Failed to allocate front buffer memory
>> [ 5801.227] (EE) AMDGPU(0): amdgpu_setup_kernel_mem failed
>> [ 5801.227] (EE)
>> Fatal server error:
>> [ 5801.227] (EE) AddScreen/ScreenInit failed for driver 0
>> [ 5801.227] (EE)
>> [ 5801.227] (EE)
>>
>> Also in MESA code
>> si_create_context->si_common_context_init->pipe_buffer_create returns
>> NULL.
>>
>> Ellsmire works fine, on Vega 10 reverting this patch makes it work.
>>
>> I am during my test system upgrade right now with some more issues
>> after this one, so I can spend time on debugging this once my system
>> is in good shape, unless you have an answer to this problem right away.
>>
>> Thanks,
>>
>> Andrey
>>
>>
>> On 02/09/2018 03:58 AM, Michel Dänzer wrote:
>>> On 2018-02-09 07:01 AM, Chunming Zhou wrote:
>>>> On 2018年02月08日 17:13, Chunming Zhou wrote:
>>>>> On 2018年02月08日 17:01, Michel Dänzer wrote:
>>>>>> this change completely broke radeonsi due to memory management
>>>>>> errors
>>>>>> (see valgrind output for glxgears below), so I had to revert it.
>>>>> ok, I will look into what happens. Sorry for broken.
>>>> The patch lost a "goto out" in free_va when applying patch from hybrid
>>>> to opensource.
>>>> The attached fixes that, I tested successfully in my local side.
>>>> please review or test, if no problem, I will submit it again.
>>> Please add:
>>>
>>> v2: Add missing "goto out"
>>> Tested-by: Michel Dänzer <michel.daenzer-5C7GfCeVMHo@public.gmane.org>
>>>
>>> to the commit log before pushing.
>>>
>>>
>>
>> _______________________________________________
>> amd-gfx mailing list
>> amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
>> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
>
>
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[-- Attachment #1.2: Type: text/html, Size: 4834 bytes --]
[-- Attachment #2: Type: text/plain, Size: 154 bytes --]
_______________________________________________
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 libdrm 2/2] libdrm: clean up non list code path for vamgr
[not found] ` <032f5418-4b01-f269-7e0a-5e1dcad65e10-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2018-02-26 3:21 ` Chunming Zhou
0 siblings, 0 replies; 12+ messages in thread
From: Chunming Zhou @ 2018-02-26 3:21 UTC (permalink / raw)
To: christian.koenig-5C7GfCeVMHo, Andrey Grodzovsky,
Michel Dänzer, Chunming Zhou
Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Hui.Deng-5C7GfCeVMHo
[-- Attachment #1.1: Type: text/plain, Size: 2615 bytes --]
Thanks for fix.
Regards,
David Zhou
On 2018年02月19日 15:50, Christian König wrote:
> Patch is Acked-by: Christian König <christian.koenig-5C7GfCeVMHo@public.gmane.org>
>
> Regards,
> Christian.
>
> Am 19.02.2018 um 08:25 schrieb Andrey Grodzovsky:
>> Found time to do some debugging and found error in assigning of
>> initial VA hole size, attached patch makes this issue go away,
>> otherwise amdgpu_vamgr_find_va would always fail.
>>
>> Thanks,
>>
>> Andrey
>>
>>
>> On 02/18/2018 03:41 AM, Andrey Grodzovsky wrote:
>>> Hi David, I have an issue on Vega 10 where sudo xinit fails with
>>>
>>> [ 5801.227] Failed to allocate front buffer memory
>>> [ 5801.227] (EE) AMDGPU(0): amdgpu_setup_kernel_mem failed
>>> [ 5801.227] (EE)
>>> Fatal server error:
>>> [ 5801.227] (EE) AddScreen/ScreenInit failed for driver 0
>>> [ 5801.227] (EE)
>>> [ 5801.227] (EE)
>>>
>>> Also in MESA code
>>> si_create_context->si_common_context_init->pipe_buffer_create
>>> returns NULL.
>>>
>>> Ellsmire works fine, on Vega 10 reverting this patch makes it work.
>>>
>>> I am during my test system upgrade right now with some more issues
>>> after this one, so I can spend time on debugging this once my system
>>> is in good shape, unless you have an answer to this problem right away.
>>>
>>> Thanks,
>>>
>>> Andrey
>>>
>>>
>>> On 02/09/2018 03:58 AM, Michel Dänzer wrote:
>>>> On 2018-02-09 07:01 AM, Chunming Zhou wrote:
>>>>> On 2018年02月08日 17:13, Chunming Zhou wrote:
>>>>>> On 2018年02月08日 17:01, Michel Dänzer wrote:
>>>>>>> this change completely broke radeonsi due to memory management
>>>>>>> errors
>>>>>>> (see valgrind output for glxgears below), so I had to revert it.
>>>>>> ok, I will look into what happens. Sorry for broken.
>>>>> The patch lost a "goto out" in free_va when applying patch from
>>>>> hybrid
>>>>> to opensource.
>>>>> The attached fixes that, I tested successfully in my local side.
>>>>> please review or test, if no problem, I will submit it again.
>>>> Please add:
>>>>
>>>> v2: Add missing "goto out"
>>>> Tested-by: Michel Dänzer <michel.daenzer-5C7GfCeVMHo@public.gmane.org>
>>>>
>>>> to the commit log before pushing.
>>>>
>>>>
>>>
>>> _______________________________________________
>>> amd-gfx mailing list
>>> amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
>>> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
>>
>>
>>
>> _______________________________________________
>> amd-gfx mailing list
>> amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
>> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
>
[-- Attachment #1.2: Type: text/html, Size: 5366 bytes --]
[-- Attachment #2: Type: text/plain, Size: 154 bytes --]
_______________________________________________
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:[~2018-02-26 3:21 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-12 5:45 [PATCH libdrm 1/2] libdrm: fix inefficient vamgr algorithm Chunming Zhou
[not found] ` <20180112054554.19585-1-david1.zhou-5C7GfCeVMHo@public.gmane.org>
2018-01-12 5:45 ` [PATCH libdrm 2/2] libdrm: clean up non list code path for vamgr Chunming Zhou
[not found] ` <20180112054554.19585-2-david1.zhou-5C7GfCeVMHo@public.gmane.org>
2018-01-12 8:04 ` Christian König
[not found] ` <563c031e-2e11-eb51-bdce-589da435c9a8-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-01-12 8:17 ` Chunming Zhou
2018-02-08 9:01 ` Michel Dänzer
[not found] ` <e3722edc-8ca4-4730-d649-2b5a959b92c1-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-02-08 9:13 ` Chunming Zhou
[not found] ` <4a2036e5-820f-d62a-a773-2da1f575e1bc-5C7GfCeVMHo@public.gmane.org>
2018-02-09 6:01 ` Chunming Zhou
[not found] ` <c6b30b81-8b6f-3b5a-5654-e8075939143e-5C7GfCeVMHo@public.gmane.org>
2018-02-09 8:58 ` Michel Dänzer
[not found] ` <c7eaf026-f0f5-fab3-4bab-c11b39701e6a-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-02-18 8:41 ` Andrey Grodzovsky
[not found] ` <881720e0-3225-dd36-23f7-146b9bfb919d-5C7GfCeVMHo@public.gmane.org>
2018-02-19 7:25 ` Andrey Grodzovsky
[not found] ` <dcb5a4b1-f959-107b-d4af-18758fbf74cd-5C7GfCeVMHo@public.gmane.org>
2018-02-19 7:50 ` Christian König
[not found] ` <032f5418-4b01-f269-7e0a-5e1dcad65e10-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-02-26 3:21 ` Chunming Zhou
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.