From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f172.google.com (mail-wi0-f172.google.com [209.85.212.172]) by kanga.kvack.org (Postfix) with ESMTP id E63B66B00D4 for ; Thu, 12 Jun 2014 07:34:32 -0400 (EDT) Received: by mail-wi0-f172.google.com with SMTP id hi2so7429020wib.5 for ; Thu, 12 Jun 2014 04:34:32 -0700 (PDT) Received: from mail-wi0-x230.google.com (mail-wi0-x230.google.com [2a00:1450:400c:c05::230]) by mx.google.com with ESMTPS id fu7si26517799wib.85.2014.06.12.04.34.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 12 Jun 2014 04:34:31 -0700 (PDT) Received: by mail-wi0-f176.google.com with SMTP id n3so7178776wiv.3 for ; Thu, 12 Jun 2014 04:34:30 -0700 (PDT) From: Michal Nazarewicz 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: Thu, 12 Jun 2014 13:34:27 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Sender: owner-linux-mm@kvack.org List-ID: To: Joonsoo Kim , Andrew Morton , "Aneesh Kumar K.V" , Marek Szyprowski 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 On Thu, Jun 12 2014, Joonsoo Kim wrote: > 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: Michal Nazarewicz > 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 =3D=3D 0) { > page =3D pfn_to_page(pfn); > break; > - } else if (ret !=3D -EBUSY) { > - clear_cma_bitmap(cma, pfn, count); > - break; > } > + > clear_cma_bitmap(cma, pfn, count); > + if (ret !=3D -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 */ --=20 Best regards, _ _ .o. | Liege of Serenely Enlightened Majesty of o' \,=3D./ `o ..o | Computer Science, Micha=C5=82 =E2=80=9Cmina86=E2=80=9D Nazarewicz = (o o) ooo +------ooO--(_)--Ooo-- -- 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