mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
mm: replace FAULT_FLAG_SIZE with parameter to huge_fault
Since the introduction of FAULT_FLAG_SIZE to the vm_fault flag, it has been somewhat painful with getting the flags set and removed at the correct locations. More than one kernel oops was introduced due to difficulties of getting the placement correctly. Remove the flag values and introduce an input parameter to huge_fault that indicates the size of the page entry. This makes the code easier to trace and should avoid the issues we see with the fault flags where removal of the flag was necessary in the fallback paths. Link: http://lkml.kernel.org/r/148615748258.43180.1690152053774975329.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Dave Jiang <[email protected]> Tested-by: Dan Williams <[email protected]> Reviewed-by: Jan Kara <[email protected]> Cc: Matthew Wilcox <[email protected]> Cc: Dave Hansen <[email protected]> Cc: Vlastimil Babka <[email protected]> Cc: Ross Zwisler <[email protected]> Cc: Kirill A. Shutemov <[email protected]> Cc: Nilesh Choudhury <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: "H. Peter Anvin" <[email protected]> Cc: Thomas Gleixner <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
9557feee39
commit
c791ace1e7
8 changed files with 46 additions and 38 deletions
|
|
@ -538,7 +538,8 @@ static int __dax_dev_pud_fault(struct dax_dev *dax_dev, struct vm_fault *vmf)
|
|||
}
|
||||
#endif /* !CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD */
|
||||
|
||||
static int dax_dev_fault(struct vm_fault *vmf)
|
||||
static int dax_dev_huge_fault(struct vm_fault *vmf,
|
||||
enum page_entry_size pe_size)
|
||||
{
|
||||
int rc;
|
||||
struct file *filp = vmf->vma->vm_file;
|
||||
|
|
@ -550,14 +551,14 @@ static int dax_dev_fault(struct vm_fault *vmf)
|
|||
vmf->vma->vm_start, vmf->vma->vm_end);
|
||||
|
||||
rcu_read_lock();
|
||||
switch (vmf->flags & FAULT_FLAG_SIZE_MASK) {
|
||||
case FAULT_FLAG_SIZE_PTE:
|
||||
switch (pe_size) {
|
||||
case PE_SIZE_PTE:
|
||||
rc = __dax_dev_pte_fault(dax_dev, vmf);
|
||||
break;
|
||||
case FAULT_FLAG_SIZE_PMD:
|
||||
case PE_SIZE_PMD:
|
||||
rc = __dax_dev_pmd_fault(dax_dev, vmf);
|
||||
break;
|
||||
case FAULT_FLAG_SIZE_PUD:
|
||||
case PE_SIZE_PUD:
|
||||
rc = __dax_dev_pud_fault(dax_dev, vmf);
|
||||
break;
|
||||
default:
|
||||
|
|
@ -568,9 +569,14 @@ static int dax_dev_fault(struct vm_fault *vmf)
|
|||
return rc;
|
||||
}
|
||||
|
||||
static int dax_dev_fault(struct vm_fault *vmf)
|
||||
{
|
||||
return dax_dev_huge_fault(vmf, PE_SIZE_PTE);
|
||||
}
|
||||
|
||||
static const struct vm_operations_struct dax_dev_vm_ops = {
|
||||
.fault = dax_dev_fault,
|
||||
.huge_fault = dax_dev_fault,
|
||||
.huge_fault = dax_dev_huge_fault,
|
||||
};
|
||||
|
||||
static int dax_mmap(struct file *filp, struct vm_area_struct *vma)
|
||||
|
|
|
|||
Loading…
Reference in a new issue