Skip to contentSkip to conversation

mm/hugeltb: fix renaming of PF_MEMALLOC_NOCMA to PF_MEMALLOC_PIN

PATCH In review Mike Rapoport 3 participants 4 messages Mar 31, 2021 – Apr 2, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm/hugeltb: fix renaming of PF_MEMALLOC_NOCMA to PF_MEMALLOC_PIN

From: Mike Rapoport <[email protected]>

The renaming of PF_MEMALLOC_NOCMA to PF_MEMALLOC_PIN missed one occurrence in mm/hugetlb.c which causes build error:

CC mm/hugetlb.o
mm/hugetlb.c: In function ‘dequeue_huge_page_node_exact’:
mm/hugetlb.c:1081:33: error: ‘PF_MEMALLOC_NOCMA’ undeclared (first use in this function); did you mean ‘PF_MEMALLOC_NOFS’?

  bool pin = !!(current->flags & PF_MEMALLOC_NOCMA);
                                 ^~~~~~~~~~~~~~~~~
                                 PF_MEMALLOC_NOFS

mm/hugetlb.c:1081:33: note: each undeclared identifier is reported only once for each function it appears in scripts/Makefile.build:273: recipe for target 'mm/hugetlb.o' failed
make[2]: *** [mm/hugetlb.o] Error 1

---
 mm/hugetlb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/hugetlb.c +1 -1
index a5236c2f7bb2..c22111f3da20 100644
@@ -1078,7 +1078,7 @@ static void enqueue_huge_page(struct hstate *h, struct page *page)
 static struct page *dequeue_huge_page_node_exact(struct hstate *h, int nid)
 {
 	struct page *page;
-	bool pin = !!(current->flags & PF_MEMALLOC_NOCMA);
+	bool pin = !!(current->flags & PF_MEMALLOC_PIN);
 
 	lockdep_assert_held(&hugetlb_lock);
 	list_for_each_entry(page, &h->hugepage_freelists[nid], lru) {
Signature · 1 line
2.28.0
#1 lore raw
Quoted 26 lines · Mike Rapoport

From: Mike Rapoport <[email protected]>

The renaming of PF_MEMALLOC_NOCMA to PF_MEMALLOC_PIN missed one occurrence in mm/hugetlb.c which causes build error:

CC mm/hugetlb.o
mm/hugetlb.c: In function ‘dequeue_huge_page_node_exact’:
mm/hugetlb.c:1081:33: error: ‘PF_MEMALLOC_NOCMA’ undeclared (first use in this function); did you mean ‘PF_MEMALLOC_NOFS’?

  bool pin = !!(current->flags & PF_MEMALLOC_NOCMA);
                                 ^~~~~~~~~~~~~~~~~
                                 PF_MEMALLOC_NOFS

mm/hugetlb.c:1081:33: note: each undeclared identifier is reported only once for each function it appears in scripts/Makefile.build:273: recipe for target 'mm/hugetlb.o' failed
make[2]: *** [mm/hugetlb.o] Error 1

---
 mm/hugetlb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/hugetlb.c +0 -0
index a5236c2f7bb2..c22111f3da20 100644

mm/hugetlb.c static void enqueue_huge_page(struct hstate *h, struct page *page) · line 1081

Quoted 5 lines
mm/hugetlb.c +1 -1
@@ -1078,7 +1078,7 @@ static void enqueue_huge_page(struct hstate *h, struct page *page)
 static struct page *dequeue_huge_page_node_exact(struct hstate *h, int nid)
 {
        struct page *page;
-       bool pin = !!(current->flags & PF_MEMALLOC_NOCMA);
+       bool pin = !!(current->flags & PF_MEMALLOC_PIN);

Thank you Mike!

Andrew, since "mm cma: rename PF_MEMALLOC_NOCMA to PF_MEMALLOC_PIN" is not yet in the mainline, should I send a new version of this patch so we won't have bisecting problems in the future?

Thank you,
Pasha

maintainer
#2 lore raw
Quoted 35 lines · On Thu, 1 Apr 2021 10:26:36 -0400 Pavel Tatashin <[email protected]>…
Quoted 26 lines · Mike Rapoport

From: Mike Rapoport <[email protected]>

The renaming of PF_MEMALLOC_NOCMA to PF_MEMALLOC_PIN missed one occurrence in mm/hugetlb.c which causes build error:

CC mm/hugetlb.o
mm/hugetlb.c: In function ‘dequeue_huge_page_node_exact’:
mm/hugetlb.c:1081:33: error: ‘PF_MEMALLOC_NOCMA’ undeclared (first use in this function); did you mean ‘PF_MEMALLOC_NOFS’?

  bool pin = !!(current->flags & PF_MEMALLOC_NOCMA);
                                 ^~~~~~~~~~~~~~~~~
                                 PF_MEMALLOC_NOFS

mm/hugetlb.c:1081:33: note: each undeclared identifier is reported only once for each function it appears in scripts/Makefile.build:273: recipe for target 'mm/hugetlb.o' failed
make[2]: *** [mm/hugetlb.o] Error 1

---
 mm/hugetlb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/hugetlb.c +0 -0
index a5236c2f7bb2..c22111f3da20 100644

mm/hugetlb.c static void enqueue_huge_page(struct hstate *h, struct page *page) · line 1081

Quoted 5 lines
mm/hugetlb.c +1 -1
@@ -1078,7 +1078,7 @@ static void enqueue_huge_page(struct hstate *h, struct page *page)
 static struct page *dequeue_huge_page_node_exact(struct hstate *h, int nid)
 {
        struct page *page;
-       bool pin = !!(current->flags & PF_MEMALLOC_NOCMA);
+       bool pin = !!(current->flags & PF_MEMALLOC_PIN);

Thank you Mike!

Quoted 3 lines

Andrew, since "mm cma: rename PF_MEMALLOC_NOCMA to PF_MEMALLOC_PIN" is not yet in the mainline, should I send a new version of this patch so we won't have bisecting problems in the future?

I've already added Mike's fix, as mm-cma-rename-pf_memalloc_nocma-to-pf_memalloc_pin-fix.patch. It shall fold it into mm-cma-rename-pf_memalloc_nocma-to-pf_memalloc_pin.patch prior to upstreaming, so no bisection issue.

#3 lore raw
Quoted 8 lines
Quoted 3 lines

Andrew, since "mm cma: rename PF_MEMALLOC_NOCMA to PF_MEMALLOC_PIN" is not yet in the mainline, should I send a new version of this patch so we won't have bisecting problems in the future?

I've already added Mike's fix, as mm-cma-rename-pf_memalloc_nocma-to-pf_memalloc_pin-fix.patch. It shall fold it into mm-cma-rename-pf_memalloc_nocma-to-pf_memalloc_pin.patch prior to upstreaming, so no bisection issue.

Great, thank you!

Pasha