lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Fri, 11 Sep 2015 06:20:27 +0800
From:	Chen Gang <xili_gchen_5257@...mail.com>
To:	Oleg Nesterov <oleg@...hat.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 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 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

Powered by Openwall GNU/*/Linux Powered by OpenVZ