This commit is contained in:
Andy Ritger
2022-11-10 08:39:33 -08:00
parent 7c345b838b
commit 758b4ee818
1323 changed files with 262135 additions and 60754 deletions

View File

@@ -218,7 +218,7 @@ static void uvm_put_user_pages_dirty(struct page **pages, NvU64 page_count)
for (i = 0; i < page_count; i++) {
set_page_dirty(pages[i]);
put_page(pages[i]);
NV_UNPIN_USER_PAGE(pages[i]);
}
}
@@ -262,7 +262,7 @@ static NV_STATUS map_user_pages(NvU64 user_va, NvU64 size, void **addr, struct p
}
nv_mmap_read_lock(current->mm);
ret = NV_GET_USER_PAGES(user_va, num_pages, 1, 0, *pages, vmas);
ret = NV_PIN_USER_PAGES(user_va, num_pages, FOLL_WRITE, *pages, vmas);
nv_mmap_read_unlock(current->mm);
if (ret != num_pages) {
status = NV_ERR_INVALID_ARGUMENT;
@@ -1116,6 +1116,19 @@ void uvm_tools_broadcast_access_counter(uvm_gpu_t *gpu,
uvm_tools_broadcast_event(&entry);
}
void uvm_tools_test_hmm_split_invalidate(uvm_va_space_t *va_space)
{
UvmEventEntry entry;
if (!va_space->tools.enabled)
return;
entry.testEventData.splitInvalidate.eventType = UvmEventTypeTestHmmSplitInvalidate;
uvm_down_read(&va_space->tools.lock);
uvm_tools_record_event(va_space, &entry);
uvm_up_read(&va_space->tools.lock);
}
// This function is used as a begin marker to group all migrations within a VA
// block that are performed in the same call to
// block_copy_resident_pages_between. All of these are pushed to the same
@@ -2101,8 +2114,7 @@ exit:
uvm_global_mask_release(retained_global_gpus);
if (mm)
uvm_va_space_mm_or_current_release(va_space, mm);
uvm_va_space_mm_or_current_release(va_space, mm);
uvm_kvfree(global_gpus);
uvm_kvfree(retained_global_gpus);