public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Shawn Guo <shawnguo@kernel.org>
To: linux-kernel@vger.kernel.org, inux-arm-kernel@lists.infradead.org
Cc: Marek Szyprowski <m.szyprowski@samsung.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
	Michal Nazarewicz <mina86@mina86.com>,
	Vlastimil Babka <vbabka@suse.cz>,
	Laura Abbott <lauraa@codeaurora.org>,
	Minchan Kim <minchan@kernel.org>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Shawn Guo <shawnguo@kernel.org>
Subject: CMA region absolutely for a particular device?
Date: Tue, 7 Jun 2016 20:59:13 +0800	[thread overview]
Message-ID: <20160607125911.GA4279@tiger> (raw)

Hi,

I'm using a separate CMA region than the system default one for
a particular device to avoid fragmentation.  It does help.  But under
certain circumstance (memory shortage), it seems some of the pages in
the region will be used by system.  The really bad thing is that when
a CMA allocation tries to move these occupied pages around, it just
fails to do so with messages like "alloc_contig_range: ... PFNs busy".
These pages thus become holes in a contiguous block and prevent the
allocation from succeeding.

Is it possible to make a CMA absolutely for a particular device, and
even system movable pages cannot use the memory?  I can reserve a memory
region from kernel and manage it with some custom and private interface
for that particular device.  But obviously, the standard dma-mapping API
and established underneath CMA infrastructural is more desirable to use,
right?

This is an arm64 device running on 4.1 kernel.  Any comments or
suggestions will be appreciated.  Thanks.

Shawn

             reply	other threads:[~2016-06-07 13:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-07 12:59 Shawn Guo [this message]
2016-06-07 15:55 ` CMA region absolutely for a particular device? Laura Abbott
2016-06-08 11:04   ` Shawn Guo

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=20160607125911.GA4279@tiger \
    --to=shawnguo@kernel.org \
    --cc=arnd@arndb.de \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=inux-arm-kernel@lists.infradead.org \
    --cc=lauraa@codeaurora.org \
    --cc=laurent.pinchart+renesas@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=mina86@mina86.com \
    --cc=minchan@kernel.org \
    --cc=vbabka@suse.cz \
    /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