From 2c50e95b9a65b7f78d8801e45588fb88ddfec0d8 Mon Sep 17 00:00:00 2001 From: Yong Zhao Date: Thu, 26 May 2016 22:31:56 -0400 Subject: [PATCH 1440/4131] drm/amdkfd: Clean up the data structure in kfd_process A list of per-process queues is maintained in the kfd_process_queue_manager, so the queues array in kfd_process is redundant and in fact unused. Change-Id: Ibbc5f6ea757628f2629baba7216c2719a9fe956f Signed-off-by: Yong Zhao --- drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 6 ------ drivers/gpu/drm/amd/amdkfd/kfd_process.c | 18 ------------------ 2 files changed, 24 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h index 49da7ef..1715c74 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h +++ b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h @@ -615,12 +615,6 @@ struct kfd_process { struct process_queue_manager pqm; - /* The process's queues. */ - size_t queue_array_size; - - /* Size is queue_array_size, up to MAX_PROCESS_QUEUES. */ - struct kfd_queue **queues; - unsigned long allocated_queue_bitmap[DIV_ROUND_UP(KFD_MAX_NUM_OF_QUEUES_PER_PROCESS, BITS_PER_LONG)]; /*Is the user space process 32 bit?*/ diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process.c b/drivers/gpu/drm/amd/amdkfd/kfd_process.c index 39332e6..aaa433e 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_process.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_process.c @@ -38,13 +38,6 @@ struct mm_struct; #include "kfd_priv.h" #include "kfd_dbgmgr.h" -/* - * Initial size for the array of queues. - * The allocated size is doubled each time - * it is exceeded up to MAX_PROCESS_QUEUES. - */ -#define INITIAL_QUEUE_ARRAY_SIZE 16 - static int evict_pdd(struct kfd_process_device *pdd); /* * List of struct kfd_process (field kfd_process). @@ -363,8 +356,6 @@ static void kfd_process_wq_release(struct work_struct *work) kfd_pasid_free(p->pasid); - kfree(p->queues); - kfree(p); kfree((void *)work); @@ -569,11 +560,6 @@ static struct kfd_process *create_process(const struct task_struct *thread) process->bo_interval_tree = RB_ROOT; - process->queues = kmalloc_array(INITIAL_QUEUE_ARRAY_SIZE, - sizeof(process->queues[0]), GFP_KERNEL); - if (!process->queues) - goto err_alloc_queues; - process->pasid = kfd_pasid_alloc(); if (process->pasid == 0) goto err_alloc_pasid; @@ -593,8 +579,6 @@ static struct kfd_process *create_process(const struct task_struct *thread) process->lead_thread = thread->group_leader; - process->queue_array_size = INITIAL_QUEUE_ARRAY_SIZE; - INIT_LIST_HEAD(&process->per_device_data); kfd_event_init_process(process); @@ -620,8 +604,6 @@ static struct kfd_process *create_process(const struct task_struct *thread) err_mmu_notifier: kfd_pasid_free(process->pasid); err_alloc_pasid: - kfree(process->queues); -err_alloc_queues: kfree(process); err_alloc_process: return ERR_PTR(err); -- 2.7.4