Messages in this thread Patch in this message | | | Date | Wed, 8 May 2024 10:13:23 +0800 | Subject | Re: [PATCH 1/8] mm: move highest_order() and next_order() out of the THP config | From | Baolin Wang <> |
| |
On 2024/5/7 18:21, Ryan Roberts wrote: > On 06/05/2024 09:46, Baolin Wang wrote: >> Move highest_order() and next_order() out of the CONFIG_TRANSPARENT_HUGEPAGE >> macro, which can be common functions to be used. > > Sorry if I haven't kept up with the discussion, but why is this needed? I > wouldn't expect a need to iterate over orders if THP is compile-time disabled > because we will never try to allocate THP?
Cause I don't want to add some dummy functions to avoid building errors if CONFIG_TRANSPARENT_HUGEPAGE is not enabled in patch 6. Another thought is that the pagecache can also allocate a large folio even when THP is not enabled, so these helpers may be used in the future (not sure though).
Anyway, I also have no strong perference for this patch, below dummy functions can also work for me: diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h index c15bebb2cf53..7aa802ee2ce5 100644 --- a/include/linux/huge_mm.h +++ b/include/linux/huge_mm.h @@ -586,6 +586,16 @@ static inline bool thp_migration_supported(void) { return false; } + +static inline int highest_order(unsigned long orders) +{ + return 0; +} + +static inline int next_order(unsigned long *orders, int prev) +{ + return 0; +} #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
| |