Skip to content

Commit f9caf6c

Browse files
Jie1zhangalexdeucher
authored andcommitted
drm/amdkfd:remove unused code
Function svm_range_split_by_grinity is not used, so it is removed. Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com> Suggested-by: Philip Yang <Philip.Yang@amd.com> Reviewed-by: Yifan Zhang <yifan1.zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 1958946 commit f9caf6c

2 files changed

Lines changed: 0 additions & 63 deletions

File tree

drivers/gpu/drm/amd/amdkfd/kfd_svm.c

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,66 +1141,6 @@ svm_range_add_child(struct svm_range *prange, struct mm_struct *mm,
11411141
list_add_tail(&pchild->child_list, &prange->child_list);
11421142
}
11431143

1144-
/**
1145-
* svm_range_split_by_granularity - collect ranges within granularity boundary
1146-
*
1147-
* @p: the process with svms list
1148-
* @mm: mm structure
1149-
* @addr: the vm fault address in pages, to split the prange
1150-
* @parent: parent range if prange is from child list
1151-
* @prange: prange to split
1152-
*
1153-
* Trims @prange to be a single aligned block of prange->granularity if
1154-
* possible. The head and tail are added to the child_list in @parent.
1155-
*
1156-
* Context: caller must hold mmap_read_lock and prange->lock
1157-
*
1158-
* Return:
1159-
* 0 - OK, otherwise error code
1160-
*/
1161-
int
1162-
svm_range_split_by_granularity(struct kfd_process *p, struct mm_struct *mm,
1163-
unsigned long addr, struct svm_range *parent,
1164-
struct svm_range *prange)
1165-
{
1166-
struct svm_range *head, *tail;
1167-
unsigned long start, last, size;
1168-
int r;
1169-
1170-
/* Align splited range start and size to granularity size, then a single
1171-
* PTE will be used for whole range, this reduces the number of PTE
1172-
* updated and the L1 TLB space used for translation.
1173-
*/
1174-
size = 1UL << prange->granularity;
1175-
start = ALIGN_DOWN(addr, size);
1176-
last = ALIGN(addr + 1, size) - 1;
1177-
1178-
pr_debug("svms 0x%p split [0x%lx 0x%lx] to [0x%lx 0x%lx] size 0x%lx\n",
1179-
prange->svms, prange->start, prange->last, start, last, size);
1180-
1181-
if (start > prange->start) {
1182-
r = svm_range_split(prange, start, prange->last, &head);
1183-
if (r)
1184-
return r;
1185-
svm_range_add_child(parent, mm, head, SVM_OP_ADD_RANGE);
1186-
}
1187-
1188-
if (last < prange->last) {
1189-
r = svm_range_split(prange, prange->start, last, &tail);
1190-
if (r)
1191-
return r;
1192-
svm_range_add_child(parent, mm, tail, SVM_OP_ADD_RANGE);
1193-
}
1194-
1195-
/* xnack on, update mapping on GPUs with ACCESS_IN_PLACE */
1196-
if (p->xnack_enabled && prange->work_item.op == SVM_OP_ADD_RANGE) {
1197-
prange->work_item.op = SVM_OP_ADD_RANGE_AND_MAP;
1198-
pr_debug("change prange 0x%p [0x%lx 0x%lx] op %d\n",
1199-
prange, prange->start, prange->last,
1200-
SVM_OP_ADD_RANGE_AND_MAP);
1201-
}
1202-
return 0;
1203-
}
12041144
static bool
12051145
svm_nodes_in_same_hive(struct kfd_node *node_a, struct kfd_node *node_b)
12061146
{

drivers/gpu/drm/amd/amdkfd/kfd_svm.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,6 @@ struct kfd_node *svm_range_get_node_by_id(struct svm_range *prange,
172172
int svm_range_vram_node_new(struct kfd_node *node, struct svm_range *prange,
173173
bool clear);
174174
void svm_range_vram_node_free(struct svm_range *prange);
175-
int svm_range_split_by_granularity(struct kfd_process *p, struct mm_struct *mm,
176-
unsigned long addr, struct svm_range *parent,
177-
struct svm_range *prange);
178175
int svm_range_restore_pages(struct amdgpu_device *adev, unsigned int pasid,
179176
uint32_t vmid, uint32_t node_id, uint64_t addr,
180177
bool write_fault);

0 commit comments

Comments
 (0)