linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Chen Gang <xili_gchen_5257@hotmail.com>
To: Oleg Nesterov <oleg@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	"kirill.shutemov@linux.intel.com"
	<kirill.shutemov@linux.intel.com>,
	"riel@redhat.com" <riel@redhat.com>,
	Michal Hocko <mhocko@suse.cz>,
	"sasha.levin@oracle.com" <sasha.levin@oracle.com>,
	"pfeiner@google.com" <pfeiner@google.com>,
	"aarcange@redhat.com" <aarcange@redhat.com>,
	"vishnu.ps@samsung.com" <vishnu.ps@samsung.com>,
	Linux Memory <linux-mm@kvack.org>,
	kernel mailing list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mm/mmap.c: Remove useless statement "vma = NULL" in find_vma()
Date: Fri, 11 Sep 2015 06:20:27 +0800	[thread overview]
Message-ID: <BLU436-SMTP253F123C92780B6AA4E637B9510@phx.gbl> (raw)
In-Reply-To: <20150910181935.GB21456@redhat.com>

On 9/11/15 02:19, Oleg Nesterov wrote:
> On 09/10, Chen Gang wrote:
>> - 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".
> 

OK, thanks.

I guess if we have additional comments for "if (tmp->vm_start <= addr)",
the code will be more readable for readers (especially for newbies).

@@ -2064,7 +2064,7 @@ struct vm_area_struct *find_vma(struct mm_struct *mm, unsigned long addr)
                if (tmp->vm_end > addr) {
                        vma = tmp;
                        if (tmp->vm_start <= addr)
-                               break;
+                               break; /* It must be 1st "addr < vm_end" */
                        rb_node = rb_node->rb_left;
                } else
                        rb_node = rb_node->rb_right;


> 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.
> 

I guess, we need not (it is my missing). :-)


Thanks.
-- 
Chen Gang (陈刚)

Open, share, and attitude like air, water, and life which God blessed

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2015-09-10 22:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-05 14:03 Chen Gang
2015-09-07 12:36 ` Oleg Nesterov
     [not found]   ` <55EEED66.6090509@hotmail.com>
2015-09-08 14:14     ` Chen Gang
2015-09-09 16:26       ` Oleg Nesterov
     [not found]         ` <55F0B6C2.2000706@hotmail.com>
2015-09-09 22:44           ` Chen Gang
2015-09-10 18:19             ` Oleg Nesterov
2015-09-10 22:20               ` Chen Gang [this message]
2015-09-08 23:14 ` David Rientjes
  -- strict thread matches above, loose matches on Subject: below --
2015-09-03  3:52 gang.chen.5i5j
2015-09-03  4:02 ` Chen Gang

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=BLU436-SMTP253F123C92780B6AA4E637B9510@phx.gbl \
    --to=xili_gchen_5257@hotmail.com \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.cz \
    --cc=oleg@redhat.com \
    --cc=pfeiner@google.com \
    --cc=riel@redhat.com \
    --cc=sasha.levin@oracle.com \
    --cc=vishnu.ps@samsung.com \
    /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