diff mbox series

[v2,2/2] mm/hugetlb: rename dissolve_free_huge_pages() to dissolve_free_hugetlb_folios()

Message ID 20240412182139.120871-2-sidhartha.kumar@oracle.com (mailing list archive)
State New
Headers show
Series [v2,1/2] mm/hugetlb: convert dissolve_free_huge_pages() to folios | expand

Commit Message

Sidhartha Kumar April 12, 2024, 6:21 p.m. UTC
dissolve_free_huge_pages() only uses folios internally, rename it to
dissolve_free_hugetlb_folios() and change the comments which reference it.

Signed-off-by: Sidhartha Kumar <sidhartha.kumar@oracle.com>
---
 include/linux/hugetlb.h | 4 ++--
 mm/hugetlb.c            | 2 +-
 mm/memory_hotplug.c     | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

Comments

Vishal Moola April 15, 2024, 6:32 p.m. UTC | #1
On Fri, Apr 12, 2024 at 11:21:39AM -0700, Sidhartha Kumar wrote:
> dissolve_free_huge_pages() only uses folios internally, rename it to
> dissolve_free_hugetlb_folios() and change the comments which reference it.
> 
> Signed-off-by: Sidhartha Kumar <sidhartha.kumar@oracle.com>
> ---
>  include/linux/hugetlb.h | 4 ++--
>  mm/hugetlb.c            | 2 +-
>  mm/memory_hotplug.c     | 4 ++--
>  3 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
> index f4191b10345d6..9ad7b97069cda 100644
> --- a/include/linux/hugetlb.h
> +++ b/include/linux/hugetlb.h
> @@ -862,7 +862,7 @@ static inline int hstate_index(struct hstate *h)
>  }
>  
>  extern int dissolve_free_hugetlb_folio(struct folio *folio);
> -extern int dissolve_free_huge_pages(unsigned long start_pfn,
> +extern int dissolve_free_hugetlb_folios(unsigned long start_pfn,
>  				    unsigned long end_pfn);

Same comment as the prior patch.

Reviewed-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Sidhartha Kumar April 15, 2024, 7:17 p.m. UTC | #2
On 4/15/24 11:32 AM, Vishal Moola wrote:
> On Fri, Apr 12, 2024 at 11:21:39AM -0700, Sidhartha Kumar wrote:
>> dissolve_free_huge_pages() only uses folios internally, rename it to
>> dissolve_free_hugetlb_folios() and change the comments which reference it.
>>
>> Signed-off-by: Sidhartha Kumar <sidhartha.kumar@oracle.com>
>> ---
>>   include/linux/hugetlb.h | 4 ++--
>>   mm/hugetlb.c            | 2 +-
>>   mm/memory_hotplug.c     | 4 ++--
>>   3 files changed, 5 insertions(+), 5 deletions(-)
>>
>> diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
>> index f4191b10345d6..9ad7b97069cda 100644
>> --- a/include/linux/hugetlb.h
>> +++ b/include/linux/hugetlb.h
>> @@ -862,7 +862,7 @@ static inline int hstate_index(struct hstate *h)
>>   }
>>   
>>   extern int dissolve_free_hugetlb_folio(struct folio *folio);
>> -extern int dissolve_free_huge_pages(unsigned long start_pfn,
>> +extern int dissolve_free_hugetlb_folios(unsigned long start_pfn,
>>   				    unsigned long end_pfn);
> 
> Same comment as the prior patch.
> 
> Reviewed-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
> 
Hi Andrew,

Could this diff also be folded in this patch to remove the extern per Vishal.

Thanks,
Sid

diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 9c96ef4d290a8..1bc93e7e315bb 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -862,7 +862,7 @@ static inline int hstate_index(struct hstate *h)
  }

  int dissolve_free_hugetlb_folio(struct folio *folio);
-extern int dissolve_free_hugetlb_folios(unsigned long start_pfn,
+int dissolve_free_hugetlb_folios(unsigned long start_pfn,
                                     unsigned long end_pfn);

  #ifdef CONFIG_MEMORY_FAILURE
Miaohe Lin April 16, 2024, 9:18 a.m. UTC | #3
On 2024/4/13 2:21, Sidhartha Kumar wrote:
> dissolve_free_huge_pages() only uses folios internally, rename it to
> dissolve_free_hugetlb_folios() and change the comments which reference it.
> 
> Signed-off-by: Sidhartha Kumar <sidhartha.kumar@oracle.com>
> ---
>  include/linux/hugetlb.h | 4 ++--
>  mm/hugetlb.c            | 2 +-
>  mm/memory_hotplug.c     | 4 ++--
>  3 files changed, 5 insertions(+), 5 deletions(-)

Reviewed-by: Miaohe Lin <linmiaohe@huawei.com>
Thanks.
.
diff mbox series

Patch

diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index f4191b10345d6..9ad7b97069cda 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -862,7 +862,7 @@  static inline int hstate_index(struct hstate *h)
 }
 
 extern int dissolve_free_hugetlb_folio(struct folio *folio);
-extern int dissolve_free_huge_pages(unsigned long start_pfn,
+extern int dissolve_free_hugetlb_folios(unsigned long start_pfn,
 				    unsigned long end_pfn);
 
 #ifdef CONFIG_MEMORY_FAILURE
@@ -1153,7 +1153,7 @@  static inline int dissolve_free_hugetlb_folio(struct folio *folio)
 	return 0;
 }
 
-static inline int dissolve_free_huge_pages(unsigned long start_pfn,
+static inline int dissolve_free_hugetlb_folios(unsigned long start_pfn,
 					   unsigned long end_pfn)
 {
 	return 0;
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index f6dd5f597df16..51665b20d90f9 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -2472,7 +2472,7 @@  int dissolve_free_hugetlb_folio(struct folio *folio)
  * Also note that if dissolve_free_hugetlb_folio() returns with an error, all
  * free hugetlb folios that were dissolved before that error are lost.
  */
-int dissolve_free_huge_pages(unsigned long start_pfn, unsigned long end_pfn)
+int dissolve_free_hugetlb_folios(unsigned long start_pfn, unsigned long end_pfn)
 {
 	unsigned long pfn;
 	struct folio *folio;
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index b79ba36e09e03..431b1f6753c0b 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -2051,11 +2051,11 @@  int __ref offline_pages(unsigned long start_pfn, unsigned long nr_pages,
 		}
 
 		/*
-		 * Dissolve free hugepages in the memory block before doing
+		 * Dissolve free hugetlb folios in the memory block before doing
 		 * offlining actually in order to make hugetlbfs's object
 		 * counting consistent.
 		 */
-		ret = dissolve_free_huge_pages(start_pfn, end_pfn);
+		ret = dissolve_free_hugetlb_folios(start_pfn, end_pfn);
 		if (ret) {
 			reason = "failure to dissolve huge pages";
 			goto failed_removal_isolated;