Skip to contentSkip to conversation

mm: hugetlb_vmemmap: avoid allocation failure message in alloc_vmemmap_page_list()

PATCH In review Yuan Can 2 participants 5 messages Sep 6, 2023

Subsystems (2)
lore
Share & tools
lore

Yuan Can

author
#0 lore raw

PATCH 1/1 mm: hugetlb_vmemmap: avoid allocation failure message in alloc_vmemmap_page_list()

When vmemmap pages allocation failed, the hugetlb pages fail to free, which is not an fatel error, so avoid the allocation failure report by passing __GFP_NOWARN in gfp_mask.

---
 mm/hugetlb_vmemmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/hugetlb_vmemmap.c +1 -1
index 0485e471d224..3fa6b6e2bf45 100644
@@ -386,7 +386,7 @@ static int vmemmap_remap_free(unsigned long start, unsigned long end,
 static int alloc_vmemmap_page_list(unsigned long start, unsigned long end,
 				   struct list_head *list)
 {
-	gfp_t gfp_mask = GFP_KERNEL | __GFP_RETRY_MAYFAIL;
+	gfp_t gfp_mask = GFP_KERNEL | __GFP_RETRY_MAYFAIL | __GFP_NOWARN;
 	unsigned long nr_pages = (end - start) >> PAGE_SHIFT;
 	int nid = page_to_nid((struct page *)start);
 	struct page *page, *next;
Signature · 1 line
2.17.1
maintainer
#1 lore raw
Quoted 7 lines · Yuan Can

When vmemmap pages allocation failed, the hugetlb pages fail to free, which is not an fatel error, so avoid the allocation failure report by passing __GFP_NOWARN in gfp_mask.

You have misunderstand me and Mike. We mean the memory allocation in vmemmap_remap_free() which also use __GFP_THISNODE, it has the same issue as you fixed in another thread. But the failure of memory allocation is not fetal. And it is better to remove __GFP_THISNODE as well.

Thanks.

Quoted 24 lines

---
mm/hugetlb_vmemmap.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
mm/hugetlb_vmemmap.c +1 -1
index 0485e471d224..3fa6b6e2bf45 100644
@@ -386,7 +386,7 @@ static int vmemmap_remap_free(unsigned long start, unsigned long end,
 static int alloc_vmemmap_page_list(unsigned long start, unsigned long end,
  struct list_head *list)
 {
- 	gfp_t gfp_mask = GFP_KERNEL | __GFP_RETRY_MAYFAIL;
+ 	gfp_t gfp_mask = GFP_KERNEL | __GFP_RETRY_MAYFAIL | __GFP_NOWARN;
 	unsigned long nr_pages = (end - start) >> PAGE_SHIFT;
 	int nid = page_to_nid((struct page *)start);
 	struct page *page, *next;
Signature · 1 line
2.17.1
author
#2 lore raw
Quoted 6 lines · Muchun Song
Quoted 6 lines · Yuan Can

When vmemmap pages allocation failed, the hugetlb pages fail to free, which is not an fatel error, so avoid the allocation failure report by passing __GFP_NOWARN in gfp_mask.

Quoted 7 lines

You have misunderstand me and Mike. We mean the memory allocation in vmemmap_remap_free() which also use __GFP_THISNODE, it has the same issue as you fixed in another thread. But the failure of memory allocation is not fetal. And it is better to remove __GFP_THISNODE as well.

Thanks.

Ok, sorry about this, I will send another patch to remove __GFP_THISNODE in

vmemmap_remap_free, and I would like to know is it ok to add __GFP_NOWARN in

alloc_vmemmap_page_list()?

Thanks.

Quoted 23 lines
Quoted 23 lines

---
mm/hugetlb_vmemmap.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
mm/hugetlb_vmemmap.c +1 -1
index 0485e471d224..3fa6b6e2bf45 100644
@@ -386,7 +386,7 @@ static int vmemmap_remap_free(unsigned long start, unsigned long end,
 static int alloc_vmemmap_page_list(unsigned long start, unsigned long end,
   struct list_head *list)
 {
- 	gfp_t gfp_mask = GFP_KERNEL | __GFP_RETRY_MAYFAIL;
+ 	gfp_t gfp_mask = GFP_KERNEL | __GFP_RETRY_MAYFAIL | __GFP_NOWARN;
 	unsigned long nr_pages = (end - start) >> PAGE_SHIFT;
 	int nid = page_to_nid((struct page *)start);
 	struct page *page, *next;
Signature · 1 line
2.17.1
Signature · 2 lines
Best regards,
Yuan Can
maintainer
#3 lore raw
Quoted 20 lines · Yuan Can
Quoted 14 lines · Muchun Song
Quoted 8 lines · Yuan Can

When vmemmap pages allocation failed, the hugetlb pages fail to free, which is not an fatel error, so avoid the allocation failure report by passing __GFP_NOWARN in gfp_mask.

You have misunderstand me and Mike. We mean the memory allocation in vmemmap_remap_free() which also use __GFP_THISNODE, it has the same issue as you fixed in another thread. But the failure of memory allocation is not fetal. And it is better to remove __GFP_THISNODE as well.

Quoted 5 lines
Quoted 2 lines

Thanks.

Ok, sorry about this, I will send another patch to remove __GFP_THISNODE in vmemmap_remap_free, and I would like to know is it ok to add __GFP_NOWARN in alloc_vmemmap_page_list()?

Do not do this. We need a warning here.

Thanks.

Quoted 33 lines

Thanks.

Quoted 26 lines
Quoted 25 lines

---
mm/hugetlb_vmemmap.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
mm/hugetlb_vmemmap.c +1 -1
index 0485e471d224..3fa6b6e2bf45 100644
@@ -386,7 +386,7 @@ static int vmemmap_remap_free(unsigned long start, unsigned long end,
 static int alloc_vmemmap_page_list(unsigned long start, unsigned long end,
 struct list_head *list)
 {
- gfp_t gfp_mask = GFP_KERNEL | __GFP_RETRY_MAYFAIL;
+ gfp_t gfp_mask = GFP_KERNEL | __GFP_RETRY_MAYFAIL | __GFP_NOWARN;
 unsigned long nr_pages = (end - start) >> PAGE_SHIFT;
 int nid = page_to_nid((struct page *)start);
 struct page *page, *next;
Signature · 1 line
2.17.1
Signature · 2 lines
Best regards,
Yuan Can
author
#4 lore raw
Quoted 18 lines · Muchun Song
Quoted 18 lines · Yuan Can
Quoted 13 lines · Muchun Song
Quoted 7 lines · Yuan Can

When vmemmap pages allocation failed, the hugetlb pages fail to free, which is not an fatel error, so avoid the allocation failure report by passing __GFP_NOWARN in gfp_mask.

You have misunderstand me and Mike. We mean the memory allocation in vmemmap_remap_free() which also use __GFP_THISNODE, it has the same issue as you fixed in another thread. But the failure of memory allocation is not fetal. And it is better to remove __GFP_THISNODE as well.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

Thanks.

Ok, sorry about this, I will send another patch to remove __GFP_THISNODE in vmemmap_remap_free, and I would like to know is it ok to add __GFP_NOWARN in alloc_vmemmap_page_list()?

Do not do this. We need a warning here.

Thanks.

Ok, thanks for the reply.

Signature · 2 lines
Best regards,
Yuan Can