lkml.org 
[lkml]   [2020]   [Oct]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 03/13] misc/habana: Stop using frame_vector helpers
From
Date
On 10/7/20 9:44 AM, Daniel Vetter wrote:
...
> @@ -1414,15 +1410,10 @@ void hl_unpin_host_memory(struct hl_device *hdev, struct hl_userptr *userptr)
> userptr->sgt->nents,
> userptr->dir);
>
> - pages = frame_vector_pages(userptr->vec);
> - if (!IS_ERR(pages)) {
> - int i;
> -
> - for (i = 0; i < frame_vector_count(userptr->vec); i++)
> - set_page_dirty_lock(pages[i]);
> - }
> - put_vaddr_frames(userptr->vec);
> - frame_vector_destroy(userptr->vec);
> + for (i = 0; i < userptr->npages; i++)
> + set_page_dirty_lock(userptr->pages[i]);
> + unpin_user_pages(userptr->pages, userptr->npages);
> + kvfree(userptr->pages);

Same thing here as in patch 1: you can further simplify by using
unpin_user_pages_dirty_lock().

>
> list_del(&userptr->job_node);
>
>

thanks,
--
John Hubbard
NVIDIA

\
 
 \ /
  Last update: 2020-10-07 22:38    [W:0.203 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site