linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: set pageblock_order to HPAGE_PMD_ORDER in case with !CONFIG_HUGETLB_PAGE but THP enabled
@ 2024-04-05 12:24 Baolin Wang
  2024-04-05 14:38 ` Vlastimil Babka
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Baolin Wang @ 2024-04-05 12:24 UTC (permalink / raw)
  To: akpm; +Cc: mgorman, vbabka, baolin.wang, linux-mm, linux-kernel

As Vlastimil suggested in previous discussion[1], it doesn't make sense to set
pageblock_order as MAX_PAGE_ORDER when hugetlbfs is not enabled and THP is enabled.
Instead, it should be set to HPAGE_PMD_ORDER.

[1] https://lore.kernel.org/all/76457ec5-d789-449b-b8ca-dcb6ceb12445@suse.cz/
Suggested-by: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
---
 include/linux/pageblock-flags.h | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/include/linux/pageblock-flags.h b/include/linux/pageblock-flags.h
index 3f2409b968ec..547e82cdc89a 100644
--- a/include/linux/pageblock-flags.h
+++ b/include/linux/pageblock-flags.h
@@ -28,7 +28,7 @@ enum pageblock_bits {
 	NR_PAGEBLOCK_BITS
 };
 
-#ifdef CONFIG_HUGETLB_PAGE
+#if defined(CONFIG_HUGETLB_PAGE)
 
 #ifdef CONFIG_HUGETLB_PAGE_SIZE_VARIABLE
 
@@ -45,7 +45,11 @@ extern unsigned int pageblock_order;
 
 #endif /* CONFIG_HUGETLB_PAGE_SIZE_VARIABLE */
 
-#else /* CONFIG_HUGETLB_PAGE */
+#elif defined(CONFIG_TRANSPARENT_HUGEPAGE)
+
+#define pageblock_order		min_t(unsigned int, HPAGE_PMD_ORDER, MAX_PAGE_ORDER)
+
+#else /* CONFIG_TRANSPARENT_HUGEPAGE */
 
 /* If huge pages are not used, group by MAX_ORDER_NR_PAGES */
 #define pageblock_order		MAX_PAGE_ORDER
-- 
2.39.3


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

* Re: [PATCH] mm: set pageblock_order to HPAGE_PMD_ORDER in case with !CONFIG_HUGETLB_PAGE but THP enabled
  2024-04-05 12:24 [PATCH] mm: set pageblock_order to HPAGE_PMD_ORDER in case with !CONFIG_HUGETLB_PAGE but THP enabled Baolin Wang
@ 2024-04-05 14:38 ` Vlastimil Babka
  2024-04-05 16:36 ` Zi Yan
  2024-04-08 18:56 ` David Hildenbrand
  2 siblings, 0 replies; 4+ messages in thread
From: Vlastimil Babka @ 2024-04-05 14:38 UTC (permalink / raw)
  To: Baolin Wang, akpm; +Cc: mgorman, linux-mm, linux-kernel

On 4/5/24 2:24 PM, Baolin Wang wrote:
> As Vlastimil suggested in previous discussion[1], it doesn't make sense to set
> pageblock_order as MAX_PAGE_ORDER when hugetlbfs is not enabled and THP is enabled.
> Instead, it should be set to HPAGE_PMD_ORDER.
> 
> [1] https://lore.kernel.org/all/76457ec5-d789-449b-b8ca-dcb6ceb12445@suse.cz/
> Suggested-by: Vlastimil Babka <vbabka@suse.cz>
> Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>

Acked-by: Vlastimil Babka <vbabka@suse.cz>

Thanks!

> ---
>  include/linux/pageblock-flags.h | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/pageblock-flags.h b/include/linux/pageblock-flags.h
> index 3f2409b968ec..547e82cdc89a 100644
> --- a/include/linux/pageblock-flags.h
> +++ b/include/linux/pageblock-flags.h
> @@ -28,7 +28,7 @@ enum pageblock_bits {
>  	NR_PAGEBLOCK_BITS
>  };
>  
> -#ifdef CONFIG_HUGETLB_PAGE
> +#if defined(CONFIG_HUGETLB_PAGE)
>  
>  #ifdef CONFIG_HUGETLB_PAGE_SIZE_VARIABLE
>  
> @@ -45,7 +45,11 @@ extern unsigned int pageblock_order;
>  
>  #endif /* CONFIG_HUGETLB_PAGE_SIZE_VARIABLE */
>  
> -#else /* CONFIG_HUGETLB_PAGE */
> +#elif defined(CONFIG_TRANSPARENT_HUGEPAGE)
> +
> +#define pageblock_order		min_t(unsigned int, HPAGE_PMD_ORDER, MAX_PAGE_ORDER)
> +
> +#else /* CONFIG_TRANSPARENT_HUGEPAGE */
>  
>  /* If huge pages are not used, group by MAX_ORDER_NR_PAGES */
>  #define pageblock_order		MAX_PAGE_ORDER


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

* Re: [PATCH] mm: set pageblock_order to HPAGE_PMD_ORDER in case with !CONFIG_HUGETLB_PAGE but THP enabled
  2024-04-05 12:24 [PATCH] mm: set pageblock_order to HPAGE_PMD_ORDER in case with !CONFIG_HUGETLB_PAGE but THP enabled Baolin Wang
  2024-04-05 14:38 ` Vlastimil Babka
@ 2024-04-05 16:36 ` Zi Yan
  2024-04-08 18:56 ` David Hildenbrand
  2 siblings, 0 replies; 4+ messages in thread
From: Zi Yan @ 2024-04-05 16:36 UTC (permalink / raw)
  To: Baolin Wang; +Cc: akpm, mgorman, vbabka, linux-mm, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 627 bytes --]

On 5 Apr 2024, at 8:24, Baolin Wang wrote:

> As Vlastimil suggested in previous discussion[1], it doesn't make sense to set
> pageblock_order as MAX_PAGE_ORDER when hugetlbfs is not enabled and THP is enabled.
> Instead, it should be set to HPAGE_PMD_ORDER.
>
> [1] https://lore.kernel.org/all/76457ec5-d789-449b-b8ca-dcb6ceb12445@suse.cz/
> Suggested-by: Vlastimil Babka <vbabka@suse.cz>
> Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
> ---
>  include/linux/pageblock-flags.h | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>
LGTM. Reviewed-by: Zi Yan <ziy@nvidia.com>

--
Best Regards,
Yan, Zi

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 854 bytes --]

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

* Re: [PATCH] mm: set pageblock_order to HPAGE_PMD_ORDER in case with !CONFIG_HUGETLB_PAGE but THP enabled
  2024-04-05 12:24 [PATCH] mm: set pageblock_order to HPAGE_PMD_ORDER in case with !CONFIG_HUGETLB_PAGE but THP enabled Baolin Wang
  2024-04-05 14:38 ` Vlastimil Babka
  2024-04-05 16:36 ` Zi Yan
@ 2024-04-08 18:56 ` David Hildenbrand
  2 siblings, 0 replies; 4+ messages in thread
From: David Hildenbrand @ 2024-04-08 18:56 UTC (permalink / raw)
  To: Baolin Wang, akpm; +Cc: mgorman, vbabka, linux-mm, linux-kernel

On 05.04.24 14:24, Baolin Wang wrote:
> As Vlastimil suggested in previous discussion[1], it doesn't make sense to set
> pageblock_order as MAX_PAGE_ORDER when hugetlbfs is not enabled and THP is enabled.
> Instead, it should be set to HPAGE_PMD_ORDER.
> 
> [1] https://lore.kernel.org/all/76457ec5-d789-449b-b8ca-dcb6ceb12445@suse.cz/
> Suggested-by: Vlastimil Babka <vbabka@suse.cz>
> Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
> ---
>   include/linux/pageblock-flags.h | 8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/pageblock-flags.h b/include/linux/pageblock-flags.h
> index 3f2409b968ec..547e82cdc89a 100644
> --- a/include/linux/pageblock-flags.h
> +++ b/include/linux/pageblock-flags.h
> @@ -28,7 +28,7 @@ enum pageblock_bits {
>   	NR_PAGEBLOCK_BITS
>   };
>   
> -#ifdef CONFIG_HUGETLB_PAGE
> +#if defined(CONFIG_HUGETLB_PAGE)
>   
>   #ifdef CONFIG_HUGETLB_PAGE_SIZE_VARIABLE
>   
> @@ -45,7 +45,11 @@ extern unsigned int pageblock_order;
>   
>   #endif /* CONFIG_HUGETLB_PAGE_SIZE_VARIABLE */
>   
> -#else /* CONFIG_HUGETLB_PAGE */
> +#elif defined(CONFIG_TRANSPARENT_HUGEPAGE)
> +
> +#define pageblock_order		min_t(unsigned int, HPAGE_PMD_ORDER, MAX_PAGE_ORDER)
> +
> +#else /* CONFIG_TRANSPARENT_HUGEPAGE */
>   
>   /* If huge pages are not used, group by MAX_ORDER_NR_PAGES */
>   #define pageblock_order		MAX_PAGE_ORDER


Acked-by: David Hildenbrand <david@redhat.com>

-- 
Cheers,

David / dhildenb


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

end of thread, other threads:[~2024-04-08 18:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-05 12:24 [PATCH] mm: set pageblock_order to HPAGE_PMD_ORDER in case with !CONFIG_HUGETLB_PAGE but THP enabled Baolin Wang
2024-04-05 14:38 ` Vlastimil Babka
2024-04-05 16:36 ` Zi Yan
2024-04-08 18:56 ` David Hildenbrand

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