diff mbox series

[v4,53/66] mm/madvise: Use vma_find() instead of vma linked list

Message ID 20211201142918.921493-54-Liam.Howlett@oracle.com (mailing list archive)
State New
Headers show
Series Introducing the Maple Tree | expand

Commit Message

Liam R. Howlett Dec. 1, 2021, 2:30 p.m. UTC
From: "Liam R. Howlett" <Liam.Howlett@Oracle.com>

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
---
 mm/madvise.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Vlastimil Babka Jan. 19, 2022, 6 p.m. UTC | #1
On 12/1/21 15:30, Liam Howlett wrote:
> From: "Liam R. Howlett" <Liam.Howlett@Oracle.com>
> 
> Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>

Acked-by: Vlastimil Babka <vbabka@suse.cz>

> ---
>  mm/madvise.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/madvise.c b/mm/madvise.c
> index 8c927202bbe6..cb6daa98e5b1 100644
> --- a/mm/madvise.c
> +++ b/mm/madvise.c
> @@ -1209,7 +1209,7 @@ int do_madvise(struct mm_struct *mm, unsigned long start, size_t len_in, int beh
>  		if (start >= end)
>  			goto out;
>  		if (prev)
> -			vma = prev->vm_next;
> +			vma = find_vma(mm, prev->vm_end);
>  		else	/* madvise_remove dropped mmap_lock */
>  			vma = find_vma(mm, start);
>  	}
diff mbox series

Patch

diff --git a/mm/madvise.c b/mm/madvise.c
index 8c927202bbe6..cb6daa98e5b1 100644
--- a/mm/madvise.c
+++ b/mm/madvise.c
@@ -1209,7 +1209,7 @@  int do_madvise(struct mm_struct *mm, unsigned long start, size_t len_in, int beh
 		if (start >= end)
 			goto out;
 		if (prev)
-			vma = prev->vm_next;
+			vma = find_vma(mm, prev->vm_end);
 		else	/* madvise_remove dropped mmap_lock */
 			vma = find_vma(mm, start);
 	}