On Mon 02-07-18 10:24:27, Yang Shi wrote:
This should be an extremely rare case. Just think about it. It should
On 7/2/18 6:37 AM, Michal Hocko wrote:
On Mon 02-07-18 15:33:11, Laurent Dufour wrote:OK, I just think it could save a few cycles to check the flag earlier.
On 02/07/2018 14:45, Michal Hocko wrote:[...]
On Mon 02-07-18 14:26:09, Laurent Dufour wrote:
On 02/07/2018 14:15, Michal Hocko wrote:
The thing is that it doesn't really need to be called earlier. You areYeah, this would have been more efficient to check that flag at the beginningYeah, and we have the VMA ready for all places where we do check theWe already do have a model for that. Have a look at MMF_UNSTABLE.MMF_UNSTABLE is a mm's flag, here this is a VMA's flag which is checked.
flag. check_stable_address_space can be made to get vma rather than mm.
of the page fault handler rather than the end, but this way it will be easier
to handle the speculative page fault too ;)
not risking data corruption on file backed mappings.
only ever happen when an access races with munmap which itself is
questionable if not an outright bug.
If nobody think it is necessary, we definitely could re-useIf we really need this whole VM_DEAD thing then it should be better
check_stable_address_space(),
handled at the same place rather than some ad-hoc places.
just return VM_FAULT_SIGSEGV for VM_DEAD vma,Why would you even care about shared mappings?
and check for both shared and non-shared.