dax: Change return type to vm_fault_t
PATCH 1/1 dax: Change return type to vm_fault_t
Use new return type vm_fault_t for fault andhuge_fault handler.
--- drivers/dax/device.c | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-)
drivers/dax/device.c +11 -15
@@ -243,11 +243,11 @@ __weak phys_addr_t dax_pgoff_to_phys(struct dev_dax *dev_dax, pgoff_t pgoff,return -1 ; } -static int __dev_dax_pte_fault (struct dev_dax *dev_dax,struct vm_fault *vmf) +static vm_fault_t __dev_dax_pte_fault (struct dev_dax *dev_dax, +struct vm_fault *vmf) {struct device *dev = &dev_dax->dev;struct dax_region *dax_region; -int rc =VM_FAULT_SIGBUS ;phys_addr_t phys;pfn_t pfn;unsigned int fault_size =PAGE_SIZE ;
@@ -274,17 +274,11 @@ static int __dev_dax_pte_fault(struct dev_dax *dev_dax, struct vm_fault *vmf) pfn =phys_to_pfn_t (phys, dax_region->pfn_flags); - rc =vm_insert_mixed (vmf->vma, vmf->address, pfn); - -if (rc == -ENOMEM ) -return VM_FAULT_OOM ; -if (rc <0 && rc != -EBUSY ) -return VM_FAULT_SIGBUS ; - -return VM_FAULT_NOPAGE ; +return vmf_insert_mixed (vmf->vma, vmf->address, pfn); } -static int __dev_dax_pmd_fault (struct dev_dax *dev_dax,struct vm_fault *vmf) +static vm_fault_t __dev_dax_pmd_fault (struct dev_dax *dev_dax, +struct vm_fault *vmf) {unsigned long pmd_addr = vmf->address &PMD_MASK ;struct device *dev = &dev_dax->dev;
@@ -335,7 +329,8 @@ static int __dev_dax_pmd_fault(struct dev_dax *dev_dax, struct vm_fault *vmf) }#ifdef CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD -static int __dev_dax_pud_fault (struct dev_dax *dev_dax,struct vm_fault *vmf) +static vm_fault_t __dev_dax_pud_fault (struct dev_dax *dev_dax, +struct vm_fault *vmf) {unsigned long pud_addr = vmf->address &PUD_MASK ;struct device *dev = &dev_dax->dev;
@@ -386,13 +381,14 @@ static int __dev_dax_pud_fault(struct dev_dax *dev_dax, struct vm_fault *vmf) vmf->flags & FAULT_FLAG_WRITE); }#else -static int __dev_dax_pud_fault (struct dev_dax *dev_dax,struct vm_fault *vmf) +static vm_fault_t __dev_dax_pud_fault (struct dev_dax *dev_dax, +struct vm_fault *vmf) {return VM_FAULT_FALLBACK ; }#endif /* !CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD */ -static int dev_dax_huge_fault (struct vm_fault *vmf, +static vm_fault_t dev_dax_huge_fault (struct vm_fault *vmf,enum page_entry_size pe_size) {int rc, id;
@@ -423,7 +419,7 @@ static int dev_dax_huge_fault(struct vm_fault *vmf,return rc; } -static int dev_dax_fault (struct vm_fault *vmf) +static vm_fault_t dev_dax_fault (struct vm_fault *vmf) {return dev_dax_huge_fault (vmf,PE_SIZE_PTE ); }
Signature · 6 lines
1.9.1 _______________________________________________ Linux-nvdimm mailing list [email protected] https://lists.01.org/mailman/listinfo/linux-nvdimm
Quoted 30 lines · Souptick Joarder
Use new return type
vm_fault_tfor fault andhuge_faulthandler.Signed-off-by Souptick Joarder <[email protected]>Reviewed-by Matthew Wilcox <[email protected]>--- drivers/dax/device.c | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-)drivers/dax/device.c +2
-2@@ -243,11 +243,11 @@ __weak phys_addr_t dax_pgoff_to_phys(struct dev_dax *dev_dax, pgoff_t pgoff,return -1 ; } -static int __dev_dax_pte_fault (struct dev_dax *dev_dax,struct vm_fault *vmf) +static vm_fault_t __dev_dax_pte_fault (struct dev_dax *dev_dax, +struct vm_fault *vmf) {struct device *dev = &dev_dax->dev;struct dax_region *dax_region; -int rc =VM_FAULT_SIGBUS ;phys_addr_t phys;pfn_t pfn;unsigned int fault_size =PAGE_SIZE ;@@ -274,17 +274,11 @@ static int __dev_dax_pte_fault(struct dev_dax *dev_dax, struct vm_fault *vmf) pfn =phys_to_pfn_t (phys, dax_region->pfn_flags);
drivers/dax/device.c static int __dev_dax_pte_fault(struct dev_dax *dev_dax, struct vm_fault *vmf) · line 277
Quoted 10 lines
drivers/dax/device.c +1
-8- rc =vm_insert_mixed (vmf->vma, vmf->address, pfn); - -if (rc == -ENOMEM ) -return VM_FAULT_OOM ; -if (rc <0 && rc != -EBUSY ) -return VM_FAULT_SIGBUS ; - -return VM_FAULT_NOPAGE ; +return vmf_insert_mixed (vmf->vma, vmf->address, pfn);
Ugh, so this change to vmf_insert_mixed() went upstream without fixing the users? This changelog is now misleading as it does not mention that is now an urgent standalone fix. On first read I assumed this was part of a wider effort for 4.18.
Grumble, we'll get this applied with a 'Fixes: 1c8f422059ae ("mm:
change return type to vm_fault_t")' tag.
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm
Quoted 47 lines · Dan Williams
Quoted 30 lines · Souptick Joarder
Use new return type
vm_fault_tfor fault andhuge_faulthandler.Signed-off-by Souptick Joarder <[email protected]>Reviewed-by Matthew Wilcox <[email protected]>--- drivers/dax/device.c | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-)drivers/dax/device.c +2
-2@@ -243,11 +243,11 @@ __weak phys_addr_t dax_pgoff_to_phys(struct dev_dax *dev_dax, pgoff_t pgoff,return -1 ; } -static int __dev_dax_pte_fault (struct dev_dax *dev_dax,struct vm_fault *vmf) +static vm_fault_t __dev_dax_pte_fault (struct dev_dax *dev_dax, +struct vm_fault *vmf) {struct device *dev = &dev_dax->dev;struct dax_region *dax_region; -int rc =VM_FAULT_SIGBUS ;phys_addr_t phys;pfn_t pfn;unsigned int fault_size =PAGE_SIZE ;@@ -274,17 +274,11 @@ static int __dev_dax_pte_fault(struct dev_dax *dev_dax, struct vm_fault *vmf) pfn =phys_to_pfn_t (phys, dax_region->pfn_flags);drivers/dax/device.c static int __dev_dax_pte_fault(struct dev_dax *dev_dax, struct vm_fault *vmf) · line 277
Quoted 10 lines
drivers/dax/device.c +1
-8- rc =vm_insert_mixed (vmf->vma, vmf->address, pfn); - -if (rc == -ENOMEM ) -return VM_FAULT_OOM ; -if (rc <0 && rc != -EBUSY ) -return VM_FAULT_SIGBUS ; - -return VM_FAULT_NOPAGE ; +return vmf_insert_mixed (vmf->vma, vmf->address, pfn);Ugh, so this change to
vmf_insert_mixed()went upstream without fixing the users? This changelog is now misleading as it does not mention that is now an urgent standalone fix. On first read I assumed this was part of a wider effort for 4.18.
Quoted 3 lines
Grumble, we'll get this applied with a 'Fixes:
1c8f422059ae("mm:
change return type tovm_fault_t")' tag.
Thanks for that explanation. The patch description is missing any kind of "why" (justification).
Signature · 1 line
~Randy
Quoted 48 lines · Randy Dunlap
Quoted 47 lines · Dan Williams
Quoted 30 lines · Souptick Joarder
Use new return type
vm_fault_tfor fault andhuge_faulthandler.Signed-off-by Souptick Joarder <[email protected]>Reviewed-by Matthew Wilcox <[email protected]>--- drivers/dax/device.c | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-)drivers/dax/device.c +2
-2@@ -243,11 +243,11 @@ __weak phys_addr_t dax_pgoff_to_phys(struct dev_dax *dev_dax, pgoff_t pgoff,return -1 ; } -static int __dev_dax_pte_fault (struct dev_dax *dev_dax,struct vm_fault *vmf) +static vm_fault_t __dev_dax_pte_fault (struct dev_dax *dev_dax, +struct vm_fault *vmf) {struct device *dev = &dev_dax->dev;struct dax_region *dax_region; -int rc =VM_FAULT_SIGBUS ;phys_addr_t phys;pfn_t pfn;unsigned int fault_size =PAGE_SIZE ;@@ -274,17 +274,11 @@ static int __dev_dax_pte_fault(struct dev_dax *dev_dax, struct vm_fault *vmf) pfn =phys_to_pfn_t (phys, dax_region->pfn_flags);drivers/dax/device.c static int __dev_dax_pte_fault(struct dev_dax *dev_dax, struct vm_fault *vmf) · line 277
Quoted 10 lines
drivers/dax/device.c +1
-8- rc =vm_insert_mixed (vmf->vma, vmf->address, pfn); - -if (rc == -ENOMEM ) -return VM_FAULT_OOM ; -if (rc <0 && rc != -EBUSY ) -return VM_FAULT_SIGBUS ; - -return VM_FAULT_NOPAGE ; +return vmf_insert_mixed (vmf->vma, vmf->address, pfn);Ugh, so this change to
vmf_insert_mixed()went upstream without fixing the users? This changelog is now misleading as it does not mention that is now an urgent standalone fix. On first read I assumed this was part of a wider effort for 4.18.
Quoted 6 lines
Quoted 3 lines
Grumble, we'll get this applied with a 'Fixes:
1c8f422059ae("mm:
change return type tovm_fault_t")' tag.Thanks for that explanation. The patch description is missing any kind of "why" (justification).
ok, I will send v2 with description.
Quoted 4 lines
--
~Randy
Quoted 6 lines · Dan Williams
Quoted 6 lines
drivers/dax/device.c +0
-6- rc =vm_insert_mixed (vmf->vma, vmf->address, pfn); - -if (rc == -ENOMEM ) -return VM_FAULT_OOM ; -if (rc <0 && rc != -EBUSY ) -return VM_FAULT_SIGBUS ;
Quoted 8 lines
drivers/dax/device.c static int __dev_dax_pte_fault(struct dev_dax *dev_dax, struct vm_fault *vmf) · line 277
Quoted 3 lines
drivers/dax/device.c +1
-2- -return VM_FAULT_NOPAGE ; +return vmf_insert_mixed (vmf->vma, vmf->address, pfn);Ugh, so this change to
vmf_insert_mixed()went upstream without fixing the users? This changelog is now misleading as it does not mention that is now an urgent standalone fix. On first read I assumed this was part of a wider effort for 4.18.
You read too quickly. vmf_insert_mixed() is a *new* function which *replaces* vm_insert_mixed() and awful-mangling-of-return-values-done-per-driver.
Eventually vm_insert_mixed() will be deleted. But today is not that day.
Quoted 16 lines · Matthew Wilcox
Quoted 6 lines · Dan Williams
Quoted 6 lines
drivers/dax/device.c +0
-6- rc =vm_insert_mixed (vmf->vma, vmf->address, pfn); - -if (rc == -ENOMEM ) -return VM_FAULT_OOM ; -if (rc <0 && rc != -EBUSY ) -return VM_FAULT_SIGBUS ;Quoted 8 lines
drivers/dax/device.c static int __dev_dax_pte_fault(struct dev_dax *dev_dax, struct vm_fault *vmf) · line 277
Quoted 3 lines
drivers/dax/device.c +1
-2- -return VM_FAULT_NOPAGE ; +return vmf_insert_mixed (vmf->vma, vmf->address, pfn);Ugh, so this change to
vmf_insert_mixed()went upstream without fixing the users? This changelog is now misleading as it does not mention that is now an urgent standalone fix. On first read I assumed this was part of a wider effort for 4.18.
Quoted 5 lines
You read too quickly.
vmf_insert_mixed()is a *new* function which *replaces*vm_insert_mixed()and awful-mangling-of-return-values-done-per-driver.Eventually
vm_insert_mixed()will be deleted. But today is not that day.
Ah, ok, thanks for the clarification. Then this patch should definitely be re-titled to "dax: convert to the new vmf_insert_mixed() helper". The vm_fault_t conversion is just a minor side-effect of that larger change. I assume this can wait for v4.18.
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm
Quoted 21 lines · Dan Williams
Quoted 20 lines · Matthew Wilcox
Quoted 6 lines · Dan Williams
Quoted 6 lines
drivers/dax/device.c +0
-6- rc =vm_insert_mixed (vmf->vma, vmf->address, pfn); - -if (rc == -ENOMEM ) -return VM_FAULT_OOM ; -if (rc <0 && rc != -EBUSY ) -return VM_FAULT_SIGBUS ;Quoted 8 lines
drivers/dax/device.c static int __dev_dax_pte_fault(struct dev_dax *dev_dax, struct vm_fault *vmf) · line 277
Quoted 3 lines
drivers/dax/device.c +1
-2- -return VM_FAULT_NOPAGE ; +return vmf_insert_mixed (vmf->vma, vmf->address, pfn);Ugh, so this change to
vmf_insert_mixed()went upstream without fixing the users? This changelog is now misleading as it does not mention that is now an urgent standalone fix. On first read I assumed this was part of a wider effort for 4.18.You read too quickly.
vmf_insert_mixed()is a *new* function which *replaces*vm_insert_mixed()and awful-mangling-of-return-values-done-per-driver.
Quoted 6 lines
Quoted 1 line
Eventually
vm_insert_mixed()will be deleted. But today is not that day.Ah, ok, thanks for the clarification. Then this patch should definitely be re-titled to "dax: convert to the new
vmf_insert_mixed()helper". Thevm_fault_tconversion is just a minor side-effect of that larger change. I assume this can wait for v4.18.
Yes, no particular hurry.
Quoted 22 lines · Matthew Wilcox
Quoted 21 lines · Dan Williams
Quoted 20 lines · Matthew Wilcox
Quoted 6 lines · Dan Williams
Quoted 6 lines
drivers/dax/device.c +0
-6- rc =vm_insert_mixed (vmf->vma, vmf->address, pfn); - -if (rc == -ENOMEM ) -return VM_FAULT_OOM ; -if (rc <0 && rc != -EBUSY ) -return VM_FAULT_SIGBUS ;Quoted 8 lines
drivers/dax/device.c static int __dev_dax_pte_fault(struct dev_dax *dev_dax, struct vm_fault *vmf) · line 277
Quoted 3 lines
drivers/dax/device.c +1
-2- -return VM_FAULT_NOPAGE ; +return vmf_insert_mixed (vmf->vma, vmf->address, pfn);Ugh, so this change to
vmf_insert_mixed()went upstream without fixing the users? This changelog is now misleading as it does not mention that is now an urgent standalone fix. On first read I assumed this was part of a wider effort for 4.18.You read too quickly.
vmf_insert_mixed()is a *new* function which *replaces*vm_insert_mixed()and awful-mangling-of-return-values-done-per-driver.
Quoted 6 lines
Quoted 6 lines
Quoted 1 line
Eventually
vm_insert_mixed()will be deleted. But today is not that day.Ah, ok, thanks for the clarification. Then this patch should definitely be re-titled to "dax: convert to the new
vmf_insert_mixed()helper". Thevm_fault_tconversion is just a minor side-effect of that larger change. I assume this can wait for v4.18.
The primary objective is to change the return type to vm_fault_t in all fault handlers and to support that we have replace vm_insert_mixed() with vmf_insert_ mixed() within one fault handler function.
Do I really need to change the patch title ?
Quoted 30 lines · Souptick Joarder
Quoted 22 lines · Matthew Wilcox
Quoted 21 lines · Dan Williams
Quoted 20 lines · Matthew Wilcox
Quoted 6 lines · Dan Williams
Quoted 6 lines
drivers/dax/device.c +0
-6- rc =vm_insert_mixed (vmf->vma, vmf->address, pfn); - -if (rc == -ENOMEM ) -return VM_FAULT_OOM ; -if (rc <0 && rc != -EBUSY ) -return VM_FAULT_SIGBUS ;Quoted 8 lines
drivers/dax/device.c static int __dev_dax_pte_fault(struct dev_dax *dev_dax, struct vm_fault *vmf) · line 277
Quoted 3 lines
drivers/dax/device.c +1
-2- -return VM_FAULT_NOPAGE ; +return vmf_insert_mixed (vmf->vma, vmf->address, pfn);Ugh, so this change to
vmf_insert_mixed()went upstream without fixing the users? This changelog is now misleading as it does not mention that is now an urgent standalone fix. On first read I assumed this was part of a wider effort for 4.18.You read too quickly.
vmf_insert_mixed()is a *new* function which *replaces*vm_insert_mixed()and awful-mangling-of-return-values-done-per-driver.Quoted 6 lines
Quoted 6 lines
Quoted 1 line
Eventually
vm_insert_mixed()will be deleted. But today is not that day.Ah, ok, thanks for the clarification. Then this patch should definitely be re-titled to "dax: convert to the new
vmf_insert_mixed()helper". Thevm_fault_tconversion is just a minor side-effect of that larger change. I assume this can wait for v4.18.
Quoted 6 lines
The primary objective is to change the return type to
vm_fault_tin all fault handlers and to support that we have replacevm_insert_mixed()withvmf_insert_mixed()within one fault handler function.Do I really need to change the patch title ?
At this point, yes, or at least mention the vm_insert_mixed --> vmf_insert_mixed conversion in the changelog.
Quoted 36 lines · Dan Williams
Quoted 35 lines · Souptick Joarder
Quoted 22 lines · Matthew Wilcox
Quoted 21 lines · Dan Williams
Quoted 20 lines · Matthew Wilcox
Quoted 6 lines · Dan Williams
Quoted 6 lines
(quoted diff) +0
-6- rc = vm_insert_mixed(vmf->vma, vmf->address, pfn); - - if (rc == -ENOMEM) - return VM_FAULT_OOM; - if (rc < 0 && rc != -EBUSY) - return VM_FAULT_SIGBUS;Quoted 8 lines
Review
Quoted 3 lines
(quoted diff) +1
-2- - return VM_FAULT_NOPAGE; + return vmf_insert_mixed(vmf->vma, vmf->address, pfn);Ugh, so this change to
vmf_insert_mixed()went upstream without fixing the users? This changelog is now misleading as it does not mention that is now an urgent standalone fix. On first read I assumed this was part of a wider effort for 4.18.You read too quickly.
vmf_insert_mixed()is a *new* function which *replaces*vm_insert_mixed()and awful-mangling-of-return-values-done-per-driver.Quoted 6 lines
Quoted 6 lines
Quoted 1 line
Eventually
vm_insert_mixed()will be deleted. But today is not that day.Ah, ok, thanks for the clarification. Then this patch should definitely be re-titled to "dax: convert to the new
vmf_insert_mixed()helper". Thevm_fault_tconversion is just a minor side-effect of that larger change. I assume this can wait for v4.18.The primary objective is to change the return type to
vm_fault_tin all fault handlers and to support that we have replacevm_insert_mixed()withvmf_insert_mixed()within one fault handler function.
Quoted 4 lines
Quoted 1 line
Do I really need to change the patch title ?
At this point, yes, or at least mention the
vm_insert_mixed-->vmf_insert_mixedconversion in the changelog.
Ok, I will add this in change log and send v2.
Quoted 37 lines · Souptick Joarder
Quoted 36 lines · Dan Williams
Quoted 35 lines · Souptick Joarder
Quoted 22 lines · Matthew Wilcox
Quoted 21 lines · Dan Williams
Quoted 20 lines · Matthew Wilcox
Quoted 6 lines · Dan Williams
Quoted 6 lines
(quoted diff) +0
-6- rc = vm_insert_mixed(vmf->vma, vmf->address, pfn); - - if (rc == -ENOMEM) - return VM_FAULT_OOM; - if (rc < 0 && rc != -EBUSY) - return VM_FAULT_SIGBUS;Quoted 8 lines
Review
Quoted 3 lines
(quoted diff) +1
-2- - return VM_FAULT_NOPAGE; + return vmf_insert_mixed(vmf->vma, vmf->address, pfn);Ugh, so this change to
vmf_insert_mixed()went upstream without fixing the users? This changelog is now misleading as it does not mention that is now an urgent standalone fix. On first read I assumed this was part of a wider effort for 4.18.You read too quickly.
vmf_insert_mixed()is a *new* function which *replaces*vm_insert_mixed()and awful-mangling-of-return-values-done-per-driver.Quoted 6 lines
Quoted 6 lines
Quoted 1 line
Eventually
vm_insert_mixed()will be deleted. But today is not that day.Ah, ok, thanks for the clarification. Then this patch should definitely be re-titled to "dax: convert to the new
vmf_insert_mixed()helper". Thevm_fault_tconversion is just a minor side-effect of that larger change. I assume this can wait for v4.18.The primary objective is to change the return type to
vm_fault_tin all fault handlers and to support that we have replacevm_insert_mixed()withvmf_insert_mixed()within one fault handler function.
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
Do I really need to change the patch title ?
At this point, yes, or at least mention the
vm_insert_mixed-->vmf_insert_mixedconversion in the changelog.Ok, I will add this in change log and send v2.
and please try to use more columns per line of text.
E.g. from the uio: patch:
Use new return type vm_fault_t for fault handler in struct vm_operations_struct. For now, this is just documenting that the function returns a VM_ FAULT value rather than an errno. Once all inst ances are converted, vm_fault_t will become a di stinct type
Several of those lines are chopped at odd places.
Signature · 5 lines
~Randy _______________________________________________ Linux-nvdimm mailing list [email protected] https://lists.01.org/mailman/listinfo/linux-nvdimm
Quoted 4 lines · Dan Williams
Ugh, so this change to
vmf_insert_mixed()went upstream without fixing the users? This changelog is now misleading as it does not mention that is now an urgent standalone fix. On first read I assumed this was part of a wider effort for 4.18.
Why is this an urgent fix? I thought all the return type change was did something completely innocuous that would not cause any real difference.
Otherwise there are a dozen plus "fixups" to change the users that will now become urgent fixes, which I did *not* expect to be the case. (Where two are in ext2 and ext4, and where I planned to take my time and get them fixed in the next merge window, precisely becuase I did not *think* they were urgent.)
- Ted
Quoted 9 lines · Theodore Y. Ts'o
Quoted 4 lines · Dan Williams
Ugh, so this change to
vmf_insert_mixed()went upstream without fixing the users? This changelog is now misleading as it does not mention that is now an urgent standalone fix. On first read I assumed this was part of a wider effort for 4.18.Why is this an urgent fix? I thought all the return type change was did something completely innocuous that would not cause any real difference.
Keep reading the thread; Dan is mistaken.
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm
Quoted 7 lines · Matthew Wilcox
Quoted 6 lines · Theodore Y. Ts'o
Quoted 4 lines · Dan Williams
Ugh, so this change to
vmf_insert_mixed()went upstream without fixing the users? This changelog is now misleading as it does not mention that is now an urgent standalone fix. On first read I assumed this was part of a wider effort for 4.18.
Quoted 5 lines
Quoted 3 lines
Why is this an urgent fix? I thought all the return type change was did something completely innocuous that would not cause any real difference.
Keep reading the thread; Dan is mistaken.
Yes, false alarm, sorry. But we at least got a better changelog for the trouble.
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm