I need to call
I'm not convinced this is totally safe. The
_fast part of
get_user_pages_fast means that acquiring
mm->mmap_sem is not required, and part of the reason that works is because it is assumed that we are running within the process itself (so eg the
current->mm can't go away completely). Since you're running in another thread, you're susceptible to races if the real process ever does something that changes its mapping.
I guess the question is why can't you just use