linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/hugetlb: Drop __unmap_hugepage_range definition from hugetlb.h
@ 2021-09-16 21:28 Peter Xu
  2021-09-16 22:41 ` Mike Kravetz
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Peter Xu @ 2021-09-16 21:28 UTC (permalink / raw)
  To: linux-kernel, linux-mm; +Cc: peterx, Andrew Morton, Mike Kravetz

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

Suggested-by: Mike Kravetz <mike.kravetz@oracle.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
---
 include/linux/hugetlb.h | 10 ----------
 mm/hugetlb.c            |  6 +++---
 2 files changed, 3 insertions(+), 13 deletions(-)

diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 1faebe1cd0ed..3cbf60464398 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -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)
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 95dc7b83381f..d394d9545c4e 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -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;
-- 
2.31.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] mm/hugetlb: Drop __unmap_hugepage_range definition from hugetlb.h
  2021-09-16 21:28 [PATCH] mm/hugetlb: Drop __unmap_hugepage_range definition from hugetlb.h Peter Xu
@ 2021-09-16 22:41 ` Mike Kravetz
  2021-09-16 22:57 ` John Hubbard
  2021-09-17  3:27 ` Muchun Song
  2 siblings, 0 replies; 5+ messages in thread
From: Mike Kravetz @ 2021-09-16 22:41 UTC (permalink / raw)
  To: Peter Xu, linux-kernel, linux-mm; +Cc: Andrew Morton

On 9/16/21 2:28 PM, Peter Xu wrote:
> Drop it in the header since it's only used in hugetlb.c.
> 
> Suggested-by: Mike Kravetz <mike.kravetz@oracle.com>
> Signed-off-by: Peter Xu <peterx@redhat.com>
> ---
>  include/linux/hugetlb.h | 10 ----------
>  mm/hugetlb.c            |  6 +++---
>  2 files changed, 3 insertions(+), 13 deletions(-)

Thanks Peter!

Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
-- 
Mike Kravetz


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mm/hugetlb: Drop __unmap_hugepage_range definition from hugetlb.h
  2021-09-16 21:28 [PATCH] mm/hugetlb: Drop __unmap_hugepage_range definition from hugetlb.h Peter Xu
  2021-09-16 22:41 ` Mike Kravetz
@ 2021-09-16 22:57 ` John Hubbard
  2021-09-17  0:03   ` Peter Xu
  2021-09-17  3:27 ` Muchun Song
  2 siblings, 1 reply; 5+ messages in thread
From: John Hubbard @ 2021-09-16 22:57 UTC (permalink / raw)
  To: Peter Xu, linux-kernel, linux-mm; +Cc: Andrew Morton, Mike Kravetz

On 9/16/21 14:28, Peter Xu wrote:
> 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.

> 
> Suggested-by: Mike Kravetz <mike.kravetz@oracle.com>
> Signed-off-by: Peter Xu <peterx@redhat.com>
> ---
>   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:

Reviewed-by: John Hubbard <jhubbard@nvidia.com>


thanks,
-- 
John Hubbard
NVIDIA

> 
> diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
> index 1faebe1cd0ed..3cbf60464398 100644
> --- a/include/linux/hugetlb.h
> +++ b/include/linux/hugetlb.h
> @@ -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)
> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> index 95dc7b83381f..d394d9545c4e 100644
> --- a/mm/hugetlb.c
> +++ b/mm/hugetlb.c
> @@ -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;
> 




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mm/hugetlb: Drop __unmap_hugepage_range definition from hugetlb.h
  2021-09-16 22:57 ` John Hubbard
@ 2021-09-17  0:03   ` Peter Xu
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Xu @ 2021-09-17  0:03 UTC (permalink / raw)
  To: John Hubbard; +Cc: linux-kernel, linux-mm, Andrew Morton, Mike Kravetz

On Thu, Sep 16, 2021 at 03:57:38PM -0700, John Hubbard wrote:
> On 9/16/21 14:28, Peter Xu wrote:
> > Drop it in the header since it's only used in hugetlb.c.
> 
> Hi Peter,

Hi, John,

> 
> 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.

> 
> 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.
> 
> > 
> > Suggested-by: Mike Kravetz <mike.kravetz@oracle.com>
> > Signed-off-by: Peter Xu <peterx@redhat.com>
> > ---
> >   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:
> 
> Reviewed-by: John Hubbard <jhubbard@nvidia.com>

Thanks!

-- 
Peter Xu



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mm/hugetlb: Drop __unmap_hugepage_range definition from hugetlb.h
  2021-09-16 21:28 [PATCH] mm/hugetlb: Drop __unmap_hugepage_range definition from hugetlb.h Peter Xu
  2021-09-16 22:41 ` Mike Kravetz
  2021-09-16 22:57 ` John Hubbard
@ 2021-09-17  3:27 ` Muchun Song
  2 siblings, 0 replies; 5+ messages in thread
From: Muchun Song @ 2021-09-17  3:27 UTC (permalink / raw)
  To: Peter Xu; +Cc: LKML, Linux Memory Management List, Andrew Morton, Mike Kravetz

On Fri, Sep 17, 2021 at 5:28 AM Peter Xu <peterx@redhat.com> wrote:
>
> Drop it in the header since it's only used in hugetlb.c.
>
> Suggested-by: Mike Kravetz <mike.kravetz@oracle.com>
> Signed-off-by: Peter Xu <peterx@redhat.com>

Reviewed-by: Muchun Song <songmuchun@bytedance.com>

Thanks.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-09-17  3:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-16 21:28 [PATCH] mm/hugetlb: Drop __unmap_hugepage_range definition from hugetlb.h Peter Xu
2021-09-16 22:41 ` Mike Kravetz
2021-09-16 22:57 ` John Hubbard
2021-09-17  0:03   ` Peter Xu
2021-09-17  3:27 ` Muchun Song

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).