[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20150909162605.GA4373@redhat.com>
Date: Wed, 9 Sep 2015 18:26:05 +0200
From: Oleg Nesterov <oleg@...hat.com>
To: Chen Gang <xili_gchen_5257@...mail.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
"kirill.shutemov@...ux.intel.com" <kirill.shutemov@...ux.intel.com>,
"riel@...hat.com" <riel@...hat.com>, Michal Hocko <mhocko@...e.cz>,
"sasha.levin@...cle.com" <sasha.levin@...cle.com>,
"pfeiner@...gle.com" <pfeiner@...gle.com>,
"aarcange@...hat.com" <aarcange@...hat.com>,
"vishnu.ps@...sung.com" <vishnu.ps@...sung.com>,
Linux Memory <linux-mm@...ck.org>,
kernel mailing list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] mm/mmap.c: Remove useless statement "vma = NULL" in
find_vma()
On 09/08, Chen Gang wrote:
>
> I also want to consult: the comments of find_vma() says:
Sorry, I don't understand the question ;)
> "Look up the first VMA which satisfies addr < vm_end, ..."
>
> Is it OK?
Why not?
> (why not "vm_start <= addr < vm_end"),
Because this some callers actually want to find the 1st vma which
satisfies addr < vm_end? For example, shift_arg_pages().
OTOH, I think that another helper,
find_vma_xxx(mm, addr)
{
vma = find_vma(...)
if (vma && vma->vm_start > addr)
vma = NULL;
return vma;
}
makes sense. It can have a lot of users.
> need we let "vma = tmp"
> in "if (tmp->vm_start <= addr)"? -- it looks the comments is not match
> the implementation, precisely (maybe not 1st VMA).
This contradicts with above... I mean, it is not clear what exactly do
you blame, semantics or implementation.
The implementation looks correct. Why do you think it can be not 1st vma?
Oleg.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists