Re: [PATCH v5 21/21] mm/hugetlb: Disable freeing vmemmap if struct page size is not power of two

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 20.11.20 07:43, Muchun Song wrote:
We only can free the unused vmemmap to the buddy system when the
size of struct page is a power of two.

Signed-off-by: Muchun Song <songmuchun@xxxxxxxxxxxxx>
---
  mm/hugetlb_vmemmap.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/mm/hugetlb_vmemmap.c b/mm/hugetlb_vmemmap.c
index c3b3fc041903..7bb749a3eea2 100644
--- a/mm/hugetlb_vmemmap.c
+++ b/mm/hugetlb_vmemmap.c
@@ -671,7 +671,8 @@ void __init hugetlb_vmemmap_init(struct hstate *h)
  	unsigned int order = huge_page_order(h);
  	unsigned int vmemmap_pages;
- if (hugetlb_free_vmemmap_disabled) {
+	if (hugetlb_free_vmemmap_disabled ||
+	    !is_power_of_2(sizeof(struct page))) {
  		pr_info("disable free vmemmap pages for %s\n", h->name);
  		return;
  	}


This patch should be merged into the original patch that introduced vmemmap freeing.

--
Thanks,

David / dhildenb





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux