mirror of
https://github.com/lkl/linux.git
synced 2025-12-19 08:03:01 +09:00
merge mm-hotfixes-stable into mm-stable to pick up depended-upon changes
This commit is contained in:
@@ -3496,15 +3496,24 @@ static inline int vm_fault_to_errno(vm_fault_t vm_fault, int foll_flags)
|
||||
* Indicates whether GUP can follow a PROT_NONE mapped page, or whether
|
||||
* a (NUMA hinting) fault is required.
|
||||
*/
|
||||
static inline bool gup_can_follow_protnone(unsigned int flags)
|
||||
static inline bool gup_can_follow_protnone(struct vm_area_struct *vma,
|
||||
unsigned int flags)
|
||||
{
|
||||
/*
|
||||
* FOLL_FORCE has to be able to make progress even if the VMA is
|
||||
* inaccessible. Further, FOLL_FORCE access usually does not represent
|
||||
* application behaviour and we should avoid triggering NUMA hinting
|
||||
* faults.
|
||||
* If callers don't want to honor NUMA hinting faults, no need to
|
||||
* determine if we would actually have to trigger a NUMA hinting fault.
|
||||
*/
|
||||
return flags & FOLL_FORCE;
|
||||
if (!(flags & FOLL_HONOR_NUMA_FAULT))
|
||||
return true;
|
||||
|
||||
/*
|
||||
* NUMA hinting faults don't apply in inaccessible (PROT_NONE) VMAs.
|
||||
*
|
||||
* Requiring a fault here even for inaccessible VMAs would mean that
|
||||
* FOLL_FORCE cannot make any progress, because handle_mm_fault()
|
||||
* refuses to process NUMA hinting faults in inaccessible VMAs.
|
||||
*/
|
||||
return !vma_is_accessible(vma);
|
||||
}
|
||||
|
||||
typedef int (*pte_fn_t)(pte_t *pte, unsigned long addr, void *data);
|
||||
|
||||
Reference in New Issue
Block a user