The patch titled Subject: hugetlb: remove unused hstate in hugetlb_fault_mutex_hash() has been added to the -mm tree. Its filename is hugetlb-remove-unused-hstate-in-hugetlb_fault_mutex_hash.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/hugetlb-remove-unused-hstate-in-hugetlb_fault_mutex_hash.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/hugetlb-remove-unused-hstate-in-hugetlb_fault_mutex_hash.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Wei Yang <richardw.yang@xxxxxxxxxxxxxxx> Subject: hugetlb: remove unused hstate in hugetlb_fault_mutex_hash() The first parameter hstate in function hugetlb_fault_mutex_hash() is not used anymore. This patch removes it. Link: http://lkml.kernel.org/r/20191005003302.785-1-richardw.yang@xxxxxxxxxxxxxxx Signed-off-by: Wei Yang <richardw.yang@xxxxxxxxxxxxxxx> Suggested-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> Reviewed-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> Cc: Mike Kravetz <mike.kravetz@xxxxxxxxxx> Cc: Hugh Dickins <hughd@xxxxxxxxxx> Cc: Andrea Arcangeli <aarcange@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/hugetlb.c | 10 ++++------ mm/userfaultfd.c | 5 +---- 2 files changed, 5 insertions(+), 10 deletions(-) --- a/mm/hugetlb.c~hugetlb-remove-unused-hstate-in-hugetlb_fault_mutex_hash +++ a/mm/hugetlb.c @@ -3870,7 +3870,7 @@ retry: * handling userfault. Reacquire after handling * fault to make calling code simpler. */ - hash = hugetlb_fault_mutex_hash(h, mapping, idx); + hash = hugetlb_fault_mutex_hash(mapping, idx); mutex_unlock(&hugetlb_fault_mutex_table[hash]); ret = handle_userfault(&vmf, VM_UFFD_MISSING); mutex_lock(&hugetlb_fault_mutex_table[hash]); @@ -3997,8 +3997,7 @@ backout_unlocked: } #ifdef CONFIG_SMP -u32 hugetlb_fault_mutex_hash(struct hstate *h, struct address_space *mapping, - pgoff_t idx) +u32 hugetlb_fault_mutex_hash(struct address_space *mapping, pgoff_t idx) { unsigned long key[2]; u32 hash; @@ -4015,8 +4014,7 @@ u32 hugetlb_fault_mutex_hash(struct hsta * For uniprocesor systems we always use a single mutex, so just * return 0 and avoid the hashing overhead. */ -u32 hugetlb_fault_mutex_hash(struct hstate *h, struct address_space *mapping, - pgoff_t idx) +u32 hugetlb_fault_mutex_hash(struct address_space *mapping, pgoff_t idx) { return 0; } @@ -4060,7 +4058,7 @@ vm_fault_t hugetlb_fault(struct mm_struc * get spurious allocation failures if two CPUs race to instantiate * the same page in the page cache. */ - hash = hugetlb_fault_mutex_hash(h, mapping, idx); + hash = hugetlb_fault_mutex_hash(mapping, idx); mutex_lock(&hugetlb_fault_mutex_table[hash]); entry = huge_ptep_get(ptep); --- a/mm/userfaultfd.c~hugetlb-remove-unused-hstate-in-hugetlb_fault_mutex_hash +++ a/mm/userfaultfd.c @@ -184,7 +184,6 @@ static __always_inline ssize_t __mcopy_a unsigned long src_addr, dst_addr; long copied; struct page *page; - struct hstate *h; unsigned long vma_hpagesize; pgoff_t idx; u32 hash; @@ -256,8 +255,6 @@ retry: goto out_unlock; } - h = hstate_vma(dst_vma); - while (src_addr < src_start + len) { pte_t dst_pteval; @@ -269,7 +266,7 @@ retry: */ idx = linear_page_index(dst_vma, dst_addr); mapping = dst_vma->vm_file->f_mapping; - hash = hugetlb_fault_mutex_hash(h, mapping, idx); + hash = hugetlb_fault_mutex_hash(mapping, idx); mutex_lock(&hugetlb_fault_mutex_table[hash]); err = -ENOMEM; _ Patches currently in -mm which might be from richardw.yang@xxxxxxxxxxxxxxx are mm-fix-typo-in-the-comment-when-calling-function-__setpageuptodate.patch mm-mmapc-remove-a-never-trigger-warning-in-__vma_adjust.patch hugetlb-remove-unused-hstate-in-hugetlb_fault_mutex_hash.patch userfaultfd-use-vma_pagesize-for-all-huge-page-size-calculation.patch userfaultfd-remove-unnecessary-warn_on-in-__mcopy_atomic_hugetlb.patch userfaultfd-wrap-the-common-dst_vma-check-into-an-inlined-function.patch fs-userfaultfdc-simplify-the-calculation-of-new_flags.patch