Skip to contentSkip to conversation

linux-next: build failure after merge of the mm tree

PATCH Stephen Rothwell 4 participants 7 messages May 12, 2022 – May 13, 2022

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

Hi all,

After merging the mm tree, today's linux-next build (arm64 defconfig) failed like this:

arch/arm64/mm/hugetlbpage.c: In function 'huge_ptep_clear_flush':
arch/arm64/mm/hugetlbpage.c:493:16: error: implicit declaration of function 'get_clear_flush'; did you mean 'ptep_clear_flush'? [-Werror=implicit-function-declaration]

  493 |         return get_clear_flush(vma->vm_mm, addr, ptep, pgsize, ncontig);
      |                ^~~~~~~~~~~~~~~
      |                ptep_clear_flush
arch/arm64/mm/hugetlbpage.c:493:16: error: incompatible types when returning type 'int' but 'pte_t' was expected
  493 |         return get_clear_flush(vma->vm_mm, addr, ptep, pgsize, ncontig);
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/arm64/mm/hugetlbpage.c:494:1: error: control reaches end of non-void function [-Werror=return-type]
  494 | }
      | ^

Caused by commit

00df1f1a133b ("mm: change huge_ptep_clear_flush() to return the original pte")

interacting with commit

fb396bb459c1 ("arm64/hugetlb: Drop TLB flush from get_clear_flush()")

I have applied the following merg fix patch for today.

From: Stephen Rothwell <[email protected]>
Date: Thu, 12 May 2022 19:33:11 +1000
Subject: [PATCH] fixup for "mm: change huge_ptep_clear_flush() to return the original pte"

It interacts with commit

fb396bb459c1 ("arm64/hugetlb: Drop TLB flush from get_clear_flush()")

from the arm64 tree

---
 arch/arm64/mm/hugetlbpage.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/mm/hugetlbpage.c +1 -1
index 5bdf913dedc7..30f5b76aabe9 100644
@@ -490,7 +490,7 @@ pte_t huge_ptep_clear_flush(struct vm_area_struct *vma,
 		return ptep_clear_flush(vma, addr, ptep);
 
 	ncontig = find_num_contig(vma->vm_mm, addr, ptep, &pgsize);
-	return get_clear_flush(vma->vm_mm, addr, ptep, pgsize, ncontig);
+	return get_clear_contig(vma->vm_mm, addr, ptep, pgsize, ncontig);
 }
 
 static int __init hugetlbpage_init(void)
Signature · 5 lines
2.35.1

-- 
Cheers,
Stephen Rothwell
Reviewed-by
#1 lore raw
Quoted 31 lines · Stephen Rothwell

Hi all,

After merging the mm tree, today's linux-next build (arm64 defconfig) failed like this:

arch/arm64/mm/hugetlbpage.c: In function 'huge_ptep_clear_flush':
arch/arm64/mm/hugetlbpage.c:493:16: error: implicit declaration of function 'get_clear_flush'; did you mean 'ptep_clear_flush'? [-Werror=implicit-function-declaration]

   493 |         return get_clear_flush(vma->vm_mm, addr, ptep, pgsize, ncontig);
       |                ^~~~~~~~~~~~~~~
       |                ptep_clear_flush
arch/arm64/mm/hugetlbpage.c:493:16: error: incompatible types when returning type 'int' but 'pte_t' was expected
   493 |         return get_clear_flush(vma->vm_mm, addr, ptep, pgsize, ncontig);
       |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/arm64/mm/hugetlbpage.c:494:1: error: control reaches end of non-void function [-Werror=return-type]
   494 | }
       | ^

Caused by commit

00df1f1a133b ("mm: change huge_ptep_clear_flush() to return the original pte")

interacting with commit

   fb396bb459c1 ("arm64/hugetlb: Drop TLB flush from get_clear_flush()")

I have applied the following merg fix patch for today.

From: Stephen Rothwell <[email protected]>
Date: Thu, 12 May 2022 19:33:11 +1000
Subject: [PATCH] fixup for "mm: change huge_ptep_clear_flush() to return the original pte"

Quoted 7 lines

It interacts with commit

   fb396bb459c1 ("arm64/hugetlb: Drop TLB flush from get_clear_flush()")

from the arm64 tree

Thanks. Looks good to me.

Quoted 17 lines
---
  arch/arm64/mm/hugetlbpage.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/mm/hugetlbpage.c +1 -1
index 5bdf913dedc7..30f5b76aabe9 100644
@@ -490,7 +490,7 @@ pte_t huge_ptep_clear_flush(struct vm_area_struct *vma,
  		return ptep_clear_flush(vma, addr, ptep);
 
  	ncontig = find_num_contig(vma->vm_mm, addr, ptep, &pgsize);
-	return get_clear_flush(vma->vm_mm, addr, ptep, pgsize, ncontig);
+	return get_clear_contig(vma->vm_mm, addr, ptep, pgsize, ncontig);
  }
 
  static int __init hugetlbpage_init(void)
maintainer
#2 lore raw
In reply to Stephen Rothwell
Quoted 45 lines · Stephen Rothwell

After merging the mm tree, today's linux-next build (arm64 defconfig) failed like this:

arch/arm64/mm/hugetlbpage.c: In function 'huge_ptep_clear_flush':
arch/arm64/mm/hugetlbpage.c:493:16: error: implicit declaration of function 'get_clear_flush'; did you mean 'ptep_clear_flush'? [-Werror=implicit-function-declaration]

  493 |         return get_clear_flush(vma->vm_mm, addr, ptep, pgsize, ncontig);
      |                ^~~~~~~~~~~~~~~
      |                ptep_clear_flush
arch/arm64/mm/hugetlbpage.c:493:16: error: incompatible types when returning type 'int' but 'pte_t' was expected
  493 |         return get_clear_flush(vma->vm_mm, addr, ptep, pgsize, ncontig);
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/arm64/mm/hugetlbpage.c:494:1: error: control reaches end of non-void function [-Werror=return-type]
  494 | }
      | ^

Caused by commit

00df1f1a133b ("mm: change huge_ptep_clear_flush() to return the original pte")

interacting with commit

fb396bb459c1 ("arm64/hugetlb: Drop TLB flush from get_clear_flush()")

I have applied the following merg fix patch for today.

From: Stephen Rothwell <[email protected]>
Date: Thu, 12 May 2022 19:33:11 +1000
Subject: [PATCH] fixup for "mm: change huge_ptep_clear_flush() to return the original pte"

It interacts with commit

fb396bb459c1 ("arm64/hugetlb: Drop TLB flush from get_clear_flush()")

from the arm64 tree

---
 arch/arm64/mm/hugetlbpage.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/mm/hugetlbpage.c +0 -0
index 5bdf913dedc7..30f5b76aabe9 100644

arch/arm64/mm/hugetlbpage.c pte_t huge_ptep_clear_flush(struct vm_area_struct *vma, · line 494

Quoted 6 lines
arch/arm64/mm/hugetlbpage.c +1 -1
@@ -490,7 +490,7 @@ pte_t huge_ptep_clear_flush(struct vm_area_struct *vma,
 		return ptep_clear_flush(vma, addr, ptep);
 
 	ncontig = find_num_contig(vma->vm_mm, addr, ptep, &pgsize);
-	return get_clear_flush(vma->vm_mm, addr, ptep, pgsize, ncontig);
+	return get_clear_contig(vma->vm_mm, addr, ptep, pgsize, ncontig);
 }

Note that after the arm64 commit, get_clear_contig() no longer flushes the TLB. So maybe something like:

arch/arm64/mm/hugetlbpage.c +4 -1
index 30f5b76aabe9..9a999550df8e 100644
@@ -485,12 +485,15 @@ pte_t huge_ptep_clear_flush(struct vm_area_struct *vma,
 {
 	size_t pgsize;
 	int ncontig;
+	pte_t orig_pte;
 
 	if (!pte_cont(READ_ONCE(*ptep)))
 		return ptep_clear_flush(vma, addr, ptep);
 
 	ncontig = find_num_contig(vma->vm_mm, addr, ptep, &pgsize);
-	return get_clear_contig(vma->vm_mm, addr, ptep, pgsize, ncontig);
+	orig_pte = get_clear_contig(vma->vm_mm, addr, ptep, pgsize, ncontig);
+	flush_tlb_range(vma, addr, addr + pgsize * ncontig);
+	return orig_pte;
 }
 
 static int __init hugetlbpage_init(void)
Signature · 1 line
Catalin
#3 lore raw
Quoted 65 lines · Catalin Marinas
Quoted 45 lines · Stephen Rothwell

After merging the mm tree, today's linux-next build (arm64 defconfig) failed like this:

arch/arm64/mm/hugetlbpage.c: In function 'huge_ptep_clear_flush':
arch/arm64/mm/hugetlbpage.c:493:16: error: implicit declaration of function 'get_clear_flush'; did you mean 'ptep_clear_flush'? [-Werror=implicit-function-declaration]

   493 |         return get_clear_flush(vma->vm_mm, addr, ptep, pgsize, ncontig);
       |                ^~~~~~~~~~~~~~~
       |                ptep_clear_flush
arch/arm64/mm/hugetlbpage.c:493:16: error: incompatible types when returning type 'int' but 'pte_t' was expected
   493 |         return get_clear_flush(vma->vm_mm, addr, ptep, pgsize, ncontig);
       |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/arm64/mm/hugetlbpage.c:494:1: error: control reaches end of non-void function [-Werror=return-type]
   494 | }
       | ^

Caused by commit

00df1f1a133b ("mm: change huge_ptep_clear_flush() to return the original pte")

interacting with commit

   fb396bb459c1 ("arm64/hugetlb: Drop TLB flush from get_clear_flush()")

I have applied the following merg fix patch for today.

From: Stephen Rothwell <[email protected]>
Date: Thu, 12 May 2022 19:33:11 +1000
Subject: [PATCH] fixup for "mm: change huge_ptep_clear_flush() to return the original pte"

It interacts with commit

   fb396bb459c1 ("arm64/hugetlb: Drop TLB flush from get_clear_flush()")

from the arm64 tree

---
  arch/arm64/mm/hugetlbpage.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/mm/hugetlbpage.c +0 -0
index 5bdf913dedc7..30f5b76aabe9 100644

arch/arm64/mm/hugetlbpage.c pte_t huge_ptep_clear_flush(struct vm_area_struct *vma, · line 494

Quoted 6 lines
arch/arm64/mm/hugetlbpage.c +1 -1
@@ -490,7 +490,7 @@ pte_t huge_ptep_clear_flush(struct vm_area_struct *vma,
  		return ptep_clear_flush(vma, addr, ptep);
 
  	ncontig = find_num_contig(vma->vm_mm, addr, ptep, &pgsize);
-	return get_clear_flush(vma->vm_mm, addr, ptep, pgsize, ncontig);
+	return get_clear_contig(vma->vm_mm, addr, ptep, pgsize, ncontig);
  }

Note that after the arm64 commit, get_clear_contig() no longer flushes the TLB. So maybe something like:

arch/arm64/mm/hugetlbpage.c +1 -0
index 30f5b76aabe9..9a999550df8e 100644
@@ -485,12 +485,15 @@ pte_t huge_ptep_clear_flush(struct vm_area_struct *vma,
  {
  	size_t pgsize;
  	int ncontig;
+	pte_t orig_pte;

arch/arm64/mm/hugetlbpage.c pte_t huge_ptep_clear_flush(struct vm_area_struct *vma, · line 497

Quoted 10 lines
arch/arm64/mm/hugetlbpage.c +3 -1
 
  	if (!pte_cont(READ_ONCE(*ptep)))
  		return ptep_clear_flush(vma, addr, ptep);
 
  	ncontig = find_num_contig(vma->vm_mm, addr, ptep, &pgsize);
-	return get_clear_contig(vma->vm_mm, addr, ptep, pgsize, ncontig);
+	orig_pte = get_clear_contig(vma->vm_mm, addr, ptep, pgsize, ncontig);
+	flush_tlb_range(vma, addr, addr + pgsize * ncontig);
+	return orig_pte;
  }

Yes, after checking this fb396bb459c1 ("arm64/hugetlb: Drop TLB flush from get_clear_flush()"), I also realized it will miss TLB flush.

So I am not sure I need send a incremental patch to fix this issue? Or resend my patch set [1] with rebasing on the arm64 changes?

Catalin and Andrew, how do you think? Thanks.

[1] https://lore.kernel.org/all/[email protected]/

maintainer
#4 lore raw
Quoted 79 lines · Baolin Wang
Quoted 64 lines · Catalin Marinas
Quoted 45 lines · Stephen Rothwell

After merging the mm tree, today's linux-next build (arm64 defconfig) failed like this:

arch/arm64/mm/hugetlbpage.c: In function 'huge_ptep_clear_flush':
arch/arm64/mm/hugetlbpage.c:493:16: error: implicit declaration of function 'get_clear_flush'; did you mean 'ptep_clear_flush'? [-Werror=implicit-function-declaration]

   493 |         return get_clear_flush(vma->vm_mm, addr, ptep, pgsize, ncontig);
       |                ^~~~~~~~~~~~~~~
       |                ptep_clear_flush
arch/arm64/mm/hugetlbpage.c:493:16: error: incompatible types when returning type 'int' but 'pte_t' was expected
   493 |         return get_clear_flush(vma->vm_mm, addr, ptep, pgsize, ncontig);
       |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/arm64/mm/hugetlbpage.c:494:1: error: control reaches end of non-void function [-Werror=return-type]
   494 | }
       | ^

Caused by commit

00df1f1a133b ("mm: change huge_ptep_clear_flush() to return the original pte")

interacting with commit

   fb396bb459c1 ("arm64/hugetlb: Drop TLB flush from get_clear_flush()")

I have applied the following merg fix patch for today.

From: Stephen Rothwell <[email protected]>
Date: Thu, 12 May 2022 19:33:11 +1000
Subject: [PATCH] fixup for "mm: change huge_ptep_clear_flush() to return the original pte"

It interacts with commit

   fb396bb459c1 ("arm64/hugetlb: Drop TLB flush from get_clear_flush()")

from the arm64 tree

---
  arch/arm64/mm/hugetlbpage.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/mm/hugetlbpage.c +0 -0
index 5bdf913dedc7..30f5b76aabe9 100644

arch/arm64/mm/hugetlbpage.c pte_t huge_ptep_clear_flush(struct vm_area_struct *vma, · line 493

Quoted 5 lines
arch/arm64/mm/hugetlbpage.c +1 -1
@@ -490,7 +490,7 @@ pte_t huge_ptep_clear_flush(struct vm_area_struct *vma,
  		return ptep_clear_flush(vma, addr, ptep);
  	ncontig = find_num_contig(vma->vm_mm, addr, ptep, &pgsize);
-	return get_clear_flush(vma->vm_mm, addr, ptep, pgsize, ncontig);
+	return get_clear_contig(vma->vm_mm, addr, ptep, pgsize, ncontig);
  }

Note that after the arm64 commit, get_clear_contig() no longer flushes the TLB. So maybe something like:

arch/arm64/mm/hugetlbpage.c +1 -0
index 30f5b76aabe9..9a999550df8e 100644
@@ -485,12 +485,15 @@ pte_t huge_ptep_clear_flush(struct vm_area_struct *vma,
  {
  	size_t pgsize;
  	int ncontig;
+	pte_t orig_pte;

arch/arm64/mm/hugetlbpage.c pte_t huge_ptep_clear_flush(struct vm_area_struct *vma, · line 497

Quoted 10 lines
arch/arm64/mm/hugetlbpage.c +3 -1
 
  	if (!pte_cont(READ_ONCE(*ptep)))
  		return ptep_clear_flush(vma, addr, ptep);
 
  	ncontig = find_num_contig(vma->vm_mm, addr, ptep, &pgsize);
-	return get_clear_contig(vma->vm_mm, addr, ptep, pgsize, ncontig);
+	orig_pte = get_clear_contig(vma->vm_mm, addr, ptep, pgsize, ncontig);
+	flush_tlb_range(vma, addr, addr + pgsize * ncontig);
+	return orig_pte;
  }

Yes, after checking this fb396bb459c1 ("arm64/hugetlb: Drop TLB flush from get_clear_flush()"), I also realized it will miss TLB flush.

Quoted 4 lines

So I am not sure I need send a incremental patch to fix this issue? Or resend my patch set [1] with rebasing on the arm64 changes?

Catalin and Andrew, how do you think? Thanks.

Andrew folding the diff in is fine by me. I presume the mm patches are applied on top of the rest of linux-next (and the arm64 commits).

Signature · 1 line
Catalin
#5 lore raw
Quoted 9 lines · On Thu, 12 May 2022 14:28:18 +0100 Catalin Marinas <[email protected]>…
Quoted 9 lines

arch/arm64/mm/hugetlbpage.c pte_t huge_ptep_clear_flush(struct vm_area_struct *vma, · line 497

Quoted 5 lines
arch/arm64/mm/hugetlbpage.c +3 -1
-	return get_clear_contig(vma->vm_mm, addr, ptep, pgsize, ncontig);
+	orig_pte = get_clear_contig(vma->vm_mm, addr, ptep, pgsize, ncontig);
+	flush_tlb_range(vma, addr, addr + pgsize * ncontig);
+	return orig_pte;
  }

Yes, after checking this fb396bb459c1 ("arm64/hugetlb: Drop TLB flush from get_clear_flush()"), I also realized it will miss TLB flush.

Quoted 7 lines
Quoted 4 lines

So I am not sure I need send a incremental patch to fix this issue? Or resend my patch set [1] with rebasing on the arm64 changes?

Catalin and Andrew, how do you think? Thanks.

Andrew folding the diff in is fine by me. I presume the mm patches are applied on top of the rest of linux-next (and the arm64 commits).

No, the mm patches are based on
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm master branch, which is -rc4 or thereabouts.

So one of us needs to ensure that Linus gets that patch after the second of us merges up. I can't test it so I nominate you ;) Against linux-next or the mm-everything branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm?

#6 lore raw
In reply to Catalin Marinas

Hi Catalin,

Quoted 15 lines · On Thu, 12 May 2022 12:07:41 +0100 Catalin Marinas <[email protected]>…

Note that after the arm64 commit, get_clear_contig() no longer flushes the TLB. So maybe something like:

arch/arm64/mm/hugetlbpage.c +1 -0
index 30f5b76aabe9..9a999550df8e 100644
@@ -485,12 +485,15 @@ pte_t huge_ptep_clear_flush(struct vm_area_struct *vma,
 {
 	size_t pgsize;
 	int ncontig;
+	pte_t orig_pte;
 
 	if (!pte_cont(READ_ONCE(*ptep)))

arch/arm64/mm/hugetlbpage.c pte_t huge_ptep_clear_flush(struct vm_area_struct *vma, · line 499

Quoted 10 lines
arch/arm64/mm/hugetlbpage.c +3 -1
 		return ptep_clear_flush(vma, addr, ptep);
 
 	ncontig = find_num_contig(vma->vm_mm, addr, ptep, &pgsize);
-	return get_clear_contig(vma->vm_mm, addr, ptep, pgsize, ncontig);
+	orig_pte = get_clear_contig(vma->vm_mm, addr, ptep, pgsize, ncontig);
+	flush_tlb_range(vma, addr, addr + pgsize * ncontig);
+	return orig_pte;
 }
 
 static int __init hugetlbpage_init(void)

I have modified my merge resolution patch to as in the above so it looks like this now:

From: Stephen Rothwell <[email protected]>
Date: Fri, 13 May 2022 17:08:07 +1000
Subject: [PATCH] fixup for "mm: change huge_ptep_clear_flush() to return the original pte"

It interacts with commit

fb396bb459c1 ("arm64/hugetlb: Drop TLB flush from get_clear_flush()")

from the arm64 tree

---
 arch/arm64/mm/hugetlbpage.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
arch/arm64/mm/hugetlbpage.c +4 -1
index 5bdf913dedc7..10b4a19ed6a2 100644
@@ -485,12 +485,15 @@ pte_t huge_ptep_clear_flush(struct vm_area_struct *vma,
 {
 	size_t pgsize;
 	int ncontig;
+	pte_t orig_pte;
 
 	if (!pte_cont(READ_ONCE(*ptep)))
 		return ptep_clear_flush(vma, addr, ptep);
 
 	ncontig = find_num_contig(vma->vm_mm, addr, ptep, &pgsize);
-	return get_clear_flush(vma->vm_mm, addr, ptep, pgsize, ncontig);
+	orig_pte = get_clear_contig(vma->vm_mm, addr, ptep, pgsize, ncontig);
+	flush_tlb_range(vma, addr, addr + pgsize * ncontig);
+	return orig_pte;
 }
 
 static int __init hugetlbpage_init(void)
Signature · 5 lines
2.35.1

-- 
Cheers,
Stephen Rothwell