Skip to contentSkip to conversation

mm/hugetlb: Drop __unmap_hugepage_range definition from hugetlb.h

PATCH Superseded Peter Xu 4 participants 5 messages Sep 16, 2021 – Sep 17, 2021

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Peter Xu

author
#0 lore raw

PATCH 1/1 mm/hugetlb: Drop __unmap_hugepage_range definition from hugetlb.h

Drop it in the header since it's only used in hugetlb.c.

---
 include/linux/hugetlb.h | 10 ----------
 mm/hugetlb.c            |  6 +++---
 2 files changed, 3 insertions(+), 13 deletions(-)
include/linux/hugetlb.h +0 -10
index 1faebe1cd0ed..3cbf60464398 100644
@@ -143,9 +143,6 @@ void __unmap_hugepage_range_final(struct mmu_gather *tlb,
 			  struct vm_area_struct *vma,
 			  unsigned long start, unsigned long end,
 			  struct page *ref_page);
-void __unmap_hugepage_range(struct mmu_gather *tlb, struct vm_area_struct *vma,
-				unsigned long start, unsigned long end,
-				struct page *ref_page);
 void hugetlb_report_meminfo(struct seq_file *);
 int hugetlb_report_node_meminfo(char *buf, int len, int nid);
 void hugetlb_show_meminfo(void);
@@ -385,13 +382,6 @@ static inline void __unmap_hugepage_range_final(struct mmu_gather *tlb,
 	BUG();
 }
 
-static inline void __unmap_hugepage_range(struct mmu_gather *tlb,
-			struct vm_area_struct *vma, unsigned long start,
-			unsigned long end, struct page *ref_page)
-{
-	BUG();
-}
-
 static inline vm_fault_t hugetlb_fault(struct mm_struct *mm,
 			struct vm_area_struct *vma, unsigned long address,
 			unsigned int flags)
mm/hugetlb.c +3 -3
index 95dc7b83381f..d394d9545c4e 100644
@@ -4426,9 +4426,9 @@ int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src,
 	return ret;
 }
 
-void __unmap_hugepage_range(struct mmu_gather *tlb, struct vm_area_struct *vma,
-			    unsigned long start, unsigned long end,
-			    struct page *ref_page)
+static void __unmap_hugepage_range(struct mmu_gather *tlb, struct vm_area_struct *vma,
+				   unsigned long start, unsigned long end,
+				   struct page *ref_page)
 {
 	struct mm_struct *mm = vma->vm_mm;
 	unsigned long address;
Signature · 1 line
2.31.1
Reviewed-by on v1 1/1
#2 lore raw
In reply to Peter Xu
Quoted 1 line · Peter Xu

Drop it in the header since it's only used in hugetlb.c.

Hi Peter,

Tiny documentation tweak: could the above line please be changed to something approximately like this:

"Remove __unmap_hugepage_range() from the header file, because it is only used in the .c file."

?

Because: "drop it in" is so close to "drop it into" (which means, "add it to"), that it's actually reading a lot like the opposite of what you intend to say.

Quoted 7 lines
---
  include/linux/hugetlb.h | 10 ----------
  mm/hugetlb.c            |  6 +++---
  2 files changed, 3 insertions(+), 13 deletions(-)

The change itself looks accurate for the current top of tree, so:

thanks,

Signature · 2 lines
John Hubbard
NVIDIA
Quoted 47 lines
include/linux/hugetlb.h +0 -10
index 1faebe1cd0ed..3cbf60464398 100644
@@ -143,9 +143,6 @@ void __unmap_hugepage_range_final(struct mmu_gather *tlb,
  			  struct vm_area_struct *vma,
  			  unsigned long start, unsigned long end,
  			  struct page *ref_page);
-void __unmap_hugepage_range(struct mmu_gather *tlb, struct vm_area_struct *vma,
-				unsigned long start, unsigned long end,
-				struct page *ref_page);
  void hugetlb_report_meminfo(struct seq_file *);
  int hugetlb_report_node_meminfo(char *buf, int len, int nid);
  void hugetlb_show_meminfo(void);
@@ -385,13 +382,6 @@ static inline void __unmap_hugepage_range_final(struct mmu_gather *tlb,
  	BUG();
  }
 
-static inline void __unmap_hugepage_range(struct mmu_gather *tlb,
-			struct vm_area_struct *vma, unsigned long start,
-			unsigned long end, struct page *ref_page)
-{
-	BUG();
-}
-
  static inline vm_fault_t hugetlb_fault(struct mm_struct *mm,
  			struct vm_area_struct *vma, unsigned long address,
  			unsigned int flags)
mm/hugetlb.c +3 -3
index 95dc7b83381f..d394d9545c4e 100644
@@ -4426,9 +4426,9 @@ int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src,
  	return ret;
  }
 
-void __unmap_hugepage_range(struct mmu_gather *tlb, struct vm_area_struct *vma,
-			    unsigned long start, unsigned long end,
-			    struct page *ref_page)
+static void __unmap_hugepage_range(struct mmu_gather *tlb, struct vm_area_struct *vma,
+				   unsigned long start, unsigned long end,
+				   struct page *ref_page)
  {
  	struct mm_struct *mm = vma->vm_mm;
  	unsigned long address;
author
#3 lore raw
Quoted 4 lines · John Hubbard
Quoted 1 line · Peter Xu

Drop it in the header since it's only used in hugetlb.c.

Hi Peter,

Hi, John,

Quoted 8 lines

Tiny documentation tweak: could the above line please be changed to something approximately like this:

"Remove __unmap_hugepage_range() from the header file, because it is only used in the .c file."

?

Sure thing.

Quoted 14 lines

Because: "drop it in" is so close to "drop it into" (which means, "add it to"), that it's actually reading a lot like the opposite of what you intend to say.

Quoted 7 lines
---
  include/linux/hugetlb.h | 10 ----------
  mm/hugetlb.c            |  6 +++---
  2 files changed, 3 insertions(+), 13 deletions(-)
Quoted 3 lines

The change itself looks accurate for the current top of tree, so:

Thanks!

Signature · 1 line
Peter Xu