linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Gonzalo Matias Juarez Tello <gmjuareztello@gmail.com>,
	akpm@linux-foundation.org
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCHv2] mm/mmap.c: lines in __do_munmap repeat logic of inlined find_vma_intersection
Date: Wed, 14 Apr 2021 17:16:11 +0200	[thread overview]
Message-ID: <459c338e-bd9b-fb27-5d6f-f217b684a9e3@redhat.com> (raw)
In-Reply-To: <20210408034632.r5nor5akqo5o3aus@monty>

On 08.04.21 05:46, Gonzalo Matias Juarez Tello wrote:
> Some lines in __do_munmap used the same logic as find_vma_intersection
> (which is inlined) instead of directly using that function.
> 
> (Can't believe I made a typo in the first one, compiled this one,
> sorry first patch kinda nervous for some reason)
> 
> Signed-off-by: Gonzalo Matias Juarez Tello <gmjuareztello@gmail.com>
> ---
>   mm/mmap.c | 7 +------
>   1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/mm/mmap.c b/mm/mmap.c
> index 3f287599a7a3..1b29f8bf8344 100644
> --- a/mm/mmap.c
> +++ b/mm/mmap.c
> @@ -2823,15 +2823,10 @@ int __do_munmap(struct mm_struct *mm, unsigned long start, size_t len,
>   	arch_unmap(mm, start, end);
>   
>   	/* Find the first overlapping VMA */
> -	vma = find_vma(mm, start);
> +	vma = find_vma_intersection(mm, start, end);
>   	if (!vma)
>   		return 0;
>   	prev = vma->vm_prev;
> -	/* we have  start < vma->vm_end  */
> -
> -	/* if it doesn't overlap, we have nothing.. */
> -	if (vma->vm_start >= end)
> -		return 0;
>   
>   	/*
>   	 * If we need to split any vma, do it now to save pain later.
> 

Reviewed-by: David Hildenbrand <david@redhat.com>

-- 
Thanks,

David / dhildenb



      reply	other threads:[~2021-04-14 15:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-08  3:46 [PATCHv2] mm/mmap.c: lines in __do_munmap repeat logic of inlined find_vma_intersection Gonzalo Matias Juarez Tello
2021-04-14 15:16 ` David Hildenbrand [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=459c338e-bd9b-fb27-5d6f-f217b684a9e3@redhat.com \
    --to=david@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=gmjuareztello@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).