From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753130AbbIJSWZ (ORCPT ); Thu, 10 Sep 2015 14:22:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50407 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751523AbbIJSWY (ORCPT ); Thu, 10 Sep 2015 14:22:24 -0400 Date: Thu, 10 Sep 2015 20:19:35 +0200 From: Oleg Nesterov To: Chen Gang Cc: Andrew Morton , "kirill.shutemov@linux.intel.com" , "riel@redhat.com" , Michal Hocko , "sasha.levin@oracle.com" , "pfeiner@google.com" , "aarcange@redhat.com" , "vishnu.ps@samsung.com" , Linux Memory , kernel mailing list Subject: Re: [PATCH] mm/mmap.c: Remove useless statement "vma = NULL" in find_vma() Message-ID: <20150910181935.GB21456@redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.