Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1407819

Re: [PATCH v3 0/6] Introduce ZONE_CMA

From Joonsoo Kim <iamjoonsoo.kim@lge.com>
Newsgroups linux.kernel
Subject Re: [PATCH v3 0/6] Introduce ZONE_CMA
Date 2016-05-27 07:30 +0200
Message-ID <rDivn-7KL-3@gated-at.bofh.it> (permalink)
References <rCWXT-2Qp-5@gated-at.bofh.it> <rCYwG-3W0-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, May 26, 2016 at 04:04:54PM +0800, Feng Tang wrote:
> On Thu, May 26, 2016 at 02:22:22PM +0800, js1304@gmail.com wrote:
> > From: Joonsoo Kim <iamjoonsoo.kim@lge.com>
> 
> Hi Joonsoo,
> 
> Nice work!

Thanks!

> > FYI, there is another attempt [3] trying to solve this problem in lkml.
> > And, as far as I know, Qualcomm also has out-of-tree solution for this
> > problem.
> 
> This may be a little off-topic :) Actually, we have used another way in
> our products, that we disable the fallback from MIGRATETYE_MOVABLE to
> MIGRATETYPE_CMA completely, and only allow free CMA memory to be used
> by file page cache (which is easy to be reclaimed by its nature). 
> We did it by adding a GFP_PAGE_CACHE to every allocation request for
> page cache, and the MM will try to pick up an available free CMA page
> first, and goes to normal path when fail. 

Just wonder, why do you allow CMA memory to file page cache rather
than anonymous page? I guess that anonymous pages would be more easily
migrated/reclaimed than file page cache. In fact, some of our product
uses anonymous page adaptation to satisfy similar requirement by
introducing GFP_CMA. AFAIK, some of chip vendor also uses "anonymous
page first adaptation" to get better success rate.

> It works fine on our products, though we still see some cases that
> some page can't be reclaimed. 
> 
> Our product has a special user case of CMA, that sometimes it will
> need to use the whole CMA memory (say 256MB on a phone), then all

I don't think this usecase is so special. Our product also has similar
usecase. And, I already knows one another.

> share out CMA pages need to be reclaimed all at once. Don't know if
> this new ZONE_CMA approach could meet this request? (our page cache
> solution can't ganrantee to meet this request all the time).

This ZONE_CMA approach would be better than before, since CMA memory
is not be used for blockdev page cache. Blockdev page cache is one of
the frequent failure points in my experience.

I'm not sure that ZONE_CMA works better than your GFP_PAGE_CACHE
adaptation for your system. In ZONE_CMA, CMA memory is used for file
page cache or anonymous pages. If my assumption that anonymous pages
are easier to be migrated/reclaimed is correct, ZONE_CMA would work
better than your adaptation since there is less file page cache pages
in CMA memory.

Anyway, it also doesn't guarantee to succeed all the time. There is
different kind of problem that prevents CMA allocation success and we
need to solve it. I will try it after problems that this patchset try
to fix is solved.

Thanks.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3 0/6] Introduce ZONE_CMA js1304@gmail.com - 2016-05-26 08:30 +0200
  [PATCH v3 3/6] mm/cma: populate ZONE_CMA js1304@gmail.com - 2016-05-26 08:30 +0200
  [PATCH v3 1/6] mm/page_alloc: recalculate some of zone threshold when on/offline memory js1304@gmail.com - 2016-05-26 08:30 +0200
  [PATCH v3 5/6] mm/cma: remove MIGRATE_CMA js1304@gmail.com - 2016-05-26 08:30 +0200
    Re: [PATCH v3 5/6] mm/cma: remove MIGRATE_CMA Chen Feng <puck.chen@hisilicon.com> - 2016-05-27 03:50 +0200
      Re: [PATCH v3 5/6] mm/cma: remove MIGRATE_CMA Joonsoo Kim <iamjoonsoo.kim@lge.com> - 2016-05-27 07:40 +0200
  [PATCH v3 6/6] mm/cma: remove per zone CMA stat js1304@gmail.com - 2016-05-26 08:30 +0200
  Re: [PATCH v3 0/6] Introduce ZONE_CMA Feng Tang <feng.tang@intel.com> - 2016-05-26 10:10 +0200
    Re: [PATCH v3 0/6] Introduce ZONE_CMA Joonsoo Kim <iamjoonsoo.kim@lge.com> - 2016-05-27 07:30 +0200
      Re: [PATCH v3 0/6] Introduce ZONE_CMA Feng Tang <feng.tang@intel.com> - 2016-05-27 08:30 +0200
        Re: [PATCH v3 0/6] Introduce ZONE_CMA Joonsoo Kim <iamjoonsoo.kim@lge.com> - 2016-05-27 08:50 +0200
          Re: [PATCH v3 0/6] Introduce ZONE_CMA Feng Tang <feng.tang@intel.com> - 2016-05-27 09:30 +0200
            Re: [PATCH v3 0/6] Introduce ZONE_CMA Joonsoo Kim <iamjoonsoo.kim@lge.com> - 2016-05-30 07:50 +0200

csiph-web