Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1222347

Re: [PATCH] mm/mmap.c: Remove useless statement "vma = NULL" in find_vma()

From Oleg Nesterov <oleg@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH] mm/mmap.c: Remove useless statement "vma = NULL" in find_vma()
Date 2015-09-10 20:30 +0200
Message-ID <q7eLE-11U-23@gated-at.bofh.it> (permalink)
References <q5mki-2Hy-11@gated-at.bofh.it> <q6rUB-6Ec-15@gated-at.bofh.it> <q6WlI-8l1-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 09/10, Chen Gang wrote:
>
> On 9/10/15 00:26, Oleg Nesterov wrote:
> >
> > The implementation looks correct. Why do you think it can be not 1st vma?
> >
>
> It is in while (rb_node) {...}.
>
> - When we set "vma = tmp", it is alreay match "addr < vm_end".

Yes,

> - If "addr>= vm_start", we return this vma (else continue searching).

This is optimization, we can stop the search because in this case
vma == tmp is obviously the 1st vma with "addr < vm_end".

I simply can't understand your concerns. Perhaps you can make a
patch, then it will be more clear what me-or-you have missed.

Oleg.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH] mm/mmap.c: Remove useless statement "vma = NULL" in  find_vma() Chen Gang <xili_gchen_5257@hotmail.com> - 2015-09-08 16:20 +0200
  Re: [PATCH] mm/mmap.c: Remove useless statement "vma = NULL" in  find_vma() Oleg Nesterov <oleg@redhat.com> - 2015-09-09 18:30 +0200
  Re: [PATCH] mm/mmap.c: Remove useless statement "vma = NULL" in  find_vma() Chen Gang <xili_gchen_5257@hotmail.com> - 2015-09-10 00:50 +0200
    Re: [PATCH] mm/mmap.c: Remove useless statement "vma = NULL" in  find_vma() Oleg Nesterov <oleg@redhat.com> - 2015-09-10 20:30 +0200
      Re: [PATCH] mm/mmap.c: Remove useless statement "vma = NULL" in find_vma() Chen Gang <xili_gchen_5257@hotmail.com> - 2015-09-11 00:20 +0200

csiph-web