FAILED: patch "[PATCH] drm/amdgpu: Use drm_calloc_large for VM page_tables array" failed to apply to 4.4-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 4.4-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
Quoted 1 line
From
9571e1d84042f5670df9fabdcbe7dd5da3abe43eMon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <[email protected]>
Date: Tue, 19 Jan 2016 17:59:46 +0900
Subject: [PATCH] drm/amdgpu: Use drm_calloc_large for VM page_tables array
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
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
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +3 -4
@@ -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);
PATCH 1/1 drm/amdgpu: Use drm_calloc_large for VM page_tables array
From: Michel Dänzer <[email protected]>
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
(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(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +3 -4
@@ -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);
Signature · 1 line
2.7.0
Greg KH
maintainerRe: [PATCH] drm/amdgpu: Use drm_calloc_large for VM page_tables array
Quoted 6 lines · Michel D�nzer
From: Michel D�nzer <[email protected]>
It can be big, depending on the VM address space size, which is tunable via the
vm_sizemodule parameter.Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93721
Quoted 8 lines
Reviewed-by Christian K�nig <[email protected]>Signed-off-by Michel D�nzer <[email protected]>Signed-off-by Alex Deucher <[email protected]>(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