Lines Matching refs:last
77 svm_range_check_vm(struct kfd_process *p, uint64_t start, uint64_t last,
95 prange, prange->start, prange->last); in svm_range_unlink()
104 if (prange->it_node.start != 0 && prange->it_node.last != 0) in svm_range_unlink()
112 prange, prange->start, prange->last); in svm_range_add_notifier_locked()
131 prange, prange->start, prange->last); in svm_range_add_to_svms()
135 prange->it_node.last = prange->last; in svm_range_add_to_svms()
144 prange->notifier.interval_tree.last >> PAGE_SHIFT); in svm_range_remove_notifier()
147 prange->notifier.interval_tree.last != 0) in svm_range_remove_notifier()
281 uint64_t size = (prange->last - prange->start + 1) << PAGE_SHIFT; in svm_range_free()
286 prange->start, prange->last); in svm_range_free()
325 uint64_t last, bool update_mem_usage) in svm_range_new() argument
327 uint64_t size = last - start + 1; in svm_range_new()
346 prange->last = last; in svm_range_new()
366 pr_debug("svms 0x%p [0x%llx 0x%llx]\n", svms, start, last); in svm_range_new()
398 prange->start, prange->last); in svm_range_bo_release()
516 prange->svms, prange->start, prange->last); in svm_range_validate_svm_bo()
567 prange->start, prange->last); in svm_range_vram_node_new()
985 uint64_t start, uint64_t last) in svm_range_split_pages() argument
987 uint64_t npages = last - start + 1; in svm_range_split_pages()
1006 uint64_t start, uint64_t last) in svm_range_split_nodes() argument
1008 uint64_t npages = last - start + 1; in svm_range_split_nodes()
1011 new->svms, new, new->start, start, last); in svm_range_split_nodes()
1047 uint64_t start, uint64_t last) in svm_range_split_adjust() argument
1052 new->svms, new->start, old->start, old->last, start, last); in svm_range_split_adjust()
1055 new->last > old->last) { in svm_range_split_adjust()
1060 r = svm_range_split_pages(new, old, start, last); in svm_range_split_adjust()
1065 r = svm_range_split_nodes(new, old, start, last); in svm_range_split_adjust()
1070 old->npages = last - start + 1; in svm_range_split_adjust()
1072 old->last = last; in svm_range_split_adjust()
1107 svm_range_split(struct svm_range *prange, uint64_t start, uint64_t last, in svm_range_split() argument
1111 uint64_t old_last = prange->last; in svm_range_split()
1116 old_start, old_last, start, last); in svm_range_split()
1118 if (old_start != start && old_last != last) in svm_range_split()
1120 if (start < old_start || last > old_last) in svm_range_split()
1125 *new = svm_range_new(svms, last + 1, old_last, false); in svm_range_split()
1131 r = svm_range_split_adjust(*new, prange, start, last); in svm_range_split()
1134 r, old_start, old_last, start, last); in svm_range_split()
1162 int r = svm_range_split(prange, new_start, prange->last, &head); in svm_range_split_head()
1177 pchild, pchild->start, pchild->last, prange, op); in svm_range_add_child()
1311 uint64_t start, uint64_t last, in svm_range_unmap_from_gpu() argument
1316 pr_debug("[0x%llx 0x%llx]\n", start, last); in svm_range_unmap_from_gpu()
1319 last, init_pte_value, 0, 0, NULL, NULL, in svm_range_unmap_from_gpu()
1325 unsigned long last, uint32_t trigger) in svm_range_unmap_from_gpus() argument
1336 prange, prange->start, prange->last); in svm_range_unmap_from_gpus()
1340 if (prange->start == start && prange->last == last) { in svm_range_unmap_from_gpus()
1358 start, last, trigger); in svm_range_unmap_from_gpus()
1362 start, last, &fence); in svm_range_unmap_from_gpus()
1843 prange->svms, prange, prange->start, prange->last, in svm_range_restore_work()
1851 r = svm_range_validate_and_map(mm, prange->start, prange->last, prange, in svm_range_restore_work()
1915 unsigned long start, unsigned long last, in svm_range_evict() argument
1926 svms, prange->start, prange->last, start, last); in svm_range_evict()
1938 if (pchild->start <= last && pchild->last >= start) { in svm_range_evict()
1940 pchild->start, pchild->last); in svm_range_evict()
1949 if (prange->start <= last && prange->last >= start) in svm_range_evict()
1957 prange->svms, prange->start, prange->last); in svm_range_evict()
1977 prange->svms, start, last); in svm_range_evict()
1981 l = min(last, pchild->last); in svm_range_evict()
1987 l = min(last, prange->last); in svm_range_evict()
1999 new = svm_range_new(old->svms, old->start, old->last, false); in svm_range_clone()
2053 svm_range_split_new(struct svm_range_list *svms, uint64_t start, uint64_t last, in svm_range_split_new() argument
2061 max_pages, start, last); in svm_range_split_new()
2063 while (last >= start) { in svm_range_split_new()
2064 l = min(last, ALIGN_DOWN(start + max_pages, max_pages) - 1); in svm_range_split_new()
2113 unsigned long last = start + size - 1UL; in svm_range_add() local
2121 pr_debug("svms 0x%p [0x%llx 0x%lx]\n", &p->svms, start, last); in svm_range_add()
2129 node = interval_tree_iter_first(&svms->objects, start, last); in svm_range_add()
2135 node->last); in svm_range_add()
2138 next = interval_tree_iter_next(node, start, last); in svm_range_add()
2139 next_start = min(node->last, last) + 1; in svm_range_add()
2144 } else if (node->start < start || node->last > last) { in svm_range_add()
2168 if (node->last > last) { in svm_range_add()
2170 r = svm_range_split_tail(prange, last, in svm_range_add()
2196 if (start <= last) in svm_range_add()
2197 r = svm_range_split_new(svms, start, last, in svm_range_add()
2219 unsigned long last; in svm_range_update_notifier_and_interval_tree() local
2222 last = prange->notifier.interval_tree.last >> PAGE_SHIFT; in svm_range_update_notifier_and_interval_tree()
2224 if (prange->start == start && prange->last == last) in svm_range_update_notifier_and_interval_tree()
2228 prange->svms, prange, start, last, prange->start, in svm_range_update_notifier_and_interval_tree()
2229 prange->last); in svm_range_update_notifier_and_interval_tree()
2231 if (start != 0 && last != 0) { in svm_range_update_notifier_and_interval_tree()
2236 prange->it_node.last = prange->last; in svm_range_update_notifier_and_interval_tree()
2249 svms, prange, prange->start, prange->last); in svm_range_handle_list_op()
2253 svms, prange, prange->start, prange->last); in svm_range_handle_list_op()
2260 svms, prange, prange->start, prange->last); in svm_range_handle_list_op()
2265 svms, prange, prange->start, prange->last); in svm_range_handle_list_op()
2271 prange->start, prange->last); in svm_range_handle_list_op()
2277 prange, prange->start, prange->last); in svm_range_handle_list_op()
2333 prange->start, prange->last, prange->work_item.op); in svm_range_deferred_list_work()
2401 prange, prange->start, prange->last, op); in svm_range_add_list_work()
2417 unsigned long last) in svm_range_unmap_split() argument
2424 prange->start, prange->last); in svm_range_unmap_split()
2427 if (start > prange->last || last < prange->start) in svm_range_unmap_split()
2433 if (last < tail->last) in svm_range_unmap_split()
2434 svm_range_split(tail, last + 1, tail->last, &head); in svm_range_unmap_split()
2450 unsigned long start, unsigned long last) in svm_range_unmap_from_cpu() argument
2476 prange, prange->start, prange->last, start, last); in svm_range_unmap_from_cpu()
2511 unmap_parent = start <= prange->start && last >= prange->last; in svm_range_unmap_from_cpu()
2516 l = min(last, pchild->last); in svm_range_unmap_from_cpu()
2519 svm_range_unmap_split(mm, prange, pchild, start, last); in svm_range_unmap_from_cpu()
2523 l = min(last, prange->last); in svm_range_unmap_from_cpu()
2526 svm_range_unmap_split(mm, prange, prange, start, last); in svm_range_unmap_from_cpu()
2565 unsigned long last; in svm_range_cpu_invalidate_pagetables() local
2573 last = mni->interval_tree.last; in svm_range_cpu_invalidate_pagetables()
2575 last = min(last, range->end - 1) >> PAGE_SHIFT; in svm_range_cpu_invalidate_pagetables()
2577 start, last, range->start >> PAGE_SHIFT, in svm_range_cpu_invalidate_pagetables()
2580 mni->interval_tree.last >> PAGE_SHIFT, range->event); in svm_range_cpu_invalidate_pagetables()
2589 svm_range_unmap_from_cpu(mni->mm, prange, start, last); in svm_range_cpu_invalidate_pagetables()
2592 svm_range_evict(prange, mni->mm, start, last, range->event); in svm_range_cpu_invalidate_pagetables()
2626 addr, prange->start, prange->last, node->start, node->last); in svm_range_from_addr()
2628 if (addr >= prange->start && addr <= prange->last) { in svm_range_from_addr()
2634 if (addr >= pchild->start && addr <= pchild->last) { in svm_range_from_addr()
2636 addr, pchild->start, pchild->last); in svm_range_from_addr()
2716 unsigned long *start, unsigned long *last, in svm_range_get_range_boundaries() argument
2751 if (node->last >= addr) { in svm_range_get_range_boundaries()
2755 start_limit = max(start_limit, node->last + 1); in svm_range_get_range_boundaries()
2759 *last = end_limit - 1; in svm_range_get_range_boundaries()
2763 *start, *last, *is_heap_stack); in svm_range_get_range_boundaries()
2769 svm_range_check_vm_userptr(struct kfd_process *p, uint64_t start, uint64_t last, in svm_range_check_vm_userptr() argument
2799 last << PAGE_SHIFT, in svm_range_check_vm_userptr()
2806 start, last); in svm_range_check_vm_userptr()
2826 unsigned long start, last; in svm_range_create_unregistered_range() local
2833 if (svm_range_get_range_boundaries(p, addr, &start, &last, in svm_range_create_unregistered_range()
2837 r = svm_range_check_vm(p, start, last, &bo_s, &bo_l); in svm_range_create_unregistered_range()
2839 r = svm_range_check_vm_userptr(p, start, last, &bo_s, &bo_l); in svm_range_create_unregistered_range()
2847 last = addr; in svm_range_create_unregistered_range()
2850 prange = svm_range_new(&p->svms, start, last, true); in svm_range_create_unregistered_range()
2896 svms, prange, prange->start, prange->last); in svm_range_skip_recover()
2902 svms, prange, prange->start, prange->last); in svm_range_skip_recover()
2953 unsigned long start, last, size; in svm_range_restore_pages() local
3072 svms, prange->start, prange->last); in svm_range_restore_pages()
3097 svms, prange->start, prange->last); in svm_range_restore_pages()
3103 svms, prange->start, prange->last, best_loc, in svm_range_restore_pages()
3112 last = min_t(unsigned long, ALIGN(addr + 1, size) - 1, prange->last); in svm_range_restore_pages()
3117 r = svm_migrate_to_vram(prange, best_loc, start, last, in svm_range_restore_pages()
3126 r = svm_migrate_vram_to_ram(prange, mm, start, last, in svm_range_restore_pages()
3132 r = svm_migrate_vram_to_ram(prange, mm, start, last, in svm_range_restore_pages()
3137 r, svms, start, last); in svm_range_restore_pages()
3142 r = svm_range_validate_and_map(mm, start, last, prange, gpuidx, false, in svm_range_restore_pages()
3146 r, svms, start, last); in svm_range_restore_pages()
3186 size = (pchild->last - pchild->start + 1) << PAGE_SHIFT; in svm_range_switch_xnack_reserve_mem()
3199 size = (prange->last - prange->start + 1) << PAGE_SHIFT; in svm_range_switch_xnack_reserve_mem()
3310 svm_range_check_vm(struct kfd_process *p, uint64_t start, uint64_t last, in svm_range_check_vm() argument
3329 node = interval_tree_iter_first(&vm->va, start, last); in svm_range_check_vm()
3332 start, last); in svm_range_check_vm()
3337 *bo_l = mapping->last; in svm_range_check_vm()
3459 p->xnack_enabled, &p->svms, prange->start, prange->last, in svm_range_best_prefetch_location()
3509 r = svm_migrate_vram_to_ram(prange, mm, prange->start, prange->last, in svm_range_trigger_migration()
3515 r = svm_migrate_to_vram(prange, best_loc, prange->start, prange->last, in svm_range_trigger_migration()
3566 prange->start, prange->last); in svm_range_evict_svm_bo_worker()
3574 prange->start, prange->last, in svm_range_evict_svm_bo_worker()
3662 prange->last); in svm_range_set_attr()
3698 r = svm_range_validate_and_map(mm, prange->start, prange->last, prange, in svm_range_set_attr()
3711 prange, prange->start, prange->last); in svm_range_set_attr()
3713 r = svm_range_validate_and_map(mm, prange->start, prange->last, prange, in svm_range_set_attr()
3747 uint64_t last = start + size - 1UL; in svm_range_get_attr() local
3810 node = interval_tree_iter_first(&svms->objects, start, last); in svm_range_get_attr()
3831 next = interval_tree_iter_next(node, start, last); in svm_range_get_attr()