[lkml]   [2018]   [Jul]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
SubjectRe: [PATCH v3] mm: Change return type int to vm_fault_t for fault handlers
On Mon, 4 Jun 2018 22:47:27 +0530 Souptick Joarder <> wrote:

> Use new return type vm_fault_t for fault handler. For
> now, this is just documenting that the function returns
> a VM_FAULT value rather than an errno. Once all instances
> are converted, vm_fault_t will become a distinct type.
> Ref-> commit 1c8f422059ae ("mm: change return type to vm_fault_t")
> The aim is to change the return type of finish_fault()
> and handle_mm_fault() to vm_fault_t type. As part of
> that clean up return type of all other recursively called
> functions have been changed to vm_fault_t type.
> The places from where handle_mm_fault() is getting invoked
> will be change to vm_fault_t type but in a separate patch.
> vmf_error() is the newly introduce inline function
> in 4.17-rc6.

Looks OK.

For some reason the shmem.c changes are already present.

One incidental fixup:

From: Andrew Morton <>
Subject: mm-change-return-type-int-to-vm_fault_t-for-fault-handlers-fix

don't shadow outer local `ret' in __do_huge_pmd_anonymous_page()

--- a/mm/huge_memory.c~mm-change-return-type-int-to-vm_fault_t-for-fault-handlers-fix
+++ a/mm/huge_memory.c
@@ -584,15 +584,15 @@ static vm_fault_t __do_huge_pmd_anonymou

/* Deliver the page fault to userland */
if (userfaultfd_missing(vma)) {
- vm_fault_t ret;
+ vm_fault_t ret2;

mem_cgroup_cancel_charge(page, memcg, true);
pte_free(vma->vm_mm, pgtable);
- ret = handle_userfault(vmf, VM_UFFD_MISSING);
- return ret;
+ ret2 = handle_userfault(vmf, VM_UFFD_MISSING);
+ return ret2;

entry = mk_huge_pmd(page, vma->vm_page_prot);
 \ /
  Last update: 2018-07-25 00:37    [W:0.061 / U:8.948 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site