Updated `README.md` with instructions for building/using the kernel module.
[xeon-phi-kernel-module] / host / tools_support.c
index 93922f8..38d6c21 100644 (file)
@@ -64,7 +64,7 @@ mic_unpin_user_pages(struct page **pages, uint32_t nf_pages)
                for (j = 0; j < nf_pages; j++) {
                        if (pages[j]) {
                                SetPageDirty(pages[j]);
                for (j = 0; j < nf_pages; j++) {
                        if (pages[j]) {
                                SetPageDirty(pages[j]);
-                               page_cache_release(pages[j]);
+                               put_page(pages[j]);
                        }
                }
                kfree(pages);
                        }
                }
                kfree(pages);
@@ -89,8 +89,8 @@ mic_pin_user_pages (void *data, struct page **pages, uint32_t len, int32_t *nf_p
 
        // pin the user pages; use semaphores on linux for doing the same
        down_read(&current->mm->mmap_sem);
 
        // pin the user pages; use semaphores on linux for doing the same
        down_read(&current->mm->mmap_sem);
-       *nf_pages = (int32_t)get_user_pages(current, current->mm, (uint64_t)data,
-                         nr_pages, PROT_WRITE, 1, pages, NULL);
+       *nf_pages = (int32_t)get_user_pages((uint64_t)data, nr_pages,
+               (FOLL_WRITE | FOLL_FORCE), pages, NULL);
        up_read(&current->mm->mmap_sem);
 
        // compare if the no of final pages is equal to no of requested pages
        up_read(&current->mm->mmap_sem);
 
        // compare if the no of final pages is equal to no of requested pages