[PATCH v4 21/21] mm/mmap: Drop incorrect comment from vms_gather_munmap_vmas()

Liam R. Howlett posted 21 patches 1 year, 5 months ago
There is a newer version of this series
[PATCH v4 21/21] mm/mmap: Drop incorrect comment from vms_gather_munmap_vmas()
Posted by Liam R. Howlett 1 year, 5 months ago
From: "Liam R. Howlett" <Liam.Howlett@Oracle.com>

The comment has been outdated since 6b73cff239e52 ("mm: change munmap
splitting order and move_vma()").  The move_vma() was altered to fix the
fragile state of the accounting since then.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
---
 mm/mmap.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/mm/mmap.c b/mm/mmap.c
index 7a440e7da55a..ca3872e5fbd8 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -2675,13 +2675,8 @@ static int vms_gather_munmap_vmas(struct vma_munmap_struct *vms,
 
 	/*
 	 * If we need to split any vma, do it now to save pain later.
-	 *
-	 * Note: mremap's move_vma VM_ACCOUNT handling assumes a partially
-	 * unmapped vm_area_struct will remain in use: so lower split_vma
-	 * places tmp vma above, and higher split_vma places tmp vma below.
+	 * Does it split the first one?
 	 */
-
-	/* Does it split the first one? */
 	if (vms->start > vms->vma->vm_start) {
 
 		/*
-- 
2.43.0
Re: [PATCH v4 21/21] mm/mmap: Drop incorrect comment from vms_gather_munmap_vmas()
Posted by Lorenzo Stoakes 1 year, 5 months ago
On Wed, Jul 10, 2024 at 03:22:50PM GMT, Liam R. Howlett wrote:
> From: "Liam R. Howlett" <Liam.Howlett@Oracle.com>
>
> The comment has been outdated since 6b73cff239e52 ("mm: change munmap
> splitting order and move_vma()").  The move_vma() was altered to fix the
> fragile state of the accounting since then.
>
> Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
> ---
>  mm/mmap.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/mm/mmap.c b/mm/mmap.c
> index 7a440e7da55a..ca3872e5fbd8 100644
> --- a/mm/mmap.c
> +++ b/mm/mmap.c
> @@ -2675,13 +2675,8 @@ static int vms_gather_munmap_vmas(struct vma_munmap_struct *vms,
>
>  	/*
>  	 * If we need to split any vma, do it now to save pain later.
> -	 *
> -	 * Note: mremap's move_vma VM_ACCOUNT handling assumes a partially
> -	 * unmapped vm_area_struct will remain in use: so lower split_vma
> -	 * places tmp vma above, and higher split_vma places tmp vma below.
> +	 * Does it split the first one?
>  	 */
> -
> -	/* Does it split the first one? */
>  	if (vms->start > vms->vma->vm_start) {
>
>  		/*
> --
> 2.43.0
>

Looks good to me,

Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>