Message ID | 1402543307-29800-9-git-send-email-iamjoonsoo.kim@lge.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Thu, Jun 12, 2014 at 12:21:45PM +0900, 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 <iamjoonsoo.kim@lge.com> Acked-by: Minchan Kim <minchan@kernel.org>
On 06/12/2014 11:21 AM, 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 <iamjoonsoo.kim@lge.com> Reviewed-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com> > > 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 */ >
On Thu, Jun 12 2014, Joonsoo Kim <iamjoonsoo.kim@lge.com> 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 <iamjoonsoo.kim@lge.com> Reviewed-by: Michal Nazarewicz <mina86@mina86.com> > 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 */
Joonsoo Kim <iamjoonsoo.kim@lge.com> 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 <iamjoonsoo.kim@lge.com> Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> > > 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 from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
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 */
We can remove one call sites for clear_cma_bitmap() if we first call it before checking error number. Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>