linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Joonsoo Kim <iamjoonsoo.kim@lge.com>
To: Vlastimil Babka <vbabka@suse.cz>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Rik van Riel <riel@redhat.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Mel Gorman <mgorman@suse.de>,
	Laura Abbott <lauraa@codeaurora.org>,
	Minchan Kim <minchan@kernel.org>,
	Heesub Shin <heesub.shin@samsung.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Michal Nazarewicz <mina86@mina86.com>,
	"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Hui Zhu <zhuhui@xiaomi.com>, Gioh Kim <gioh.kim@lge.com>,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
	Ritesh Harjani <ritesh.list@gmail.com>
Subject: Re: [RFC 00/16] Introduce ZONE_CMA
Date: Fri, 6 Mar 2015 16:26:49 +0900	[thread overview]
Message-ID: <20150306072649.GB15051@js1304-P5Q-DELUXE> (raw)
In-Reply-To: <54F89702.8070405@suse.cz>

On Thu, Mar 05, 2015 at 06:48:50PM +0100, Vlastimil Babka wrote:
> On 03/05/2015 05:53 PM, Vlastimil Babka wrote:
> > On 02/12/2015 08:32 AM, Joonsoo Kim wrote:
> >> 
> >> 1) Break non-overlapped zone assumption
> >> CMA regions could be spread to all memory range, so, to keep all of them
> >> into one zone, span of ZONE_CMA would be overlap to other zones'.
> > 
> > From patch 13/16 ut seems to me that indeed the ZONE_CMA spans the area of all
> > other zones. This seems very inefficient for e.g. compaction scanners, which
> > will repeatedly skip huge amounts of pageblocks that don't belong to ZONE_CMA.
> > Could you instead pick only a single zone on a node from which you steal the
> > pages? That would allow to keep the span low.

Hello, Vlastimil.

CMA is used for DMA now and it sometimes has memory range constraint
so we could not limit zone span as low. But, current implementatino
unnecessarilly set up ZONE_CMA's span from start_pfn of node to
end_pfn of node. I will change it to the range where we actually steal
pages. Maybe, most of usecase of CMA would use small, limited range of
memory so it doesn't impose critical performance problem on zone's pfn
iterator such as compaction scanners.

> > 
> > Another disadvantage I see is that to allocate from ZONE_CMA you will have now
> > to reclaim enough pages within the zone itself. I think think the cma allocation
> 
>                                                   I don't think...
> 
> > supports migrating pages from ZONE_CMA to the adjacent non-CMA zone, which would
> > be equivalent to migration from MIGRATE_CMA pageblocks to the rest of the zone?

I'm not sure I understand your question correctly.

cma allocation uses alloc_migrate_target() to get migration target
freepage and it doesn't impose any zone contraint so migrating pages
from ZONE_CMA to the adjacent non-CMA zone is possible. Am I
understading you question correctly? If I mis-understand, please let
me know.

Thanks.

> >> I'm not sure that there is an assumption about possibility of zone overlap
> >> But, if ZONE_CMA is introduced, this assumption becomes reality
> >> so we should deal with this situation. I investigated most of sites
> >> that iterates pfn on certain zone and found that they normally doesn't
> >> consider zone overlap. I tried to handle these cases by myself in the
> >> early of this series. I hope that there is no more site that depends on
> >> non-overlap zone assumption when iterating pfn on certain zone.
> >> 
> >> I passed boot test on x86, ARM32 and ARM64. I did some stress tests
> >> on x86 and there is no problem. Feel free to enjoy and please give me
> >> a feedback. :)
> >> 
> >> This patchset is based on v3.18.
> >> 
> >> Thanks.
> >> 
> >> [1] https://lkml.org/lkml/2014/5/28/64
> >> [2] https://lkml.org/lkml/2014/11/4/55 
> >> [3] https://lkml.org/lkml/2014/10/15/623
> >> [4] https://lkml.org/lkml/2014/5/30/320
> >> 
> >> 
> >> Joonsoo Kim (16):
> >>   mm/page_alloc: correct highmem memory statistics
> >>   mm/writeback: correct dirty page calculation for highmem
> >>   mm/highmem: make nr_free_highpages() handles all highmem zones by
> >>     itself
> >>   mm/vmstat: make node_page_state() handles all zones by itself
> >>   mm/vmstat: watch out zone range overlap
> >>   mm/page_alloc: watch out zone range overlap
> >>   mm/page_isolation: watch out zone range overlap
> >>   power: watch out zone range overlap
> >>   mm/cma: introduce cma_total_pages() for future use
> >>   mm/highmem: remove is_highmem_idx()
> >>   mm/page_alloc: clean-up free_area_init_core()
> >>   mm/cma: introduce new zone, ZONE_CMA
> >>   mm/cma: populate ZONE_CMA and use this zone when GFP_HIGHUSERMOVABLE
> >>   mm/cma: print stealed page count
> >>   mm/cma: remove ALLOC_CMA
> >>   mm/cma: remove MIGRATE_CMA
> >> 
> >>  arch/x86/include/asm/sparsemem.h  |    2 +-
> >>  arch/x86/mm/highmem_32.c          |    3 +
> >>  include/linux/cma.h               |    9 ++
> >>  include/linux/gfp.h               |   31 +++---
> >>  include/linux/mempolicy.h         |    2 +-
> >>  include/linux/mm.h                |    1 +
> >>  include/linux/mmzone.h            |   58 +++++-----
> >>  include/linux/page-flags-layout.h |    2 +
> >>  include/linux/vm_event_item.h     |    8 +-
> >>  include/linux/vmstat.h            |   26 +----
> >>  kernel/power/snapshot.c           |   15 +++
> >>  lib/show_mem.c                    |    2 +-
> >>  mm/cma.c                          |   70 ++++++++++--
> >>  mm/compaction.c                   |    6 +-
> >>  mm/highmem.c                      |   12 +-
> >>  mm/hugetlb.c                      |    2 +-
> >>  mm/internal.h                     |    3 +-
> >>  mm/memory_hotplug.c               |    3 +
> >>  mm/mempolicy.c                    |    3 +-
> >>  mm/page-writeback.c               |    8 +-
> >>  mm/page_alloc.c                   |  223 +++++++++++++++++++++----------------
> >>  mm/page_isolation.c               |   14 ++-
> >>  mm/vmscan.c                       |    2 +-
> >>  mm/vmstat.c                       |   16 ++-
> >>  24 files changed, 317 insertions(+), 204 deletions(-)
> >> 
> > 
> > --
> > 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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
> > 
> 
> --
> 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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

--
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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2015-03-06  7:26 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-12  7:32 Joonsoo Kim
2015-02-12  7:32 ` [RFC 01/16] mm/page_alloc: correct highmem memory statistics Joonsoo Kim
2015-02-12  7:32 ` [RFC 02/16] mm/writeback: correct dirty page calculation for highmem Joonsoo Kim
2015-02-12  7:32 ` [RFC 03/16] mm/highmem: make nr_free_highpages() handles all highmem zones by itself Joonsoo Kim
2015-02-12  7:32 ` [RFC 04/16] mm/vmstat: make node_page_state() handles all " Joonsoo Kim
2015-02-12  7:32 ` [RFC 05/16] mm/vmstat: watch out zone range overlap Joonsoo Kim
2015-02-12  7:32 ` [RFC 06/16] mm/page_alloc: " Joonsoo Kim
2015-02-12  7:32 ` [RFC 07/16] mm/page_isolation: " Joonsoo Kim
2015-02-13  6:40   ` Gioh Kim
2015-02-17  5:24     ` Joonsoo Kim
2015-02-12  7:32 ` [RFC 08/16] power: " Joonsoo Kim
2015-02-12  7:32 ` [RFC 09/16] mm/cma: introduce cma_total_pages() for future use Joonsoo Kim
2015-02-12  7:32 ` [RFC 10/16] mm/highmem: remove is_highmem_idx() Joonsoo Kim
2015-02-12  7:32 ` [RFC 11/16] mm/page_alloc: clean-up free_area_init_core() Joonsoo Kim
2015-02-12  7:32 ` [RFC 12/16] mm/cma: introduce new zone, ZONE_CMA Joonsoo Kim
2015-02-12  7:32 ` [RFC 13/16] mm/cma: populate ZONE_CMA and use this zone when GFP_HIGHUSERMOVABLE Joonsoo Kim
2015-02-14  5:02   ` Gioh Kim
2015-02-17  5:25     ` Joonsoo Kim
2015-03-03  8:28   ` Aneesh Kumar K.V
2015-03-06  7:13     ` Joonsoo Kim
2015-03-18 10:03   ` Aneesh Kumar K.V
2015-03-20  4:28     ` Joonsoo Kim
2015-02-12  7:32 ` [RFC 14/16] mm/cma: print stealed page count Joonsoo Kim
2015-02-12  7:32 ` [RFC 15/16] mm/cma: remove ALLOC_CMA Joonsoo Kim
2015-02-12  7:32 ` [RFC 16/16] mm/cma: remove MIGRATE_CMA Joonsoo Kim
2015-03-05 16:53 ` [RFC 00/16] Introduce ZONE_CMA Vlastimil Babka
2015-03-05 17:48   ` Vlastimil Babka
2015-03-06  7:26     ` Joonsoo Kim [this message]
2015-03-17  9:46 ` Aneesh Kumar K.V
2015-03-18  6:01   ` Joonsoo Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150306072649.GB15051@js1304-P5Q-DELUXE \
    --to=iamjoonsoo.kim@lge.com \
    --cc=akpm@linux-foundation.org \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=b.zolnierkie@samsung.com \
    --cc=gioh.kim@lge.com \
    --cc=hannes@cmpxchg.org \
    --cc=heesub.shin@samsung.com \
    --cc=lauraa@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=m.szyprowski@samsung.com \
    --cc=mgorman@suse.de \
    --cc=mina86@mina86.com \
    --cc=minchan@kernel.org \
    --cc=riel@redhat.com \
    --cc=ritesh.list@gmail.com \
    --cc=vbabka@suse.cz \
    --cc=zhuhui@xiaomi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox