From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751132Ab3GPFKW (ORCPT ); Tue, 16 Jul 2013 01:10:22 -0400 Received: from LGEMRELSE7Q.lge.com ([156.147.1.151]:48359 "EHLO LGEMRELSE7Q.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750955Ab3GPFKU (ORCPT ); Tue, 16 Jul 2013 01:10:20 -0400 X-AuditID: 9c930197-b7bfbae000000e88-aa-51e4d5b999cb Date: Tue, 16 Jul 2013 14:10:20 +0900 From: Joonsoo Kim To: "Aneesh Kumar K.V" Cc: Andrew Morton , Rik van Riel , Mel Gorman , Michal Hocko , KAMEZAWA Hiroyuki , Hugh Dickins , Davidlohr Bueso , David Gibson , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/9] mm, hugetlb: move up the code which check availability of free huge page Message-ID: <20130716051020.GA30116@lge.com> References: <1373881967-16153-1-git-send-email-iamjoonsoo.kim@lge.com> <1373881967-16153-2-git-send-email-iamjoonsoo.kim@lge.com> <87a9lnkjlu.fsf@linux.vnet.ibm.com> <20130716011607.GD2430@lge.com> <87a9lni3bv.fsf@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87a9lni3bv.fsf@linux.vnet.ibm.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Brightmail-Tracker: AAAAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 16, 2013 at 09:06:04AM +0530, Aneesh Kumar K.V wrote: > Joonsoo Kim writes: > > > On Mon, Jul 15, 2013 at 07:31:33PM +0530, Aneesh Kumar K.V wrote: > >> Joonsoo Kim writes: > >> > >> > We don't need to proceede the processing if we don't have any usable > >> > free huge page. So move this code up. > >> > >> I guess you can also mention that since we are holding hugetlb_lock > >> hstate values can't change. > > > > Okay. I will mention this for v2. > > > >> > >> > >> Also. > >> > >> > > >> > Signed-off-by: Joonsoo Kim > >> > > >> > diff --git a/mm/hugetlb.c b/mm/hugetlb.c > >> > index e2bfbf7..d87f70b 100644 > >> > --- a/mm/hugetlb.c > >> > +++ b/mm/hugetlb.c > >> > @@ -539,10 +539,6 @@ static struct page *dequeue_huge_page_vma(struct hstate *h, > >> > struct zoneref *z; > >> > unsigned int cpuset_mems_cookie; > >> > > >> > -retry_cpuset: > >> > - cpuset_mems_cookie = get_mems_allowed(); > >> > - zonelist = huge_zonelist(vma, address, > >> > - htlb_alloc_mask, &mpol, &nodemask); > >> > /* > >> > * A child process with MAP_PRIVATE mappings created by their parent > >> > * have no page reserves. This check ensures that reservations are > >> > @@ -550,11 +546,16 @@ retry_cpuset: > >> > */ > >> > if (!vma_has_reserves(vma) && > >> > h->free_huge_pages - h->resv_huge_pages == 0) > >> > - goto err; > >> > + return NULL; > >> > > >> > >> If you don't do the above change, the patch will be much simpler. > > > > The patch will be, but output code will not. > > With this change, we can remove one goto label('err:') and > > this makes code more readable. > > > > If you feel stronly about the cleanup, you can do another path for the > cleanups. Don't mix things in a single patch. That makes review difficult. Okay! I will make an another patch for clean-up. Thanks. > > -aneesh > > -- > 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: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx121.postini.com [74.125.245.121]) by kanga.kvack.org (Postfix) with SMTP id ACB7C6B0032 for ; Tue, 16 Jul 2013 01:10:19 -0400 (EDT) Date: Tue, 16 Jul 2013 14:10:20 +0900 From: Joonsoo Kim Subject: Re: [PATCH 1/9] mm, hugetlb: move up the code which check availability of free huge page Message-ID: <20130716051020.GA30116@lge.com> References: <1373881967-16153-1-git-send-email-iamjoonsoo.kim@lge.com> <1373881967-16153-2-git-send-email-iamjoonsoo.kim@lge.com> <87a9lnkjlu.fsf@linux.vnet.ibm.com> <20130716011607.GD2430@lge.com> <87a9lni3bv.fsf@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87a9lni3bv.fsf@linux.vnet.ibm.com> Sender: owner-linux-mm@kvack.org List-ID: To: "Aneesh Kumar K.V" Cc: Andrew Morton , Rik van Riel , Mel Gorman , Michal Hocko , KAMEZAWA Hiroyuki , Hugh Dickins , Davidlohr Bueso , David Gibson , linux-mm@kvack.org, linux-kernel@vger.kernel.org On Tue, Jul 16, 2013 at 09:06:04AM +0530, Aneesh Kumar K.V wrote: > Joonsoo Kim writes: > > > On Mon, Jul 15, 2013 at 07:31:33PM +0530, Aneesh Kumar K.V wrote: > >> Joonsoo Kim writes: > >> > >> > We don't need to proceede the processing if we don't have any usable > >> > free huge page. So move this code up. > >> > >> I guess you can also mention that since we are holding hugetlb_lock > >> hstate values can't change. > > > > Okay. I will mention this for v2. > > > >> > >> > >> Also. > >> > >> > > >> > Signed-off-by: Joonsoo Kim > >> > > >> > diff --git a/mm/hugetlb.c b/mm/hugetlb.c > >> > index e2bfbf7..d87f70b 100644 > >> > --- a/mm/hugetlb.c > >> > +++ b/mm/hugetlb.c > >> > @@ -539,10 +539,6 @@ static struct page *dequeue_huge_page_vma(struct hstate *h, > >> > struct zoneref *z; > >> > unsigned int cpuset_mems_cookie; > >> > > >> > -retry_cpuset: > >> > - cpuset_mems_cookie = get_mems_allowed(); > >> > - zonelist = huge_zonelist(vma, address, > >> > - htlb_alloc_mask, &mpol, &nodemask); > >> > /* > >> > * A child process with MAP_PRIVATE mappings created by their parent > >> > * have no page reserves. This check ensures that reservations are > >> > @@ -550,11 +546,16 @@ retry_cpuset: > >> > */ > >> > if (!vma_has_reserves(vma) && > >> > h->free_huge_pages - h->resv_huge_pages == 0) > >> > - goto err; > >> > + return NULL; > >> > > >> > >> If you don't do the above change, the patch will be much simpler. > > > > The patch will be, but output code will not. > > With this change, we can remove one goto label('err:') and > > this makes code more readable. > > > > If you feel stronly about the cleanup, you can do another path for the > cleanups. Don't mix things in a single patch. That makes review difficult. Okay! I will make an another patch for clean-up. Thanks. > > -aneesh > > -- > 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: email@kvack.org -- 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: email@kvack.org