Still, even with NOPAGE_REFAULT or the equivalent with the new fault() code,
Could it be an option to make it safe for the fault handler to temporarily drop the mmap_sem read lock given that some conditions TBD are met?When you drop and retake the mmap_sem, you need to start again from
In that case it can retake the mmap_sem write lock, do the VMA flags modifications, downgrade and do the pte modifications using a helper, or even use remap_pfn_range() during the time the write lock is held?
find_vma. At which point you technically probably want to start again
from the architecture specfic fault code. It sounds difficult but I
won't say it can't be done.
I can be done with returning NOPAGE_REFAULT but as you said, I don't
think it's necessary.
Cheers,/Thomas
Ben.