linux kernel - get_user_pages() to pin memory across syscall -
according the kernel inline comment gup api:
"this not guarantee page exists in user mappings when get_user_pages returns, , there may different page there in cases (eg. if mmapped pagecache has been invalidated , subsequently re faulted). guarantee page won't freed completely. , callers care page contains data valid at point in time. typically, io or similar operation cannot guarantee stronger anyway because locks can't held on syscall boundary."
i assume have put_page()
before return user space. find ib_umem.c
get_user_pages()
in syscall , put_page()
in syscall. want same in driver. same?
thanks.
update on nov 10, 2016: ok, know reason. gup can pin page not freed. cannot lock vma point same page. ib_umem not solve problem, ib_umem_get() , ib_umem_release() should remain in same syscall scope.
i found solution such http://lwn.net/articles/600502/. tried introduce vm_pinped flags pin vma. seams nobody interested in. why?
Comments
Post a Comment