linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/10] A few cleanup patches for hugetlb
@ 2022-09-01 12:00 Miaohe Lin
  2022-09-01 12:00 ` [PATCH v2 01/10] hugetlb: make hugetlb_cma_check() static Miaohe Lin
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: Miaohe Lin @ 2022-09-01 12:00 UTC (permalink / raw)
  To: akpm, mike.kravetz, songmuchun; +Cc: linux-mm, linux-kernel, linmiaohe

Hi everyone,
This series contains a few cleanup patches to use helper functions to
simplify the codes, remove unneeded nid parameter and so on. More
details can be found in the respective changelogs.
Thanks!

---
v2:
  collect Reviewed-by tags per Muchun. Thanks!
  tweak the commit log in 3/10
  change to add a comment for SetHPageVmemmapOptimized() in 8/10
  make hugetlb depends on SYSFS || SYSCTL in 10/10
---
Miaohe Lin (10):
  hugetlb: make hugetlb_cma_check() static
  hugetlb: Use helper macro SZ_1K
  hugetlb: Use LIST_HEAD() to define a list head
  hugetlb: Use sizeof() to get the array size
  hugetlb: Use helper {huge_pte|pmd}_lock()
  hugetlb: pass NULL to kobj_to_hstate() if nid is unused
  hugetlb: kill hugetlbfs_pagecache_page()
  hugetlb: add comment for subtle SetHPageVmemmapOptimized()
  hugetlb: remove meaningless BUG_ON(huge_pte_none())
  hugetlb: make hugetlb depends on SYSFS  or SYSCTL

 fs/Kconfig              |  1 +
 include/linux/hugetlb.h |  4 ---
 mm/hugetlb.c            | 55 +++++++++++++++++------------------------
 3 files changed, 24 insertions(+), 36 deletions(-)

-- 
2.23.0


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

* [PATCH v2 01/10] hugetlb: make hugetlb_cma_check() static
  2022-09-01 12:00 [PATCH v2 00/10] A few cleanup patches for hugetlb Miaohe Lin
@ 2022-09-01 12:00 ` Miaohe Lin
  2022-09-01 12:00 ` [PATCH v2 02/10] hugetlb: Use helper macro SZ_1K Miaohe Lin
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Miaohe Lin @ 2022-09-01 12:00 UTC (permalink / raw)
  To: akpm, mike.kravetz, songmuchun; +Cc: linux-mm, linux-kernel, linmiaohe

Make hugetlb_cma_check() static as it's only used inside mm/hugetlb.c.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
---
 include/linux/hugetlb.h |  4 ----
 mm/hugetlb.c            | 10 +++++++++-
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 852f911d676e..c2abbd7950de 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -1155,14 +1155,10 @@ static inline spinlock_t *huge_pte_lock(struct hstate *h,
 
 #if defined(CONFIG_HUGETLB_PAGE) && defined(CONFIG_CMA)
 extern void __init hugetlb_cma_reserve(int order);
-extern void __init hugetlb_cma_check(void);
 #else
 static inline __init void hugetlb_cma_reserve(int order)
 {
 }
-static inline __init void hugetlb_cma_check(void)
-{
-}
 #endif
 
 bool want_pmd_share(struct vm_area_struct *vma, unsigned long addr);
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index d0617d64d718..2f5008c67624 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -4058,6 +4058,14 @@ static void hugetlb_register_all_nodes(void) { }
 
 #endif
 
+#ifdef CONFIG_CMA
+static void __init hugetlb_cma_check(void);
+#else
+static inline __init void hugetlb_cma_check(void)
+{
+}
+#endif
+
 static int __init hugetlb_init(void)
 {
 	int i;
@@ -7546,7 +7554,7 @@ void __init hugetlb_cma_reserve(int order)
 		hugetlb_cma_size = 0;
 }
 
-void __init hugetlb_cma_check(void)
+static void __init hugetlb_cma_check(void)
 {
 	if (!hugetlb_cma_size || cma_reserve_called)
 		return;
-- 
2.23.0


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

* [PATCH v2 02/10] hugetlb: Use helper macro SZ_1K
  2022-09-01 12:00 [PATCH v2 00/10] A few cleanup patches for hugetlb Miaohe Lin
  2022-09-01 12:00 ` [PATCH v2 01/10] hugetlb: make hugetlb_cma_check() static Miaohe Lin
@ 2022-09-01 12:00 ` Miaohe Lin
  2022-09-01 12:00 ` [PATCH v2 03/10] hugetlb: Use LIST_HEAD() to define a list head Miaohe Lin
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Miaohe Lin @ 2022-09-01 12:00 UTC (permalink / raw)
  To: akpm, mike.kravetz, songmuchun; +Cc: linux-mm, linux-kernel, linmiaohe

Use helper macro SZ_1K to do the size conversion to make code more
consistent in this file. Minor readability improvement.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
---
 mm/hugetlb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 2f5008c67624..0d63a7fda1d9 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -4165,7 +4165,7 @@ void __init hugetlb_add_hstate(unsigned int order)
 	h->next_nid_to_alloc = first_memory_node;
 	h->next_nid_to_free = first_memory_node;
 	snprintf(h->name, HSTATE_NAME_LEN, "hugepages-%lukB",
-					huge_page_size(h)/1024);
+					huge_page_size(h)/SZ_1K);
 
 	parsed_hstate = h;
 }
-- 
2.23.0


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

* [PATCH v2 03/10] hugetlb: Use LIST_HEAD() to define a list head
  2022-09-01 12:00 [PATCH v2 00/10] A few cleanup patches for hugetlb Miaohe Lin
  2022-09-01 12:00 ` [PATCH v2 01/10] hugetlb: make hugetlb_cma_check() static Miaohe Lin
  2022-09-01 12:00 ` [PATCH v2 02/10] hugetlb: Use helper macro SZ_1K Miaohe Lin
@ 2022-09-01 12:00 ` Miaohe Lin
  2022-09-01 12:00 ` [PATCH v2 04/10] hugetlb: Use sizeof() to get the array size Miaohe Lin
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Miaohe Lin @ 2022-09-01 12:00 UTC (permalink / raw)
  To: akpm, mike.kravetz, songmuchun; +Cc: linux-mm, linux-kernel, linmiaohe

Use LIST_HEAD() directly to define a list head to simplify the code.
No functional change intended.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
---
 mm/hugetlb.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 0d63a7fda1d9..94cb81e9b4df 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -459,14 +459,12 @@ static int allocate_file_region_entries(struct resv_map *resv,
 					int regions_needed)
 	__must_hold(&resv->lock)
 {
-	struct list_head allocated_regions;
+	LIST_HEAD(allocated_regions);
 	int to_allocate = 0, i = 0;
 	struct file_region *trg = NULL, *rg = NULL;
 
 	VM_BUG_ON(regions_needed < 0);
 
-	INIT_LIST_HEAD(&allocated_regions);
-
 	/*
 	 * Check for sufficient descriptors in the cache to accommodate
 	 * the number of in progress add operations plus regions_needed.
@@ -2352,7 +2350,7 @@ struct page *alloc_huge_page_vma(struct hstate *h, struct vm_area_struct *vma,
 static int gather_surplus_pages(struct hstate *h, long delta)
 	__must_hold(&hugetlb_lock)
 {
-	struct list_head surplus_list;
+	LIST_HEAD(surplus_list);
 	struct page *page, *tmp;
 	int ret;
 	long i;
@@ -2367,7 +2365,6 @@ static int gather_surplus_pages(struct hstate *h, long delta)
 	}
 
 	allocated = 0;
-	INIT_LIST_HEAD(&surplus_list);
 
 	ret = -ENOMEM;
 retry:
-- 
2.23.0


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

* [PATCH v2 04/10] hugetlb: Use sizeof() to get the array size
  2022-09-01 12:00 [PATCH v2 00/10] A few cleanup patches for hugetlb Miaohe Lin
                   ` (2 preceding siblings ...)
  2022-09-01 12:00 ` [PATCH v2 03/10] hugetlb: Use LIST_HEAD() to define a list head Miaohe Lin
@ 2022-09-01 12:00 ` Miaohe Lin
  2022-09-01 12:00 ` [PATCH v2 05/10] hugetlb: Use helper {huge_pte|pmd}_lock() Miaohe Lin
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Miaohe Lin @ 2022-09-01 12:00 UTC (permalink / raw)
  To: akpm, mike.kravetz, songmuchun; +Cc: linux-mm, linux-kernel, linmiaohe

It's better to use sizeof() to get the array size instead of manual
calculation. Minor readability improvement.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
---
 mm/hugetlb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 94cb81e9b4df..c29b444a5515 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -4177,11 +4177,11 @@ static void __init hugepages_clear_pages_in_node(void)
 	if (!hugetlb_max_hstate) {
 		default_hstate_max_huge_pages = 0;
 		memset(default_hugepages_in_node, 0,
-			MAX_NUMNODES * sizeof(unsigned int));
+			sizeof(default_hugepages_in_node));
 	} else {
 		parsed_hstate->max_huge_pages = 0;
 		memset(parsed_hstate->max_huge_pages_node, 0,
-			MAX_NUMNODES * sizeof(unsigned int));
+			sizeof(parsed_hstate->max_huge_pages_node));
 	}
 }
 
-- 
2.23.0


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

* [PATCH v2 05/10] hugetlb: Use helper {huge_pte|pmd}_lock()
  2022-09-01 12:00 [PATCH v2 00/10] A few cleanup patches for hugetlb Miaohe Lin
                   ` (3 preceding siblings ...)
  2022-09-01 12:00 ` [PATCH v2 04/10] hugetlb: Use sizeof() to get the array size Miaohe Lin
@ 2022-09-01 12:00 ` Miaohe Lin
  2022-09-01 12:00 ` [PATCH v2 06/10] hugetlb: pass NULL to kobj_to_hstate() if nid is unused Miaohe Lin
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Miaohe Lin @ 2022-09-01 12:00 UTC (permalink / raw)
  To: akpm, mike.kravetz, songmuchun; +Cc: linux-mm, linux-kernel, linmiaohe

Use helper huge_pte_lock and pmd_lock to simplify the code. No functional
change intended.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
---
 mm/hugetlb.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index c29b444a5515..d35381de90c3 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -6094,8 +6094,7 @@ int hugetlb_mcopy_atomic_pte(struct mm_struct *dst_mm,
 		page_in_pagecache = true;
 	}
 
-	ptl = huge_pte_lockptr(h, dst_mm, dst_pte);
-	spin_lock(ptl);
+	ptl = huge_pte_lock(h, dst_mm, dst_pte);
 
 	/*
 	 * We allow to overwrite a pte marker: consider when both MISSING|WP
@@ -7176,8 +7175,7 @@ follow_huge_pmd(struct mm_struct *mm, unsigned long address,
 		return NULL;
 
 retry:
-	ptl = pmd_lockptr(mm, pmd);
-	spin_lock(ptl);
+	ptl = pmd_lock(mm, pmd);
 	/*
 	 * make sure that the address range covered by this pmd is not
 	 * unmapped from other threads.
-- 
2.23.0


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

* [PATCH v2 06/10] hugetlb: pass NULL to kobj_to_hstate() if nid is unused
  2022-09-01 12:00 [PATCH v2 00/10] A few cleanup patches for hugetlb Miaohe Lin
                   ` (4 preceding siblings ...)
  2022-09-01 12:00 ` [PATCH v2 05/10] hugetlb: Use helper {huge_pte|pmd}_lock() Miaohe Lin
@ 2022-09-01 12:00 ` Miaohe Lin
  2022-09-01 12:00 ` [PATCH v2 07/10] hugetlb: kill hugetlbfs_pagecache_page() Miaohe Lin
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Miaohe Lin @ 2022-09-01 12:00 UTC (permalink / raw)
  To: akpm, mike.kravetz, songmuchun; +Cc: linux-mm, linux-kernel, linmiaohe

We can pass NULL to kobj_to_hstate() directly when nid is unused to
simplify the code. No functional change intended.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
---
 mm/hugetlb.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index d35381de90c3..bb65b7fdca25 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -3779,8 +3779,7 @@ HSTATE_ATTR_WO(demote);
 static ssize_t demote_size_show(struct kobject *kobj,
 					struct kobj_attribute *attr, char *buf)
 {
-	int nid;
-	struct hstate *h = kobj_to_hstate(kobj, &nid);
+	struct hstate *h = kobj_to_hstate(kobj, NULL);
 	unsigned long demote_size = (PAGE_SIZE << h->demote_order) / SZ_1K;
 
 	return sysfs_emit(buf, "%lukB\n", demote_size);
@@ -3793,7 +3792,6 @@ static ssize_t demote_size_store(struct kobject *kobj,
 	struct hstate *h, *demote_hstate;
 	unsigned long demote_size;
 	unsigned int demote_order;
-	int nid;
 
 	demote_size = (unsigned long)memparse(buf, NULL);
 
@@ -3805,7 +3803,7 @@ static ssize_t demote_size_store(struct kobject *kobj,
 		return -EINVAL;
 
 	/* demote order must be smaller than hstate order */
-	h = kobj_to_hstate(kobj, &nid);
+	h = kobj_to_hstate(kobj, NULL);
 	if (demote_order >= h->order)
 		return -EINVAL;
 
-- 
2.23.0


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

* [PATCH v2 07/10] hugetlb: kill hugetlbfs_pagecache_page()
  2022-09-01 12:00 [PATCH v2 00/10] A few cleanup patches for hugetlb Miaohe Lin
                   ` (5 preceding siblings ...)
  2022-09-01 12:00 ` [PATCH v2 06/10] hugetlb: pass NULL to kobj_to_hstate() if nid is unused Miaohe Lin
@ 2022-09-01 12:00 ` Miaohe Lin
  2022-09-01 12:00 ` [PATCH v2 08/10] hugetlb: add comment for subtle SetHPageVmemmapOptimized() Miaohe Lin
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Miaohe Lin @ 2022-09-01 12:00 UTC (permalink / raw)
  To: akpm, mike.kravetz, songmuchun; +Cc: linux-mm, linux-kernel, linmiaohe

Fold hugetlbfs_pagecache_page() into its sole caller to remove some
duplicated code. No functional change intended.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
---
 mm/hugetlb.c | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index bb65b7fdca25..26bcc85715eb 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -5467,19 +5467,6 @@ static vm_fault_t hugetlb_wp(struct mm_struct *mm, struct vm_area_struct *vma,
 	return ret;
 }
 
-/* Return the pagecache page at a given address within a VMA */
-static struct page *hugetlbfs_pagecache_page(struct hstate *h,
-			struct vm_area_struct *vma, unsigned long address)
-{
-	struct address_space *mapping;
-	pgoff_t idx;
-
-	mapping = vma->vm_file->f_mapping;
-	idx = vma_hugecache_offset(h, vma, address);
-
-	return find_lock_page(mapping, idx);
-}
-
 /*
  * Return whether there is a pagecache page to back given address within VMA.
  * Caller follow_hugetlb_page() holds page_table_lock so we cannot lock_page.
@@ -5885,7 +5872,7 @@ vm_fault_t hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma,
 		/* Just decrements count, does not deallocate */
 		vma_end_reservation(h, vma, haddr);
 
-		pagecache_page = hugetlbfs_pagecache_page(h, vma, haddr);
+		pagecache_page = find_lock_page(mapping, idx);
 	}
 
 	ptl = huge_pte_lock(h, mm, ptep);
-- 
2.23.0


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

* [PATCH v2 08/10] hugetlb: add comment for subtle SetHPageVmemmapOptimized()
  2022-09-01 12:00 [PATCH v2 00/10] A few cleanup patches for hugetlb Miaohe Lin
                   ` (6 preceding siblings ...)
  2022-09-01 12:00 ` [PATCH v2 07/10] hugetlb: kill hugetlbfs_pagecache_page() Miaohe Lin
@ 2022-09-01 12:00 ` Miaohe Lin
  2022-09-01 12:00 ` [PATCH v2 09/10] hugetlb: remove meaningless BUG_ON(huge_pte_none()) Miaohe Lin
  2022-09-01 12:00 ` [PATCH v2 10/10] hugetlb: make hugetlb depends on SYSFS or SYSCTL Miaohe Lin
  9 siblings, 0 replies; 11+ messages in thread
From: Miaohe Lin @ 2022-09-01 12:00 UTC (permalink / raw)
  To: akpm, mike.kravetz, songmuchun; +Cc: linux-mm, linux-kernel, linmiaohe

The SetHPageVmemmapOptimized() called here seems unnecessary as it's
assumed to be set when calling this function. But it's indeed cleared
by above set_page_private(page, 0). Add a comment to avoid possible
future confusion.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
---
 mm/hugetlb.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 26bcc85715eb..2ba45addcdeb 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -1520,6 +1520,10 @@ static void add_hugetlb_page(struct hstate *h, struct page *page,
 
 	set_compound_page_dtor(page, HUGETLB_PAGE_DTOR);
 	set_page_private(page, 0);
+	/*
+	 * We have to set HPageVmemmapOptimized again as above
+	 * set_page_private(page, 0) cleared it.
+	 */
 	SetHPageVmemmapOptimized(page);
 
 	/*
-- 
2.23.0


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

* [PATCH v2 09/10] hugetlb: remove meaningless BUG_ON(huge_pte_none())
  2022-09-01 12:00 [PATCH v2 00/10] A few cleanup patches for hugetlb Miaohe Lin
                   ` (7 preceding siblings ...)
  2022-09-01 12:00 ` [PATCH v2 08/10] hugetlb: add comment for subtle SetHPageVmemmapOptimized() Miaohe Lin
@ 2022-09-01 12:00 ` Miaohe Lin
  2022-09-01 12:00 ` [PATCH v2 10/10] hugetlb: make hugetlb depends on SYSFS or SYSCTL Miaohe Lin
  9 siblings, 0 replies; 11+ messages in thread
From: Miaohe Lin @ 2022-09-01 12:00 UTC (permalink / raw)
  To: akpm, mike.kravetz, songmuchun; +Cc: linux-mm, linux-kernel, linmiaohe

When code reaches here, invalid page would have been accessed if huge pte
is none. So this BUG_ON(huge_pte_none()) is meaningless. Remove it.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
---
 mm/hugetlb.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 2ba45addcdeb..9178ab521c74 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -5379,7 +5379,6 @@ static vm_fault_t hugetlb_wp(struct mm_struct *mm, struct vm_area_struct *vma,
 			u32 hash;
 
 			put_page(old_page);
-			BUG_ON(huge_pte_none(pte));
 			/*
 			 * Drop hugetlb_fault_mutex and vma_lock before
 			 * unmapping.  unmapping needs to hold vma_lock
-- 
2.23.0


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

* [PATCH v2 10/10] hugetlb: make hugetlb depends on SYSFS  or SYSCTL
  2022-09-01 12:00 [PATCH v2 00/10] A few cleanup patches for hugetlb Miaohe Lin
                   ` (8 preceding siblings ...)
  2022-09-01 12:00 ` [PATCH v2 09/10] hugetlb: remove meaningless BUG_ON(huge_pte_none()) Miaohe Lin
@ 2022-09-01 12:00 ` Miaohe Lin
  9 siblings, 0 replies; 11+ messages in thread
From: Miaohe Lin @ 2022-09-01 12:00 UTC (permalink / raw)
  To: akpm, mike.kravetz, songmuchun; +Cc: linux-mm, linux-kernel, linmiaohe

If CONFIG_SYSFS and CONFIG_SYSCTL are both undefined, hugetlb doesn't work
now as there's no way to set max huge pages. Make sure at least one of the
above configs is defined to make hugetlb works as expected.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
 fs/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/Kconfig b/fs/Kconfig
index a547307c1ae8..2685a4d0d353 100644
--- a/fs/Kconfig
+++ b/fs/Kconfig
@@ -235,6 +235,7 @@ config ARCH_SUPPORTS_HUGETLBFS
 config HUGETLBFS
 	bool "HugeTLB file system support"
 	depends on X86 || IA64 || SPARC64 || ARCH_SUPPORTS_HUGETLBFS || BROKEN
+	depends on (SYSFS || SYSCTL)
 	help
 	  hugetlbfs is a filesystem backing for HugeTLB pages, based on
 	  ramfs. For architectures that support it, say Y here and read
-- 
2.23.0


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

end of thread, other threads:[~2022-09-01 12:02 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-01 12:00 [PATCH v2 00/10] A few cleanup patches for hugetlb Miaohe Lin
2022-09-01 12:00 ` [PATCH v2 01/10] hugetlb: make hugetlb_cma_check() static Miaohe Lin
2022-09-01 12:00 ` [PATCH v2 02/10] hugetlb: Use helper macro SZ_1K Miaohe Lin
2022-09-01 12:00 ` [PATCH v2 03/10] hugetlb: Use LIST_HEAD() to define a list head Miaohe Lin
2022-09-01 12:00 ` [PATCH v2 04/10] hugetlb: Use sizeof() to get the array size Miaohe Lin
2022-09-01 12:00 ` [PATCH v2 05/10] hugetlb: Use helper {huge_pte|pmd}_lock() Miaohe Lin
2022-09-01 12:00 ` [PATCH v2 06/10] hugetlb: pass NULL to kobj_to_hstate() if nid is unused Miaohe Lin
2022-09-01 12:00 ` [PATCH v2 07/10] hugetlb: kill hugetlbfs_pagecache_page() Miaohe Lin
2022-09-01 12:00 ` [PATCH v2 08/10] hugetlb: add comment for subtle SetHPageVmemmapOptimized() Miaohe Lin
2022-09-01 12:00 ` [PATCH v2 09/10] hugetlb: remove meaningless BUG_ON(huge_pte_none()) Miaohe Lin
2022-09-01 12:00 ` [PATCH v2 10/10] hugetlb: make hugetlb depends on SYSFS or SYSCTL Miaohe Lin

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