From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pb0-f43.google.com (mail-pb0-f43.google.com [209.85.160.43]) by kanga.kvack.org (Postfix) with ESMTP id C365F6B0031 for ; Sat, 14 Jun 2014 03:18:41 -0400 (EDT) Received: by mail-pb0-f43.google.com with SMTP id um1so238898pbc.30 for ; Sat, 14 Jun 2014 00:18:41 -0700 (PDT) Received: from e28smtp09.in.ibm.com (e28smtp09.in.ibm.com. [122.248.162.9]) by mx.google.com with ESMTPS id zd5si7164415pac.39.2014.06.14.00.18.39 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 14 Jun 2014 00:18:40 -0700 (PDT) Received: from /spool/local by e28smtp09.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 14 Jun 2014 12:48:36 +0530 Received: from d28relay05.in.ibm.com (d28relay05.in.ibm.com [9.184.220.62]) by d28dlp02.in.ibm.com (Postfix) with ESMTP id A02613940049 for ; Sat, 14 Jun 2014 12:48:32 +0530 (IST) Received: from d28av03.in.ibm.com (d28av03.in.ibm.com [9.184.220.65]) by d28relay05.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s5E7IkWw11272510 for ; Sat, 14 Jun 2014 12:48:47 +0530 Received: from d28av03.in.ibm.com (localhost [127.0.0.1]) by d28av03.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s5E7IVW7010766 for ; Sat, 14 Jun 2014 12:48:31 +0530 From: "Aneesh Kumar K.V" Subject: Re: [PATCH v2 08/10] mm, cma: clean-up cma allocation error path In-Reply-To: <1402543307-29800-9-git-send-email-iamjoonsoo.kim@lge.com> References: <1402543307-29800-1-git-send-email-iamjoonsoo.kim@lge.com> <1402543307-29800-9-git-send-email-iamjoonsoo.kim@lge.com> Date: Sat, 14 Jun 2014 12:48:30 +0530 Message-ID: <87y4x0ez7d.fsf@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain Sender: owner-linux-mm@kvack.org List-ID: To: Joonsoo Kim , Andrew Morton , Marek Szyprowski , Michal Nazarewicz Cc: Minchan Kim , Russell King - ARM Linux , Greg Kroah-Hartman , Paolo Bonzini , Gleb Natapov , Alexander Graf , Benjamin Herrenschmidt , Paul Mackerras , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Joonsoo Kim writes: > We can remove one call sites for clear_cma_bitmap() if we first > call it before checking error number. > > Signed-off-by: Joonsoo Kim Reviewed-by: Aneesh Kumar K.V > > diff --git a/mm/cma.c b/mm/cma.c > index 1e1b017..01a0713 100644 > --- a/mm/cma.c > +++ b/mm/cma.c > @@ -282,11 +282,12 @@ struct page *cma_alloc(struct cma *cma, int count, unsigned int align) > if (ret == 0) { > page = pfn_to_page(pfn); > break; > - } else if (ret != -EBUSY) { > - clear_cma_bitmap(cma, pfn, count); > - break; > } > + > clear_cma_bitmap(cma, pfn, count); > + if (ret != -EBUSY) > + break; > + > pr_debug("%s(): memory range at %p is busy, retrying\n", > __func__, pfn_to_page(pfn)); > /* try again with a bit different memory target */ > -- > 1.7.9.5 -- 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