From: Minchan Kim <minchan@kernel.org>
To: Michal Nazarewicz <mina86@mina86.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>,
linux-mm@kvack.org, linaro-mm-sig@lists.linaro.org,
linux-kernel@vger.kernel.org,
Kyungmin Park <kyungmin.park@samsung.com>,
Andrew Morton <akpm@linux-foundation.org>,
Mel Gorman <mel@csn.ul.ie>,
Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Subject: Re: [PATCH] mm: cma: allocate pages from CMA if NR_FREE_PAGES approaches low water mark
Date: Wed, 21 Nov 2012 22:25:41 +0900 [thread overview]
Message-ID: <20121121132540.GA2084@barrios> (raw)
In-Reply-To: <xa1t7gpfgl53.fsf@mina86.com>
On Wed, Nov 21, 2012 at 02:07:04PM +0100, Michal Nazarewicz wrote:
> On Wed, Nov 21 2012, Minchan Kim wrote:
> > So your concern is that too many free pages in MIGRATE_CMA when OOM happens
> > is odd? It's natural with considering CMA design which kernel never fallback
> > non-movable page allocation to CMA area. I guess it's not a your concern.
> >
> > Let's think below extreme cases.
> >
> > = Before =
> >
> > * 1000M DRAM system.
> > * 400M kernel used pages.
> > * 300M movable used pages.
> > * 300M cma freed pages.
> >
> > 1. kernel want to request 400M non-movable memory, additionally.
> > 2. VM start to reclaim 300M movable pages.
> > 3. But it's not enough to meet 400M request.
> > 4. go to OOM. (It's natural)
> >
> > = After(with your patch) =
> >
> > * 1000M DRAM system.
> > * 400M kernel used pages.
> > * 300M movable *freed* pages.
> > * 300M cma used pages(by your patch, I simplified your concept)
> >
> > 1. kernel want to request 400M non-movable memory.
> > 2. 300M movable freed pages isn't enough to meet 400M request.
> > 3. Also, there is no point to reclaim CMA pages for non-movable allocation.
> > 4. go to OOM. (It's natural)
> >
> > There is no difference between before and after in allocation POV.
> > Let's think another example.
> >
> > = Before =
> >
> > * 1000M DRAM system.
> > * 400M kernel used pages.
> > * 300M movable used pages.
> > * 300M cma freed pages.
> >
> > 1. kernel want to request 300M non-movable memory.
> > 2. VM start to reclaim 300M movable pages.
> > 3. It's enough to meet 300M request.
> > 4. happy end
> >
> > = After(with your patch) =
> >
> > * 1000M DRAM system.
> > * 400M kernel used pages.
> > * 300M movable *freed* pages.
> > * 300M cma used pages(by your patch, I simplified your concept)
> >
> > 1. kernel want to request 300M non-movable memory.
> > 2. 300M movable freed pages is enough to meet 300M request.
> > 3. happy end.
> >
> > There is no difference in allocation POV, too.
>
> The difference thou is that before 30% of memory is wasted (ie. free),
> whereas after all memory is used. The main point of CMA is to make the
> memory useful if devices are not using it. Having it not allocated is
> defeating that purpose.
I think it's not a waste because if reclaimed movable pages is working set,
they are soon reloaded to migrate_cma in this time.
>
> --
> Best regards, _ _
> .o. | Liege of Serenely Enlightened Majesty of o' \,=./ `o
> ..o | Computer Science, MichaA? a??mina86a?? Nazarewicz (o o)
> ooo +----<email/xmpp: mpn@google.com>--------------ooO--(_)--Ooo--
--
Kind Regards,
Minchan Kim
--
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>
next prev parent reply other threads:[~2012-11-21 13:25 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-12 8:59 [PATCH] mm: cma: allocate pages from CMA if NR_FREE_PAGES approaches low water mark Marek Szyprowski
2012-11-14 22:58 ` Andrew Morton
2012-11-19 15:38 ` Marek Szyprowski
2012-11-19 20:43 ` Andrew Morton
2012-11-20 0:01 ` Minchan Kim
2012-11-20 14:49 ` Marek Szyprowski
2012-11-20 15:41 ` Michal Nazarewicz
2012-11-21 1:05 ` Minchan Kim
2012-11-21 13:07 ` Michal Nazarewicz
2012-11-21 13:25 ` Minchan Kim [this message]
2012-11-21 15:50 ` Marek Szyprowski
2012-11-23 4:42 ` Minchan 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=20121121132540.GA2084@barrios \
--to=minchan@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=b.zolnierkie@samsung.com \
--cc=kyungmin.park@samsung.com \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=m.szyprowski@samsung.com \
--cc=mel@csn.ul.ie \
--cc=mina86@mina86.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;
as well as URLs for NNTP newsgroup(s).