* [PATCH] drm/amdgpu: Use drm_calloc_large for VM page_tables array
@ 2016-01-19 8:59 Michel Dänzer
2016-01-19 13:03 ` Christian König
0 siblings, 1 reply; 5+ messages in thread
From: Michel Dänzer @ 2016-01-19 8:59 UTC (permalink / raw)
To: dri-devel
From: Michel Dänzer <michel.daenzer@amd.com>
It can be big, depending on the VM address space size, which is tunable
via the vm_size module parameter.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93721
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index aefc668..9599f75 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -1282,7 +1282,7 @@ int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm)
{
const unsigned align = min(AMDGPU_VM_PTB_ALIGN_SIZE,
AMDGPU_VM_PTE_COUNT * 8);
- unsigned pd_size, pd_entries, pts_size;
+ unsigned pd_size, pd_entries;
int i, r;
for (i = 0; i < AMDGPU_MAX_RINGS; ++i) {
@@ -1300,8 +1300,7 @@ int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm)
pd_entries = amdgpu_vm_num_pdes(adev);
/* allocate page table array */
- pts_size = pd_entries * sizeof(struct amdgpu_vm_pt);
- vm->page_tables = kzalloc(pts_size, GFP_KERNEL);
+ vm->page_tables = drm_calloc_large(pd_entries, sizeof(struct amdgpu_vm_pt));
if (vm->page_tables == NULL) {
DRM_ERROR("Cannot allocate memory for page table array\n");
return -ENOMEM;
@@ -1361,7 +1360,7 @@ void amdgpu_vm_fini(struct amdgpu_device *adev, struct amdgpu_vm *vm)
for (i = 0; i < amdgpu_vm_num_pdes(adev); i++)
amdgpu_bo_unref(&vm->page_tables[i].entry.robj);
- kfree(vm->page_tables);
+ drm_free_large(vm->page_tables);
amdgpu_bo_unref(&vm->page_directory);
fence_put(vm->page_directory_fence);
--
2.7.0.rc3
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/amdgpu: Use drm_calloc_large for VM page_tables array
2016-01-19 8:59 [PATCH] drm/amdgpu: Use drm_calloc_large for VM page_tables array Michel Dänzer
@ 2016-01-19 13:03 ` Christian König
2016-01-19 17:05 ` Alex Deucher
0 siblings, 1 reply; 5+ messages in thread
From: Christian König @ 2016-01-19 13:03 UTC (permalink / raw)
To: Michel Dänzer, dri-devel
Am 19.01.2016 um 09:59 schrieb Michel Dänzer:
> From: Michel Dänzer <michel.daenzer@amd.com>
>
> It can be big, depending on the VM address space size, which is tunable
> via the vm_size module parameter.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93721
> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
I actually wanted to address this by reducing sizeof(struct
amdgpu_vm_pt), but once more never got the time to do so.
Patch is Reviewed-by: Christian König <christian.koenig@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> index aefc668..9599f75 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> @@ -1282,7 +1282,7 @@ int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm)
> {
> const unsigned align = min(AMDGPU_VM_PTB_ALIGN_SIZE,
> AMDGPU_VM_PTE_COUNT * 8);
> - unsigned pd_size, pd_entries, pts_size;
> + unsigned pd_size, pd_entries;
> int i, r;
>
> for (i = 0; i < AMDGPU_MAX_RINGS; ++i) {
> @@ -1300,8 +1300,7 @@ int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm)
> pd_entries = amdgpu_vm_num_pdes(adev);
>
> /* allocate page table array */
> - pts_size = pd_entries * sizeof(struct amdgpu_vm_pt);
> - vm->page_tables = kzalloc(pts_size, GFP_KERNEL);
> + vm->page_tables = drm_calloc_large(pd_entries, sizeof(struct amdgpu_vm_pt));
> if (vm->page_tables == NULL) {
> DRM_ERROR("Cannot allocate memory for page table array\n");
> return -ENOMEM;
> @@ -1361,7 +1360,7 @@ void amdgpu_vm_fini(struct amdgpu_device *adev, struct amdgpu_vm *vm)
>
> for (i = 0; i < amdgpu_vm_num_pdes(adev); i++)
> amdgpu_bo_unref(&vm->page_tables[i].entry.robj);
> - kfree(vm->page_tables);
> + drm_free_large(vm->page_tables);
>
> amdgpu_bo_unref(&vm->page_directory);
> fence_put(vm->page_directory_fence);
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/amdgpu: Use drm_calloc_large for VM page_tables array
2016-01-19 13:03 ` Christian König
@ 2016-01-19 17:05 ` Alex Deucher
0 siblings, 0 replies; 5+ messages in thread
From: Alex Deucher @ 2016-01-19 17:05 UTC (permalink / raw)
To: Christian König; +Cc: Michel Dänzer, Maling list - DRI developers
On Tue, Jan 19, 2016 at 8:03 AM, Christian König
<deathsimple@vodafone.de> wrote:
> Am 19.01.2016 um 09:59 schrieb Michel Dänzer:
>>
>> From: Michel Dänzer <michel.daenzer@amd.com>
>>
>> It can be big, depending on the VM address space size, which is tunable
>> via the vm_size module parameter.
>>
>> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93721
>> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
>
>
> I actually wanted to address this by reducing sizeof(struct amdgpu_vm_pt),
> but once more never got the time to do so.
>
> Patch is Reviewed-by: Christian König <christian.koenig@amd.com>
>
Applied. Thanks,
Alex
>
>> ---
>> drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 7 +++----
>> 1 file changed, 3 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
>> index aefc668..9599f75 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
>> @@ -1282,7 +1282,7 @@ int amdgpu_vm_init(struct amdgpu_device *adev,
>> struct amdgpu_vm *vm)
>> {
>> const unsigned align = min(AMDGPU_VM_PTB_ALIGN_SIZE,
>> AMDGPU_VM_PTE_COUNT * 8);
>> - unsigned pd_size, pd_entries, pts_size;
>> + unsigned pd_size, pd_entries;
>> int i, r;
>> for (i = 0; i < AMDGPU_MAX_RINGS; ++i) {
>> @@ -1300,8 +1300,7 @@ int amdgpu_vm_init(struct amdgpu_device *adev,
>> struct amdgpu_vm *vm)
>> pd_entries = amdgpu_vm_num_pdes(adev);
>> /* allocate page table array */
>> - pts_size = pd_entries * sizeof(struct amdgpu_vm_pt);
>> - vm->page_tables = kzalloc(pts_size, GFP_KERNEL);
>> + vm->page_tables = drm_calloc_large(pd_entries, sizeof(struct
>> amdgpu_vm_pt));
>> if (vm->page_tables == NULL) {
>> DRM_ERROR("Cannot allocate memory for page table
>> array\n");
>> return -ENOMEM;
>> @@ -1361,7 +1360,7 @@ void amdgpu_vm_fini(struct amdgpu_device *adev,
>> struct amdgpu_vm *vm)
>> for (i = 0; i < amdgpu_vm_num_pdes(adev); i++)
>> amdgpu_bo_unref(&vm->page_tables[i].entry.robj);
>> - kfree(vm->page_tables);
>> + drm_free_large(vm->page_tables);
>> amdgpu_bo_unref(&vm->page_directory);
>> fence_put(vm->page_directory_fence);
>
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/amdgpu: Use drm_calloc_large for VM page_tables array
2016-03-07 8:05 ` [PATCH] drm/amdgpu: Use drm_calloc_large for VM page_tables array Michel Dänzer
@ 2016-03-07 22:59 ` Greg KH
0 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2016-03-07 22:59 UTC (permalink / raw)
To: Michel Dänzer; +Cc: alexander.deucher, christian.koenig, stable
On Mon, Mar 07, 2016 at 05:05:48PM +0900, Michel D�nzer wrote:
> From: Michel D�nzer <michel.daenzer@amd.com>
>
> It can be big, depending on the VM address space size, which is tunable
> via the vm_size module parameter.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93721
> Reviewed-by: Christian K�nig <christian.koenig@amd.com>
> Signed-off-by: Michel D�nzer <michel.daenzer@amd.com>
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> (Cherry picked from commit 9571e1d84042f5670df9fabdcbe7dd5da3abe43e)
> ---
>
> Here's a backport of this fix to the 4.4 tree. Compile tested only (but
> only one context line is different from the original change).
thanks for the backport, now applied.
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] drm/amdgpu: Use drm_calloc_large for VM page_tables array
2016-03-01 19:20 FAILED: patch "[PATCH] drm/amdgpu: Use drm_calloc_large for VM page_tables array" failed to apply to 4.4-stable tree gregkh
@ 2016-03-07 8:05 ` Michel Dänzer
2016-03-07 22:59 ` Greg KH
0 siblings, 1 reply; 5+ messages in thread
From: Michel Dänzer @ 2016-03-07 8:05 UTC (permalink / raw)
To: gregkh, alexander.deucher, christian.koenig; +Cc: stable
From: Michel Dänzer <michel.daenzer@amd.com>
It can be big, depending on the VM address space size, which is tunable
via the vm_size module parameter.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93721
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(Cherry picked from commit 9571e1d84042f5670df9fabdcbe7dd5da3abe43e)
---
Here's a backport of this fix to the 4.4 tree. Compile tested only (but
only one context line is different from the original change).
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index 39adbb6..8c5ec15 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -1248,7 +1248,7 @@ int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm)
{
const unsigned align = min(AMDGPU_VM_PTB_ALIGN_SIZE,
AMDGPU_VM_PTE_COUNT * 8);
- unsigned pd_size, pd_entries, pts_size;
+ unsigned pd_size, pd_entries;
int i, r;
for (i = 0; i < AMDGPU_MAX_RINGS; ++i) {
@@ -1266,8 +1266,7 @@ int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm)
pd_entries = amdgpu_vm_num_pdes(adev);
/* allocate page table array */
- pts_size = pd_entries * sizeof(struct amdgpu_vm_pt);
- vm->page_tables = kzalloc(pts_size, GFP_KERNEL);
+ vm->page_tables = drm_calloc_large(pd_entries, sizeof(struct amdgpu_vm_pt));
if (vm->page_tables == NULL) {
DRM_ERROR("Cannot allocate memory for page table array\n");
return -ENOMEM;
@@ -1327,7 +1326,7 @@ void amdgpu_vm_fini(struct amdgpu_device *adev, struct amdgpu_vm *vm)
for (i = 0; i < amdgpu_vm_num_pdes(adev); i++)
amdgpu_bo_unref(&vm->page_tables[i].bo);
- kfree(vm->page_tables);
+ drm_free_large(vm->page_tables);
amdgpu_bo_unref(&vm->page_directory);
fence_put(vm->page_directory_fence);
--
2.7.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-03-07 22:59 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-19 8:59 [PATCH] drm/amdgpu: Use drm_calloc_large for VM page_tables array Michel Dänzer
2016-01-19 13:03 ` Christian König
2016-01-19 17:05 ` Alex Deucher
2016-03-01 19:20 FAILED: patch "[PATCH] drm/amdgpu: Use drm_calloc_large for VM page_tables array" failed to apply to 4.4-stable tree gregkh
2016-03-07 8:05 ` [PATCH] drm/amdgpu: Use drm_calloc_large for VM page_tables array Michel Dänzer
2016-03-07 22:59 ` Greg KH
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.