From: Catalin Marinas <catalin.marinas@arm.com>
To: Nicolin Chen <nicoleotsuka@gmail.com>
Cc: hch@lst.de, robin.murphy@arm.com, vdumpa@nvidia.com,
will.deacon@arm.com, chris@zankel.net, jcmvbkbc@gmail.com,
joro@8bytes.org, dwmw2@infradead.org, m.szyprowski@samsung.com,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-xtensa@linux-xtensa.org,
iommu@lists.linux-foundation.org, jonathanh@nvidia.com
Subject: Re: [PATCH v2 RFC/RFT] dma-contiguous: Get normal pages for single-page allocations
Date: Tue, 19 Mar 2019 14:43:01 +0000 [thread overview]
Message-ID: <20190319144301.GG59586@arrakis.emea.arm.com> (raw)
In-Reply-To: <20190305183202.16216-1-nicoleotsuka@gmail.com>
On Tue, Mar 05, 2019 at 10:32:02AM -0800, Nicolin Chen wrote:
> The addresses within a single page are always contiguous, so it's
> not so necessary to always allocate one single page from CMA area.
> Since the CMA area has a limited predefined size of space, it may
> run out of space in heavy use cases, where there might be quite a
> lot CMA pages being allocated for single pages.
>
> However, there is also a concern that a device might care where a
> page comes from -- it might expect the page from CMA area and act
> differently if the page doesn't.
>
> This patch tries to get normal pages for single-page allocations
> unless the device has its own CMA area. This would save resources
> from the CMA area for more CMA allocations. And it'd also reduce
> CMA fragmentations resulted from trivial allocations.
This is not sufficient. Some architectures/platforms declare limits on
the CMA range so that DMA is possible with all expected devices. For
example, on arm64 we keep the CMA in the lower 4GB of the address range,
though with this patch you only covered the iommu ops allocation.
Do you have any numbers to back this up? You don't seem to address
dma_direct_alloc() either but, as I said above, it's not trivial since
some platforms expect certain physical range for DMA allocations.
--
Catalin
next prev parent reply other threads:[~2019-03-19 14:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-05 18:32 [PATCH v2 RFC/RFT] dma-contiguous: Get normal pages for single-page allocations Nicolin Chen
2019-03-19 14:43 ` Catalin Marinas [this message]
2019-03-21 23:32 ` Nicolin Chen
2019-03-22 10:57 ` Catalin Marinas
2019-03-22 20:09 ` Nicolin Chen
2019-03-25 12:14 ` Catalin Marinas
2019-03-25 18:50 ` Nicolin Chen
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=20190319144301.GG59586@arrakis.emea.arm.com \
--to=catalin.marinas@arm.com \
--cc=chris@zankel.net \
--cc=dwmw2@infradead.org \
--cc=hch@lst.de \
--cc=iommu@lists.linux-foundation.org \
--cc=jcmvbkbc@gmail.com \
--cc=jonathanh@nvidia.com \
--cc=joro@8bytes.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-xtensa@linux-xtensa.org \
--cc=m.szyprowski@samsung.com \
--cc=nicoleotsuka@gmail.com \
--cc=robin.murphy@arm.com \
--cc=vdumpa@nvidia.com \
--cc=will.deacon@arm.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